• L
    virsh: support block device storage type in virshParseSnapshotDiskspec · 7ca81e6f
    Liu Dayu 提交于
    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: NLiu Dayu <liu.dayu@zte.com.cn>
    Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
    7ca81e6f
virsh-snapshot.c 60.7 KB