[libvirt] [PATCH] Don't skip over socket label cleanup

From: "Daniel P. Berrange" <berrange@redhat.com> 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 <berrange@redhat.com> --- src/qemu/qemu_process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 70b72af..ade64b7 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; -- 1.7.11.2

On 09/26/2012 08:49 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
If QEMU quits immediately after we opened the monitor it was
extra space before 'was'
possible we would skip the clearing of the SELinux process socket context
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/qemu/qemu_process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
ACK, after reading more context.
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 70b72af..ade64b7 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;
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake