[libvirt] [PATCH v2] libvirt: support block device storage typein virshParseSnapshotDiskspec

liu.dayu at zte.com.cn liu.dayu at zte.com.cn
Wed Jul 10 02:31:47 UTC 2019


>> --->> Patch v1:>> https://www.redhat.com/archives/libvir-list/2019-June/msg01248.html>> >> Changes in v2:>>  - Adding a "stype" field for the --diskspec string which will indicate a "file" or "block" storage type.>> I'm a little late for bike-shedding, but could we have supported:> --diskspec vda,block=/dev/xxx> instead of the more verbose> --diskspec vda,file=/dev/xxx,stype=block


This way is concise and more directly. Both OK currently.


But if --diskspec options extend in the future, 


e.g. --diskspec vda,stype=block,file=/dev/xxx,running=/dev/yyy,backing=/dev/zzz,...


maybe 'stype' is a unified way to indicate those storage types other than change prefix name.











原始邮件



发件人:EricBlake <eblake at redhat.com>
收件人:刘大宇10031743;libvir-list at redhat.com <libvir-list at redhat.com>;
抄送人:汪翼10129963;王业超10154425;
日 期 :2019年07月09日 21:48
主 题 :Re: [libvirt] [PATCH v2] libvirt: support block device storage typein virshParseSnapshotDiskspec


On 7/8/19 4:46 AM, Liu Dayu wrote:
> 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 at zte.com.cn>
> ---
> Patch v1:
> https://www.redhat.com/archives/libvir-list/2019-June/msg01248.html
> 
> Changes in v2:
>  - Adding a "stype" field for the --diskspec string which will indicate a "file" or "block" storage type.

I'm a little late for bike-shedding, but could we have supported:
--diskspec vda,block=/dev/xxx
instead of the more verbose
--diskspec vda,file=/dev/xxx,stype=block


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190710/3898ade6/attachment-0001.htm>


More information about the libvir-list mailing list