]> xenbits.xensource.com Git - libvirt.git/commit
qemu: block: Refactor node name detection code
authorPeter Krempa <pkrempa@redhat.com>
Wed, 26 Jul 2017 07:36:21 +0000 (09:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 27 Jul 2017 07:47:40 +0000 (09:47 +0200)
commit0175dc6ea024d4edd0f59571c3f5fa80d1ec1c0e
tree987ada21dcc73901974b6091ad5e122fc832fe28
parentc61d1693277952fc18fdb15770805d9eace3acef
qemu: block: Refactor node name detection code

Remove the complex and unreliable code which inferred the node name
hierarchy only from data returned by 'query-named-block-nodes'. It turns
out that query-blockstats contain the full hierarchy of nodes as
perceived by qemu so the inference code is not necessary.

In query blockstats, the 'parent' object corresponds to the storage
behind a storage volume and 'backing' corresponds to the lower level of
backing chain. Since all have node names this data can be really easily
used to detect node names.

In addition to the code refactoring the one remaining test case needed
to be fixed along.

Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_block.c
src/qemu/qemu_block.h
tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-blockstats.json [new file with mode: 0644]
tests/qemumonitorjsondata/qemumonitorjson-nodename-basic-named-nodes.json
tests/qemumonitorjsondata/qemumonitorjson-nodename-basic.result
tests/qemumonitorjsontest.c