]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Remove /dev mount info properly
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 5 Jan 2017 15:24:55 +0000 (16:24 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 5 Jan 2017 15:24:55 +0000 (16:24 +0100)
Just so it doesn't bite us in the future, even though it's unlikely.

And fix the comment above it as well.  Commit e08ee7cd3405 took the
info from the function it's calling, but that was lie itself in the
first place.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_domain.c

index 55ccd16d25e070de6fbfb237f4a97e96bdfaf286..495d86a011a6a835878be17c347eb4ebf4d4f75f 100644 (file)
@@ -226,11 +226,10 @@ qemuDomainGetPreservedMounts(virQEMUDriverPtr driver,
         return 0;
     }
 
-    /* Okay, this is crazy. But virFileGetMountSubtree() fetched us all the
-     * mount points under /dev including /dev itself. Fortunately, the paths
-     * are sorted based on their length so we skip the first one (/dev) as it
-     * is handled differently anyway. */
-    VIR_DELETE_ELEMENT(mounts, 0, nmounts);
+    /* Since the list is sorted and only has paths that start with /dev, the
+     * /dev itself can only be first. */
+    if (STREQ(mounts[0], "/dev"))
+        VIR_DELETE_ELEMENT(mounts, 0, nmounts);
 
     if (VIR_ALLOC_N(paths, nmounts) < 0)
         goto error;