File tree 3 files changed +46
-0
lines changed
3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1389
1389
##
1390
1390
{ 'command' : 'cpu' , 'data' : {'index' : 'int' } }
1391
1391
1392
+ ##
1393
+ # @cpu-add
1394
+ #
1395
+ # Adds CPU with specified ID
1396
+ #
1397
+ # @id: ID of CPU to be created, valid values [0..max_cpus)
1398
+ #
1399
+ # Returns: Nothing on success
1400
+ #
1401
+ # Since 1.5
1402
+ ##
1403
+ { 'command' : 'cpu-add' , 'data' : {'id' : 'int' } }
1404
+
1392
1405
##
1393
1406
# @memsave:
1394
1407
#
Original file line number Diff line number Diff line change @@ -382,6 +382,29 @@ Example:
382
382
383
383
Note : CPUs ' indexes are obtained with the ' query - cpus ' command.
384
384
385
+ EQMP
386
+
387
+ {
388
+ .name = "cpu-add",
389
+ .args_type = "id:i",
390
+ .mhandler.cmd_new = qmp_marshal_input_cpu_add,
391
+ },
392
+
393
+ SQMP
394
+ cpu-add
395
+ -------
396
+
397
+ Adds virtual cpu
398
+
399
+ Arguments:
400
+
401
+ - "id": cpu id (json-int)
402
+
403
+ Example:
404
+
405
+ -> { "execute": "cpu-add", "arguments": { "id": 2 } }
406
+ <- { "return": {} }
407
+
385
408
EQMP
386
409
387
410
{
Original file line number Diff line number Diff line change 24
24
#include "hw/qdev.h"
25
25
#include "sysemu/blockdev.h"
26
26
#include "qom/qom-qobject.h"
27
+ #include "hw/boards.h"
27
28
28
29
NameInfo * qmp_query_name (Error * * errp )
29
30
{
@@ -108,6 +109,15 @@ void qmp_cpu(int64_t index, Error **errp)
108
109
/* Just do nothing */
109
110
}
110
111
112
+ void qmp_cpu_add (int64_t id , Error * * errp )
113
+ {
114
+ if (current_machine -> hot_add_cpu ) {
115
+ current_machine -> hot_add_cpu (id , errp );
116
+ } else {
117
+ error_setg (errp , "Not supported" );
118
+ }
119
+ }
120
+
111
121
#ifndef CONFIG_VNC
112
122
/* If VNC support is enabled, the "true" query-vnc command is
113
123
defined in the VNC subsystem */
You can’t perform that action at this time.
0 commit comments