render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 9186d0bb6d56bdf61836bc0e425252346ea16b6a Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <9186d0bb6d56bdf61836bc0e425252346ea16b6a@dist-git>
9119d9
From: Francesco Romani <fromani@redhat.com>
9119d9
Date: Sat, 13 Dec 2014 10:10:02 +0100
9119d9
Subject: [PATCH] qemu: bulk stats: Fix logic in monitor handling
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1172570
9119d9
9119d9
A logic bug in qemuConnectGetAllDomainStats makes the code mark the
9119d9
monitor as available when qemuDomainObjBeginJob fails, instead of when
9119d9
it succeeds, as the correct flow requires.
9119d9
9119d9
This patch fixes the check and updates the code documentation
9119d9
accordingly.
9119d9
9119d9
Broken by commit 57023c0a3af4af1c547189c1f6712ed5edeb0c0b.
9119d9
9119d9
Signed-off-by: Francesco Romani <fromani@redhat.com>
9119d9
(cherry picked from commit cb104ef734dfea12cb8826dba7e2c98912c4b7e1)
9119d9
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_driver.c | 4 ++--
9119d9
 1 file changed, 2 insertions(+), 2 deletions(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
9119d9
index 1625ddd..4498194 100644
9119d9
--- a/src/qemu/qemu_driver.c
9119d9
+++ b/src/qemu/qemu_driver.c
9119d9
@@ -18264,9 +18264,9 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
9119d9
         }
9119d9
 
9119d9
         if (HAVE_JOB(privflags) &&
9119d9
-            qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0)
9119d9
-            /* As it was never requested. Gather as much as possible anyway. */
9119d9
+            qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) == 0)
9119d9
             domflags |= QEMU_DOMAIN_STATS_HAVE_JOB;
9119d9
+        /* else: without a job it's still possible to gather some data */
9119d9
 
9119d9
         if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0)
9119d9
             goto endjob;
9119d9
-- 
9119d9
2.2.0
9119d9