• J
    storage: Fix problem with disk backend pool allocation calculation · 6839b08b
    John Ferlan 提交于
    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.
    6839b08b
storage_backend_disk.c 29.4 KB