[libvirt] [PATCH 17/24] qemu: block: store and test driver names for detected storage nodes

Eric Blake eblake at redhat.com
Wed Jul 26 21:36:53 UTC 2017


On 07/26/2017 05:00 AM, Peter Krempa wrote:
> Store the 'drv' field both for the storage node and for the format node
> and format them in the test case.
> ---
>  src/qemu/qemu_block.c                                      | 14 +++++++++++---
>  src/qemu/qemu_block.h                                      |  4 ++++
>  .../qemumonitorjson-nodename-basic.result                  |  6 ++++++
>  tests/qemumonitorjsontest.c                                |  2 ++
>  4 files changed, 23 insertions(+), 3 deletions(-)
> +++ b/src/qemu/qemu_block.h
> @@ -34,6 +34,10 @@ struct qemuBlockNodeNameBackingChainData {
>      char *nodeformat;   /* node name of the format layer */
>      char *nodestorage;  /* node name of the storage backing the format node */
> 
> +    /* for testing purposes */
> +    char *drvformat;
> +    char *drvstorage;
> +

Should those two fields be listed...

>      qemuBlockNodeNameBackingChainDataPtr backing;

...after this one, to make it obvious where the 'for testing purposes' ends?

>      filename    : '/var/lib/libvirt/images/rhel7.3.qcow2'
>      format node : '#block558'
> +    format drv  : 'qcow2'
>      storage node: '#block481'
> +    storage drv : 'file'

But I definitely see how it will be useful when we mix more than one
protocol, or where a backing chain ends in raw instead of qcow2.
Rearranging fields in a declaration is minor, so you are still okay adding:

Reviewed-by: Eric Blake <eblake at redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170726/f10a74f4/attachment-0001.sig>


More information about the libvir-list mailing list