[libvirt] [PATCH 3/3] Selectively ignore domainSetSecurityAllLabel failure in domain restore
Laine Stump
laine at laine.org
Fri Jun 25 11:42:15 UTC 2010
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 | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6bbc94b..6dbcf6e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3368,8 +3368,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 (virFileIsOnNetworkShare(stdin_path) != 1)
+ goto cleanup;
+ }
/* Ensure no historical cgroup for this VM is lying around bogus
* settings */
--
1.7.1
More information about the libvir-list
mailing list