render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
9119d9
From 33cfcaf372eba54ed1da4969a95281cf12b78a66 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <33cfcaf372eba54ed1da4969a95281cf12b78a66@dist-git>
9119d9
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
9119d9
Date: Thu, 18 Sep 2014 09:30:03 -0400
9119d9
Subject: [PATCH] Fixes for domains with no iothreads
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1101574
9119d9
9119d9
Plug a memory leak and silence a warning.
9119d9
9119d9
(cherry picked from commit c1480871bbf4de10a06efd39dc0a61ae3889db2d)
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_cgroup.c  | 2 +-
9119d9
 src/qemu/qemu_process.c | 6 ++++--
9119d9
 2 files changed, 5 insertions(+), 3 deletions(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
9119d9
index 9d39370..7c6b2c1 100644
9119d9
--- a/src/qemu/qemu_cgroup.c
9119d9
+++ b/src/qemu/qemu_cgroup.c
9119d9
@@ -1131,7 +1131,7 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm)
9119d9
     if (priv->cgroup == NULL)
9119d9
         return 0;
9119d9
 
9119d9
-    if (priv->niothreadpids == 0) {
9119d9
+    if (def->iothreads && priv->niothreadpids == 0) {
9119d9
         VIR_WARN("Unable to get iothreads' pids.");
9119d9
         return 0;
9119d9
     }
9119d9
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
9119d9
index 3b43912..776edee 100644
9119d9
--- a/src/qemu/qemu_process.c
9119d9
+++ b/src/qemu/qemu_process.c
9119d9
@@ -2116,8 +2116,10 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
9119d9
         goto cleanup;
9119d9
 
9119d9
     /* Nothing to do */
9119d9
-    if (niothreads == 0)
9119d9
-        return 0;
9119d9
+    if (niothreads == 0) {
9119d9
+        ret = 0;
9119d9
+        goto cleanup;
9119d9
+    }
9119d9
 
9119d9
     if (niothreads != vm->def->iothreads) {
9119d9
         virReportError(VIR_ERR_INTERNAL_ERROR,
9119d9
-- 
9119d9
2.1.0
9119d9