From: Daniel P. Berrange Date: Wed, 26 Sep 2012 14:46:47 +0000 (+0100) Subject: Don't skip over socket label cleanup X-Git-Tag: v0.10.2.1~60 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14cf67e6fbd68f7f6662c0b3e660d7068edeba5f;p=thirdparty%2Flibvirt.git Don't skip over socket label cleanup If QEMU quits immediately after we opened the monitor it was possible we would skip the clearing of the SELinux process socket context Signed-off-by: Daniel P. Berrange (cherry picked from commit 0b62c0736a2a365b9c682d58fa9f66eaea6ec7e4) --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3cd30afb79..67f7e13657 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1242,12 +1242,11 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm) virDomainObjLock(vm); priv->monStart = 0; - if (mon == NULL) + if (mon == NULL) { virObjectUnref(vm); - - if (!virDomainObjIsActive(vm)) { + } else if (!virDomainObjIsActive(vm)) { qemuMonitorClose(mon); - goto error; + mon = NULL; } priv->mon = mon;