]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Fix any VolLookupByPath if we have an empty logical pool
authorCole Robinson <crobinso@redhat.com>
Wed, 25 Jan 2012 17:07:14 +0000 (12:07 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 17 May 2012 14:43:31 +0000 (08:43 -0600)
On F16 at least, empty volume groups don't have a directory under /dev.
The directory only appears once a logical volume is created.

This tickles some behavior in BackendStablePath which ends with
libvirt sleeping for 5 seconds while waiting for the directory to appear.
This causes all sorts of problems for the virStorageVolLookupByPath API
which virtinst uses, even if trying to resolve a path that is independent
of the logical pool.

In reality we don't even need to do that checking since logical pools
always have a stable target path. Short circuit the polling in that
case.

Fixes bug 782261
(cherry picked from commit 275155f664614fd32bcf5e963488e6f97b66dae4)

src/storage/storage_backend.c

index d125504b441245bfdf2f354eff3b29d4f8e4f6f6..a97eeffc6a8ac2a64aec418d3c6dc4547e47490f 100644 (file)
@@ -1327,6 +1327,10 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool,
     if (!STRPREFIX(pool->def->target.path, "/dev"))
         goto ret_strdup;
 
+    /* Logical pools are under /dev but already have stable paths */
+    if (pool->def->type == VIR_STORAGE_POOL_LOGICAL)
+        goto ret_strdup;
+
     /* We loop here because /dev/disk/by-{id,path} may not have existed
      * before we started this operation, so we have to give it some time to
      * get created.