libvirt/src/storage
John Ferlan 2ac0e647bd storage: Don't duplicate efforts of backend driver
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.
2015-04-09 19:04:18 -04:00
..
parthelper.c Remove unnecessary curly brackets in src/storage/ 2014-11-14 17:13:01 +01:00
storage_backend_disk.c storage: Need to update freeExtent at delete primary partition 2015-04-09 19:04:18 -04:00
storage_backend_disk.h
storage_backend_fs.c storage: Remove unused attribute conn from 'checkPool' callback 2015-04-02 11:57:07 +02:00
storage_backend_fs.h storage: add file functions for local and block files 2014-02-14 10:47:57 +01:00
storage_backend_gluster.c Revert "Restore skipping of setting capacity" 2015-03-02 08:07:11 +01:00
storage_backend_gluster.h storage: Add storage file backends for gluster 2014-02-14 11:07:23 +01:00
storage_backend_iscsi.c iscsi: Fix exit path for virStorageBackendISCSIFindLUs failure 2015-04-02 08:46:26 -04:00
storage_backend_iscsi.h Move functions using iscsiadm to viriscsi.c 2014-03-20 18:04:50 +01:00
storage_backend_logical.c storage: Remove unused attribute conn from 'checkPool' callback 2015-04-02 11:57:07 +02:00
storage_backend_logical.h
storage_backend_mpath.c storage: Remove unused attribute conn from 'checkPool' callback 2015-04-02 11:57:07 +02:00
storage_backend_mpath.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
storage_backend_rbd.c Allow creating volumes with a backing store but no capacity 2015-03-02 08:07:11 +01:00
storage_backend_rbd.h
storage_backend_scsi.c scsi: Remove unused 'type_path' in processLU 2015-04-02 08:46:30 -04:00
storage_backend_scsi.h
storage_backend_sheepdog.c storage: sheepdog: Avoid skipping variable initialization 2015-03-02 10:09:49 +01:00
storage_backend_sheepdog.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
storage_backend_zfs.c storage: Remove unused attribute conn from 'checkPool' callback 2015-04-02 11:57:07 +02:00
storage_backend_zfs.h storage: ZFS support 2014-08-12 19:40:20 +04:00
storage_backend.c Introduce virBitmapIsBitSet 2015-03-13 15:31:33 +01:00
storage_backend.h storage: Remove unused attribute conn from 'checkPool' callback 2015-04-02 11:57:07 +02:00
storage_driver.c storage: Don't duplicate efforts of backend driver 2015-04-09 19:04:18 -04:00
storage_driver.h storage: Introduce storagePoolLookupByTargetPath 2014-12-02 17:51:57 +01:00