]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Ignore failure to mount SELinux filesystem in container
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 1 Jul 2013 16:41:21 +0000 (17:41 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 2 Jul 2013 13:00:13 +0000 (14:00 +0100)
User namespaces will deny the ability to mount the SELinux
filesystem. This is harmless for libvirt's LXC needs, so the
error can be ignored.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_container.c

index d9734b50ff7a4c8e1c679b54fa3d28054707c8d4..b37300b16da3a863edac3446e6fd8ab747aca65f 100644 (file)
@@ -741,6 +741,12 @@ static int lxcContainerMountBasicFS(void)
         VIR_DEBUG("Mount %s on %s type=%s flags=%x, opts=%s",
                   srcpath, mnts[i].dst, mnts[i].type, mnts[i].mflags, mnts[i].opts);
         if (mount(srcpath, mnts[i].dst, mnts[i].type, mnts[i].mflags, mnts[i].opts) < 0) {
+#if WITH_SELINUX
+            if (STREQ(mnts[i].src, SELINUX_MOUNT) &&
+                (errno == EINVAL || errno == EPERM))
+                continue;
+#endif
+
             virReportSystemError(errno,
                                  _("Failed to mount %s on %s type %s flags=%x opts=%s"),
                                  srcpath, mnts[i].dst, NULLSTR(mnts[i].type),