• J
    storage: Don't duplicate efforts of backend driver · 2ac0e647
    John Ferlan 提交于
    https://bugzilla.redhat.com/show_bug.cgi?id=1206521
    
    If the backend driver updates the pool available and/or allocation values,
    then the storage_driver VolCreateXML, VolCreateXMLFrom, and VolDelete APIs
    should not change the value; otherwise, it will appear as if the values
    were "doubled" for each change.  Additionally since unsigned arithmetic will
    be used depending on the size and operation, either or both values could be
    appear to be much larger than they should be (in the EiB range).
    
    Currently only the disk pool updates the values, but other pools could.
    Assume a "fresh" disk pool of 500 MiB using /dev/sde:
    
    $ virsh pool-info disk-pool
    ...
    Capacity:       509.88 MiB
    Allocation:     0.00 B
    Available:      509.84 MiB
    
    $ virsh vol-create-as disk-pool sde1 --capacity 300M
    
    $ virsh pool-info disk-pool
    ...
    Capacity:       509.88 MiB
    Allocation:     600.47 MiB
    Available:      16.00 EiB
    
    Following assumes disk backend updated to refresh the disk pool at deletion
    of primary partition as well as extended partition:
    
    $ virsh vol-delete --pool disk-pool sde1
    Vol sde1 deleted
    
    $ virsh pool-info disk-pool
    ...
    Capacity:       509.88 MiB
    Allocation:     9.73 EiB
    Available:      6.27 EiB
    
    This patch will check if the backend updated the pool values and honor that
    update.
    2ac0e647
storage_driver.c 93.2 KB