]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: monitor: Fix usage of 'query-blockstats'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 24 Nov 2021 16:22:29 +0000 (17:22 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 25 Nov 2021 14:27:56 +0000 (15:27 +0100)
commitd120fc5253f620a6a76cfb15f1e09337e8b3d926
treed28c8bd2cc3f7418b7f34c331ad9f172b167e5fe
parent4b453bbb2fc7794452024673b7d8606c189ce2a5
qemu: monitor: Fix usage of 'query-blockstats'

Commit bc24810c2cab modified code querying blockstats to use the
'query-nodes' parameter so that we can fetch stats also for images which
are not attached to a frontend such as block copy and backup scratch
images.

Unfortunately that broke the old blockstats because if 'query-nodes' is
enabled qemu doesn't output the 'qdev' parameter which our code used for
matching to the disk and also qemu neglects to populate the frontend
stats at all so we can't even switch to using nodename for matching.

To fix this we need to do two calls, one with 'query-nodes' disabled
using the old logic to populate everything and then an additional one
which populates all the remaining images.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/246
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Erik Skultety <eskultet@redhat.com>
src/qemu/qemu_monitor_json.c
tests/qemumonitorjsontest.c