monitor: convert do_cpu_set() to QObject, QError

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Markus Armbruster 2010-01-20 13:07:35 +01:00 committed by Anthony Liguori
parent 64a34bb14c
commit 81a1b45ac7
2 changed files with 4 additions and 3 deletions

View File

@ -807,11 +807,11 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data)
*ret_data = QOBJECT(cpu_list); *ret_data = QOBJECT(cpu_list);
} }
static void do_cpu_set(Monitor *mon, const QDict *qdict) static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
{ {
int index = qdict_get_int(qdict, "index"); int index = qdict_get_int(qdict, "index");
if (mon_set_cpu(index) < 0) if (mon_set_cpu(index) < 0)
monitor_printf(mon, "Invalid CPU index\n"); qemu_error_new(QERR_INVALID_CPU_INDEX);
} }
static void do_info_jit(Monitor *mon) static void do_info_jit(Monitor *mon)

View File

@ -573,7 +573,8 @@ ETEXI
.args_type = "index:i", .args_type = "index:i",
.params = "index", .params = "index",
.help = "set the default CPU", .help = "set the default CPU",
.mhandler.cmd = do_cpu_set, .user_print = monitor_user_noop,
.mhandler.cmd_new = do_cpu_set,
}, },
STEXI STEXI