]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Selectively ignore domainSetSecurityAllLabel failure in domain restore
authorLaine Stump <laine@laine.org>
Fri, 25 Jun 2010 00:59:24 +0000 (20:59 -0400)
committerLaine Stump <laine@laine.org>
Mon, 28 Jun 2010 15:56:02 +0000 (11:56 -0400)
When the saved domain image is on an NFS share, at least some part of
domainSetSecurityAllLabel will fail (for example, selinux labels can't
be modified). To allow domain restore to still work in this case, just
ignore the errors.

src/qemu/qemu_driver.c

index 6ef75d0b184fb6cf45c5f38466d9adf6f2b92a7e..2a277a505776db7405375ec43e6fd826735b13db 100644 (file)
@@ -3428,8 +3428,10 @@ static int qemudStartVMDaemon(virConnectPtr conn,
     DEBUG0("Generating setting domain security labels (if required)");
     if (driver->securityDriver &&
         driver->securityDriver->domainSetSecurityAllLabel &&
-        driver->securityDriver->domainSetSecurityAllLabel(vm, stdin_path) < 0)
-        goto cleanup;
+        driver->securityDriver->domainSetSecurityAllLabel(vm, stdin_path) < 0) {
+        if (virStorageFileIsSharedFS(stdin_path) != 1)
+            goto cleanup;
+    }
 
     /* Ensure no historical cgroup for this VM is lying around bogus
      * settings */