]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Properly label FDs when restoring domain with static label
authorShivaprasad G Bhat <shivaprasadbhat@gmail.com>
Wed, 11 Jun 2014 13:48:34 +0000 (09:48 -0400)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 11 Jun 2014 14:33:51 +0000 (16:33 +0200)
When saving domain with relabel=no, the file that gets created must have the
context set anyway.  That way restore can be successful without the need of
relabelling the file.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
src/qemu/qemu_driver.c

index 11912557ff5aced8a0149571b15a1920ead06d6f..ec72d9dd3aae762b232e4cba1cf6dc683bb1d245 100644 (file)
@@ -2966,6 +2966,9 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
     if (fd < 0)
         goto cleanup;
 
+    if (virSecurityManagerSetImageFDLabel(driver->securityManager, vm->def, fd) < 0)
+        goto cleanup;
+
     if (!(wrapperFd = virFileWrapperFdNew(&fd, path, wrapperFlags)))
         goto cleanup;