From 69b16513a5c5f2e9a0d269b659fa55ff6d6e8267 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Mon, 27 Apr 2015 14:24:34 -0400 Subject: [PATCH] qemu: qemuProcessDetectIOThreadPIDs invert checks 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f06ec5688c..d8a747c9b4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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; -- GitLab