mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
7ca81e6f19
virsh snapshot-create-as supports 'file' storage type in --diskspec by default. But it doesn't support 'block' storage type in the virshParseSnapshotDiskspec(). So if a snapshot on a block device (e.g. LV) was created, the type of current running storage source in dumpxml is inconsistent with the actual backend storage source. It will check file-system type mismatch failed and return an error message of 'Migration without shared storage is unsafe' when VM performs a live migration after this snapshot. Considering virsh has to be able to work remotely that recognizing a block device by prefix /dev/ or by stat() may be not suitable, so adding a "stype" field for the --diskspec string which will be either "file" or "block". e.g. --diskspec vda,snapshot=external,driver=qcow2,stype=block,file=/dev/xxx. Signed-off-by: Liu Dayu <liu.dayu@zte.com.cn> Signed-off-by: Peter Krempa <pkrempa@redhat.com>