]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu-ns: Detect /dev/* mount point duplicates even better
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Nov 2017 14:20:10 +0000 (15:20 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Nov 2017 15:38:26 +0000 (16:38 +0100)
In 4f1570720218302 I've tried to make duplicates detection for
nested /dev mount better. However, I've missed the obvious case
when there are two same mount points. For instance if:

  # mount --bind /dev/blah /dev/blah
  # mount --bind /dev/blah /dev/blah

Yeah, very unlikely (in qemu driver world) but possible.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c

index 7024635470319366ce51db472aa56d990b5de4c7..61d28337b8f0d5261dfb0abe38d527b317277f85 100644 (file)
@@ -8352,7 +8352,7 @@ qemuDomainGetPreservedMounts(virQEMUDriverConfigPtr cfg,
         while (j < nmounts) {
             char *c = STRSKIP(mounts[j], mounts[i]);
 
-            if (c && *c == '/') {
+            if (c && (*c == '/' || *c == '\0')) {
                 VIR_DEBUG("Dropping path %s because of %s", mounts[j], mounts[i]);
                 VIR_DELETE_ELEMENT(mounts, j, nmounts);
             } else {