[libvirt] [PATCH] 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. --- src/qemu/qemu_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 39175f4..c4be130 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. " -- 1.8.1

On 01/15/2013 09:18 AM, Peter Krempa wrote:
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. --- src/qemu/qemu_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 01/15/13 20:00, Eric Blake wrote:
On 01/15/2013 09:18 AM, Peter Krempa wrote:
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. --- src/qemu/qemu_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
ACK.
Pushed. Thanks. Peter
participants (2)
-
Eric Blake
-
Peter Krempa