From: Peter Krempa Date: Tue, 15 Jan 2013 15:09:43 +0000 (+0100) Subject: qemu: Don't update count of vCPUs if hot-unplug has failed X-Git-Tag: v1.0.2-rc1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=761fc481365703b861429d73a341bde352ba8d41;p=thirdparty%2Flibvirt.git qemu: Don't update count of vCPUs if hot-unplug has failed After live change of cpu counts, the number of processor threads is verified. This patch makes use of this approach to check if qemu ignored the request for cpu hot-unplug and report an appropriate message. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 39175f4b36..c4be13053c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3697,6 +3697,15 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver, goto cleanup; } + /* check if hotplug has failed */ + if (vcpus < oldvcpus && ncpupids == oldvcpus) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("qemu didn't unplug the vCPUs properly")); + vcpus = oldvcpus; + ret = -1; + goto cleanup; + } + if (ncpupids != vcpus) { virReportError(VIR_ERR_INTERNAL_ERROR, _("got wrong number of vCPU pids from QEMU monitor. "