]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't update count of vCPUs if hot-unplug has failed
authorPeter Krempa <pkrempa@redhat.com>
Tue, 15 Jan 2013 15:09:43 +0000 (16:09 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 15 Jan 2013 22:43:10 +0000 (23:43 +0100)
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

index 39175f4b36a928f1da96a2773c738a71ce90e4ee..c4be13053c5c4f45448d7ed33bae8c1f31c43d04 100644 (file)
@@ -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. "