]> git.proxmox.com Git - qemu.git/blobdiff - hmp.c
qapi: Convert the cpu command
[qemu.git] / hmp.c
diff --git a/hmp.c b/hmp.c
index 619b8ba70ec97c559eee8a97c6023438aa95c3b4..35b0ca0beaeb57125fd78ea1c6fd9a3c9b8244fe 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -165,3 +165,15 @@ void hmp_system_powerdown(Monitor *mon, const QDict *qdict)
 {
     qmp_system_powerdown(NULL);
 }
+
+void hmp_cpu(Monitor *mon, const QDict *qdict)
+{
+    int64_t cpu_index;
+
+    /* XXX: drop the monitor_set_cpu() usage when all HMP commands that
+            use it are converted to the QAPI */
+    cpu_index = qdict_get_int(qdict, "index");
+    if (monitor_set_cpu(cpu_index) < 0) {
+        monitor_printf(mon, "invalid CPU index\n");
+    }
+}