]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: monitor: Remove text monitor support for cpu hot(un)plug
authorPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jun 2019 11:12:04 +0000 (13:12 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Jun 2019 13:59:19 +0000 (15:59 +0200)
The "cpu-add" command is supported in all supported qemu versions and
cpu unplug did not work at all until the new cpu unplug approach (using
device_add/del) was implemented.

Remove the support for falling back to the text monitor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor_json.c

index 4eca75ecc96ba372c8f57cb1c2f106abf151ea91..8723ff49c7786fa52cc5768da62cc2f14d9fce2b 100644 (file)
@@ -2979,8 +2979,9 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
                                          "i:id", cpu,
                                          NULL);
     } else {
-        /* offlining is not yet implemented in qmp */
-        goto fallback;
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("vCPU unplug is not supported by this QEMU"));
+        goto cleanup;
     }
     if (!cmd)
         goto cleanup;
@@ -2988,20 +2989,12 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
     if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
         goto cleanup;
 
-    if (qemuMonitorJSONHasError(reply, "CommandNotFound"))
-        goto fallback;
-    else
-        ret = qemuMonitorJSONCheckError(cmd, reply);
+    ret = qemuMonitorJSONCheckError(cmd, reply);
 
  cleanup:
     virJSONValueFree(cmd);
     virJSONValueFree(reply);
     return ret;
-
- fallback:
-    VIR_DEBUG("no QMP support for cpu_set, trying HMP");
-    ret = qemuMonitorTextSetCPU(mon, cpu, online);
-    goto cleanup;
 }