]> git.ipfire.org Git - thirdparty/libvirt.git/commit
getstats: rearrange blockinfo gathering
authorEric Blake <eblake@redhat.com>
Wed, 17 Dec 2014 06:13:04 +0000 (23:13 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 17 Dec 2014 06:13:04 +0000 (23:13 -0700)
commit05e702cfd4b97da7d6434e7fbd7afc070f3d6b73
tree98f54c533c8bd12d907c3da1b8b7ec5240c6ac90
parentb1802714dab51bd5f0214a4d93a2c0b635bc5f14
getstats: rearrange blockinfo gathering

Ultimately, we want to avoid read()ing a file while qemu is running.
We still have to open() block devices to determine their physical
size, but that is safer.  This patch rearranges code to group
together all code that reads the image, to make it easier for later
patches to skip the metadata collection when possible.

* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Check for empty
disk up front.  Place metadata reading next to use.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_driver.c