From: Laine Stump Date: Fri, 25 Jun 2010 00:59:24 +0000 (-0400) Subject: Selectively ignore domainSetSecurityAllLabel failure in domain restore X-Git-Tag: v0.8.2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06f81c63ebc19cb0e51f9b397991f6d6ae56d090;p=thirdparty%2Flibvirt.git Selectively ignore domainSetSecurityAllLabel failure in domain restore 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. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6ef75d0b18..2a277a5057 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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 */