]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Log error if domain uses security driver which is not loaded
authorErik Skultety <eskultet@redhat.com>
Tue, 5 May 2015 11:24:41 +0000 (13:24 +0200)
committerErik Skultety <eskultet@redhat.com>
Thu, 21 May 2015 10:33:52 +0000 (12:33 +0200)
When starting a domain, if a domain specifies security drivers we do not have
loaded, we fail. However we don't check for this during
reconnect, so any operation relying on security driver functionality would fail.
If someone e.g. starts a domain with selinux driver loaded, then they change
the security driver to 'none' in config, restart the daemon and call dump/save/..,
QEMU will return an error.
As we shouldn't kill the domain, we should at least log an error to let the
user know that domain reconnect wasn't completely clean.

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

src/qemu/qemu_process.c

index 118fc524572d23175f960a7d5df451ae22dfefd0..d8bc495e7ce9e9f2e0d9ac71989bc1fff993c7c0 100644 (file)
@@ -3749,6 +3749,12 @@ qemuProcessReconnect(void *opaque)
         if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0)
             goto error;
 
+    /* if domain requests security driver we haven't loaded, report error, but
+     * do not kill the domain
+     */
+    ignore_value(virSecurityManagerCheckAllLabel(driver->securityManager,
+                                                 obj->def));
+
     if (virSecurityManagerReserveLabel(driver->securityManager, obj->def, obj->pid) < 0)
         goto error;