]> Git Repo - qemu.git/commitdiff
qemu-monitor: HMP cpu-add wrapper
authorJason J. Herne <[email protected]>
Wed, 11 Dec 2013 18:24:14 +0000 (13:24 -0500)
committerLuiz Capitulino <[email protected]>
Mon, 6 Jan 2014 18:45:39 +0000 (13:45 -0500)
Add HMP cpu-add wrapper to allow cpu hot plugging via monitor.

Signed-off-by: Jason J. Herne <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
hmp-commands.hx
hmp.c
hmp.h

index ebe8e78bb992c1436ea0cee69b9f23f37e213735..929550d66b9dd48e4b832ac751ff52c5cb7936b9 100644 (file)
@@ -1617,6 +1617,19 @@ STEXI
 
 Executes a qemu-io command on the given block device.
 
+ETEXI
+
+    {
+        .name       = "cpu-add",
+        .args_type  = "id:i",
+        .params     = "id",
+        .help       = "add cpu",
+        .mhandler.cmd  = hmp_cpu_add,
+    },
+
+STEXI
+@item cpu-add @var{id}
+Add CPU with id @var{id}
 ETEXI
 
     {
diff --git a/hmp.c b/hmp.c
index 32ee285a1e2b1cac31aada45c994418e3229a857..c513f9b68508aaae43b4a470f8f26c20a044acf6 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1525,6 +1525,16 @@ void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict)
     hmp_handle_error(mon, &errp);
 }
 
+void hmp_cpu_add(Monitor *mon, const QDict *qdict)
+{
+    int cpuid;
+    Error *err = NULL;
+
+    cpuid = qdict_get_int(qdict, "id");
+    qmp_cpu_add(cpuid, &err);
+    hmp_handle_error(mon, &err);
+}
+
 void hmp_chardev_add(Monitor *mon, const QDict *qdict)
 {
     const char *args = qdict_get_str(qdict, "args");
diff --git a/hmp.h b/hmp.h
index 54cf71fb94939422c766747ab2d00b2e623e3250..f92fc8922dc9b74da929b3952ccf6e8cdc698b83 100644 (file)
--- a/hmp.h
+++ b/hmp.h
@@ -89,5 +89,6 @@ void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict);
 void hmp_chardev_add(Monitor *mon, const QDict *qdict);
 void hmp_chardev_remove(Monitor *mon, const QDict *qdict);
 void hmp_qemu_io(Monitor *mon, const QDict *qdict);
+void hmp_cpu_add(Monitor *mon, const QDict *qdict);
 
 #endif
This page took 0.030215 seconds and 4 git commands to generate.