mirror of https://github.com/xemu-project/xemu.git
qapi: Convert the cpu command
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
99b7796f60
commit
755f196898
|
@ -587,8 +587,7 @@ ETEXI
|
||||||
.args_type = "index:i",
|
.args_type = "index:i",
|
||||||
.params = "index",
|
.params = "index",
|
||||||
.help = "set the default CPU",
|
.help = "set the default CPU",
|
||||||
.user_print = monitor_user_noop,
|
.mhandler.cmd = hmp_cpu,
|
||||||
.mhandler.cmd_new = do_cpu_set,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
STEXI
|
STEXI
|
||||||
|
|
12
hmp.c
12
hmp.c
|
@ -165,3 +165,15 @@ void hmp_system_powerdown(Monitor *mon, const QDict *qdict)
|
||||||
{
|
{
|
||||||
qmp_system_powerdown(NULL);
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
1
hmp.h
1
hmp.h
|
@ -29,5 +29,6 @@ void hmp_quit(Monitor *mon, const QDict *qdict);
|
||||||
void hmp_stop(Monitor *mon, const QDict *qdict);
|
void hmp_stop(Monitor *mon, const QDict *qdict);
|
||||||
void hmp_system_reset(Monitor *mon, const QDict *qdict);
|
void hmp_system_reset(Monitor *mon, const QDict *qdict);
|
||||||
void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
|
void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
|
||||||
|
void hmp_cpu(Monitor *mon, const QDict *qdict);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
11
monitor.c
11
monitor.c
|
@ -902,17 +902,6 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data)
|
||||||
*ret_data = QOBJECT(cpu_list);
|
*ret_data = QOBJECT(cpu_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
|
||||||
{
|
|
||||||
int index = qdict_get_int(qdict, "index");
|
|
||||||
if (monitor_set_cpu(index) < 0) {
|
|
||||||
qerror_report(QERR_INVALID_PARAMETER_VALUE, "index",
|
|
||||||
"a CPU number");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void do_info_jit(Monitor *mon)
|
static void do_info_jit(Monitor *mon)
|
||||||
{
|
{
|
||||||
dump_exec_info((FILE *)mon, monitor_fprintf);
|
dump_exec_info((FILE *)mon, monitor_fprintf);
|
||||||
|
|
|
@ -351,3 +351,14 @@
|
||||||
# prompting the user in some way.
|
# prompting the user in some way.
|
||||||
##
|
##
|
||||||
{ 'command': 'system_powerdown' }
|
{ 'command': 'system_powerdown' }
|
||||||
|
|
||||||
|
##
|
||||||
|
# @cpu:
|
||||||
|
#
|
||||||
|
# This command is a nop that is only provided for the purposes of compatibility.
|
||||||
|
#
|
||||||
|
# Since: 0.14.0
|
||||||
|
#
|
||||||
|
# Notes: Do not use this command.
|
||||||
|
##
|
||||||
|
{ 'command': 'cpu', 'data': {'index': 'int'} }
|
||||||
|
|
|
@ -331,10 +331,7 @@ EQMP
|
||||||
{
|
{
|
||||||
.name = "cpu",
|
.name = "cpu",
|
||||||
.args_type = "index:i",
|
.args_type = "index:i",
|
||||||
.params = "index",
|
.mhandler.cmd_new = qmp_marshal_input_cpu,
|
||||||
.help = "set the default CPU",
|
|
||||||
.user_print = monitor_user_noop,
|
|
||||||
.mhandler.cmd_new = do_cpu_set,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
SQMP
|
SQMP
|
||||||
|
|
Loading…
Reference in New Issue