[libvirt] [PATCH] storageVolCreateXMLFrom: Allow multiple accesses to origvol

Michal Privoznik mprivozn at redhat.com
Wed Apr 16 14:05:38 UTC 2014


When creating a new volume, it is possible to copy data into it from
another already existing volume (referred to as @origvol). Obviously,
the read-only access to @origvol is required, which is thread safe
(probably not performance-wise though). However, with current code
both @newvol and @origvol are marked as building for the time of
copying data from the @origvol to @newvol. The rationale behind
is to disallow some operations on both @origvol and @newvol, e.g.
vol-wipe, vol-delete, vol-download. While it makes sense to not allow
such operations on partly copied mirror, but it doesn't make sense to
disallow the operations on the source (@origvol).

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/storage/storage_driver.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 2cb8347..a3f398f 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1912,7 +1912,6 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
 
     /* Drop the pool lock during volume allocation */
     pool->asyncjobs++;
-    origvol->building = 1;
     newvol->building = 1;
     virStoragePoolObjUnlock(pool);
 
@@ -1929,7 +1928,6 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
         virStoragePoolObjLock(origpool);
     storageDriverUnlock(driver);
 
-    origvol->building = 0;
     newvol->building = 0;
     allocation = newvol->target.allocation;
     pool->asyncjobs--;
-- 
1.9.0




More information about the libvir-list mailing list