The following patches resolve a few issues either explicitly generated
via a bz or seen while investigating/testing the results from bzs.
Patches 1-2 were discovered while working through patch 3. I found that
deleting volumes from a pool was always going through the fork processing.
I neglected to recall that when the volume was placed into the pool the
mode, uid, & gid values can be updated. Thus on some delete paths we may
not be called with -1 values. Because we were going through the fork
processing I found that the error message displayed when a volume target
no longer exists was wrong - that is the caller was expecting a return
of -1 and errno being set. In this case looking for ENOENT and continuing
on with removal of the volume from the pool.
Patch 3 stands by itself - it's certainly one of those that could be
deemed don't do that, but since we do check whether the volume was
removed without libvirt doing the removal, I guess we should check
whether the volume exists before trying to create it and using the
refresh pool is the simplest mechanism for all pools.
Patches 4-7 are intertwined - the disk backend code made the assumption
that the volume/device being used for the pool was "good". The normal
mode of operation is to define, build, start, but there's never been
a "guarantee" or check that what is "on" the volume is valid for the
type of pool
Patch 8 was disk backend related - so while I'm in the code, I may as
well make the change as well.
John Ferlan (8):
virfile: Add extra check for direct delete in virFileRemove
virfile: Fix error path for forked virFileRemove
storage: Prior to creating a volume, refresh the pool
storage: Refactor disk label checking
storage: Add param to check whether we can write a disk label
storage: Add additional errors/checks for disk label
storage: Introduce virStorageBackendDiskStartPool
storage: Adjust calculation of alloc/capacity for disk
src/libvirt_private.syms | 1 +
src/storage/storage_backend_disk.c | 162 ++++++++++++++++++++++++++++++-------
src/storage/storage_driver.c | 9 +++
src/util/virfile.c | 11 ++-
4 files changed, 151 insertions(+), 32 deletions(-)
--
2.1.0