]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Adjust calculation of alloc/capacity for disk
authorJohn Ferlan <jferlan@redhat.com>
Thu, 1 Oct 2015 15:37:17 +0000 (11:37 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 23 Dec 2015 23:17:49 +0000 (18:17 -0500)
commiteb9aaa26a82e972614ad89717ea6ace05c62c3cf
tree4bf324baca569a38bce8e4346d776b0c79f5304c
parent770ffbf8575e213bfb3951808f85e9682cdc114b
storage: Adjust calculation of alloc/capacity for disk

https://bugzilla.redhat.com/show_bug.cgi?id=1247987

Calculation of the extended and logical partition values for the disk
pool is complex. As the bz points out an extended partition should have
it's allocation initialized to 0 (zero) and keep the capacity as the size
dictated by the extents read.  Then for each logical partition found,
adjust the allocation of the extended partition.

Finally, previous logic tried to avoid recalculating things if a logical
partition was deleted; however, since we now have special logic to handle
the allocation of the extended partition, just make life easier by reading
the partition table again - rather than doing the reverse adjustment.

(cherry picked from commit 1895b42114c932495c2242d6847e47c054955998)
src/storage/storage_backend_disk.c