]> xenbits.xensource.com Git - libvirt.git/commitdiff
Don't chown qemu saved image back to root after save if dynamic_ownership=0
authorLaine Stump <laine@laine.org>
Wed, 5 Jan 2011 21:53:03 +0000 (16:53 -0500)
committerLaine Stump <laine@laine.org>
Thu, 6 Jan 2011 01:22:19 +0000 (20:22 -0500)
When dynamic_ownership=0, saved images must be owned by the same uid
as is used to run the qemu process, otherwise restore won't work. To
accomplish this, qemuSecurityDACRestoreSavedStateLabel() needs to
simply return when it's called.

This fix is in response to:

  https://bugzilla.redhat.com/show_bug.cgi?id=661720

src/qemu/qemu_security_dac.c

index b5c52d15e54fdc1f6a923fc279262c72688e7822..6b6170a9014112c25c1c40cef1a8942ae43b1e64 100644 (file)
@@ -533,7 +533,7 @@ qemuSecurityDACRestoreSavedStateLabel(virSecurityDriverPtr drv ATTRIBUTE_UNUSED,
                                       virDomainObjPtr vm ATTRIBUTE_UNUSED,
                                       const char *savefile)
 {
-    if (!driver->privileged)
+    if (!driver->privileged || !driver->dynamicOwnership)
         return 0;
 
     return qemuSecurityDACRestoreSecurityFileLabel(savefile);