]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: qemuProcessDetectIOThreadPIDs invert checks
authorJohn Ferlan <jferlan@redhat.com>
Mon, 27 Apr 2015 18:24:34 +0000 (14:24 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 28 Apr 2015 10:33:35 +0000 (06:33 -0400)
If we received zero iothreads from the monitor, but were perhaps
expecting to receive something, then the code was skipping the check
to ensure what's in the monitor matches our expectations.  So invert
the checks to check that what we get back matches expectations and
then check there are zero iothreads returned.

src/qemu/qemu_process.c

index f06ec5688cde54d1367218d164af506af817181c..d8a747c9b4e0fb1a5e10d5cca7fb97e1aeb69af9 100644 (file)
@@ -2233,12 +2233,6 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
     if (niothreads < 0)
         goto cleanup;
 
-    /* Nothing to do */
-    if (niothreads == 0) {
-        ret = 0;
-        goto cleanup;
-    }
-
     if (niothreads != vm->def->iothreads) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("got wrong number of IOThread pids from QEMU monitor. "
@@ -2247,6 +2241,12 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
+    /* Nothing to do */
+    if (niothreads == 0) {
+        ret = 0;
+        goto cleanup;
+    }
+
     for (i = 0; i < niothreads; i++) {
         virDomainIOThreadIDDefPtr iothrid;