[PATCH] qemu: bulk stats: typo in monitor handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A typo in qemuConnectGetAllDomainStats makes the code
mark the monitor as available when qemuDomainObjBeginJob
fails, instead of when it succeeds, as the correct flow
requires.

This patch fixes the check and updates the code documentation
accordingly.

Signed-off-by: Francesco Romani <fromani@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 830fca7..129e10c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18745,9 +18745,12 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
         }
 
         if (HAVE_JOB(privflags) &&
-            qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0)
-            /* As it was never requested. Gather as much as possible anyway. */
+            qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) == 0)
             domflags |= QEMU_DOMAIN_STATS_HAVE_JOB;
+        /*
+         * else: as it was never requested.
+         * Gather as much as possible anyway.
+         */
 
         if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0)
             goto endjob;
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]