[libvirt] [PATCH 21/24] tests: qemumonitorjson: Add test case for node name detection with blockjob

Eric Blake eblake at redhat.com
Wed Jul 26 22:04:01 UTC 2017


On 07/26/2017 05:00 AM, Peter Krempa wrote:
> qemu 2.9 returns an extra layer in the backing data if a block job is
> active. Add a test case to see whether our code properly detects and
> ignores such layer.
> ---
>  ...mumonitorjson-nodename-blockjob-blockstats.json | 301 +++++++++
>  ...umonitorjson-nodename-blockjob-named-nodes.json | 682 +++++++++++++++++++++
>  .../qemumonitorjson-nodename-blockjob.result       |  26 +
>  tests/qemumonitorjsontest.c                        |   1 +
>  4 files changed, 1010 insertions(+)
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-blockstats.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob-named-nodes.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
> 

Again, the sequence of steps used to get to this point (as setting up a
block job is not necessarily trivial) might be useful reference material
when reading git log in the future.

> +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-blockjob.result
> @@ -0,0 +1,26 @@
> +drive-ide0-0-0
> +filename    : '/var/lib/libvirt/images/d.1499152698'
> +format node : '#block179'
> +format drv  : 'qcow2'
> +storage node: '#block042'
> +storage drv : 'file'
> +  filename    : '/var/lib/libvirt/images/d.1499152668'
> +  format node : '#block312'

Looks like two snapshots where libvirt created the filename via
timestamps (which of course is not trivially reproducible, but easy to
understand when I get higher numbers), on top of a chain you built...

> +  format drv  : 'qcow2'
> +  storage node: '#block259'
> +  storage drv : 'file'
> +    filename    : '/var/lib/libvirt/images/d'
> +    format node : '#block551'
> +    format drv  : 'qcow2'
> +    storage node: '#block449'
> +    storage drv : 'file'
> +      filename    : '/var/lib/libvirt/images/c'
> +      format node : '#block717'
> +      format drv  : 'qcow2'
> +      storage node: '#block618'
> +      storage drv : 'file'
> +        filename    : '/var/lib/libvirt/images/a'

of 'a'<-'c'<-'d' - I suppose you've already merged 'b' from some other
operation?

At any rate, the new test is useful, and adding a backstory to the
commit message won't change the patch body, so:
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/afa1a66b/attachment-0001.sig>


More information about the libvir-list mailing list