libvirt/src/storage
John Ferlan 4cd7d220c9 storage: On 'buildVol' failure don't delete the volume
https://bugzilla.redhat.com/show_bug.cgi?id=1233003

Commit id 'fdda3760' only managed a symptom where it was possible to
create a file in a pool without libvirt's knowledge, so it was reverted.

The real fix is to have all the createVol API's which actually create
a volume (disk, logical, zfs) and the buildVol API's which handle the
real creation of some volume file (fs, rbd, sheepdog) manage deleting
any volume which they create when there is some sort of error in
processing the volume.

This way the onus isn't left up to the storage_driver to determine whether
the buildVol failure was due to some failure as a result of adjustments
made to the volume after creation such as getting sizes, changing ownership,
changing volume protections, etc. or simple a failure in creation.

Without needing to consider that the volume has to be removed, the
buildVol failure path only needs to remove the volume from the pool.
This way if a creation failed due to duplicate name, libvirt wouldn't
remove a volume that it didn't create in the pool target.
2015-11-04 07:21:11 -05:00
..
parthelper.c
storage_backend_disk.c storage: Adjust calculation of alloc/capacity for disk 2015-10-05 08:14:44 -04:00
storage_backend_disk.h
storage_backend_fs.c virfile: Rename virFileUnlink to virFileRemove 2015-09-21 08:24:16 -04:00
storage_backend_fs.h
storage_backend_gluster.c
storage_backend_gluster.h
storage_backend_iscsi.c
storage_backend_iscsi.h
storage_backend_logical.c Avoid using !STREQ and !STRNEQ 2015-10-21 15:03:35 +02:00
storage_backend_logical.h
storage_backend_mpath.c mpath: Update path in CheckPool function 2015-06-30 08:47:02 -04:00
storage_backend_mpath.h
storage_backend_rbd.c rbd: Remove snapshots if the DELETE_WITH_SNAPSHOTS flag has been provided 2015-10-27 16:12:12 -04:00
storage_backend_rbd.h
storage_backend_scsi.c scsi: Force error for SCSI pools on virStorageBackendSCSIFindLUs failure 2015-06-24 09:18:59 -04:00
storage_backend_scsi.h
storage_backend_sheepdog.c storage: Remove duplicitous refreshVol in Sheepdog buildVol 2015-10-13 18:03:55 -04:00
storage_backend_sheepdog.h
storage_backend_zfs.c
storage_backend_zfs.h
storage_backend.c storage: Cleanup failures in virStorageBackendCreateRaw 2015-11-04 07:21:11 -05:00
storage_backend.h storage: On 'buildVol' failure don't delete the volume 2015-11-04 07:21:11 -05:00
storage_driver.c storage: On 'buildVol' failure don't delete the volume 2015-11-04 07:21:11 -05:00
storage_driver.h