]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Fix problem with disk backend pool allocation calculation
authorJohn Ferlan <jferlan@redhat.com>
Fri, 22 May 2015 01:10:56 +0000 (21:10 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 28 May 2015 17:32:16 +0000 (13:32 -0400)
commit6839b08ba1e5e6dfe58d43a933d740198518e49d
tree8fa2f1e8baa654274bbe28c4dff8ac9743821898
parent48809204d16348c540ac9571b517312c30da21da
storage: Fix problem with disk backend pool allocation calculation

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

The disk pool recalculates the pool allocation, capacity, and available
values each time through processing a newly created disk partition. This
created an issue with the allocation setting since the code used is shared
with the refresh path. Each path calls virStorageBackendDiskReadPartitions
which initializes the pool values and then processes the partition table
from the 'libvirt_parthelper' utility output with the only difference being
create passes a specific volume to be processed while refresh pass a NULL
indicating to process all volumes. That passed volume is check during the
virStorageBackendDiskMakeVol call to see if the current partition described
by the volume key already exists. If it exists, then no adjustments are
made to the allocation and the next entry in the output is checked.

For the create path this resulted in only the most recently created
partition size would be accounted for in the 'allocation' setting. This
patch thus checks whether the incoming volume is NULL before clearing
the pool allocation value.
src/storage/storage_backend_disk.c