[libvirt] [PATCH 1/2] Storage: Suppress metadata refresh for volumes being built.

Prerna Saxena prerna at linux.vnet.ibm.com
Tue May 5 03:13:21 UTC 2015

Libvirt periodically calls 'stat' on all volumes in a storage pool,
to update fields such as 'target.allocation'.

The operation doesnt make sense for a volume which is curently being allocated.
Also, the 'target.allocation' sub-field is taken into account while copying a raw image. To suppress any (potential) corruption, libvirt must not attempt to refresh a volume currently being built.

Signed-off-by: Prerna Saxena <prerna at linux.vnet.ibm.com>
 src/storage/storage_backend.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 289f454..355fc7f 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -1576,6 +1576,9 @@ virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
     int ret;
+    if (vol->building)
+        return 0;
     if ((ret = virStorageBackendUpdateVolTargetInfo(&vol->target,
                                                     openflags)) < 0)

Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India

More information about the libvir-list mailing list