Monitor: Convert do_cpu_set() to cmd_new_ret()

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Luiz Capitulino 2010-02-10 23:49:51 -02:00 committed by Anthony Liguori
parent 9b9d4d9c79
commit 584cbdb596
2 changed files with 6 additions and 3 deletions

View File

@ -921,11 +921,14 @@ static void do_info_cpus(Monitor *mon, QObject **ret_data)
*ret_data = QOBJECT(cpu_list);
}
static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
static int do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
int index = qdict_get_int(qdict, "index");
if (mon_set_cpu(index) < 0)
if (mon_set_cpu(index) < 0) {
qemu_error_new(QERR_INVALID_PARAMETER, "index");
return -1;
}
return 0;
}
static void do_info_jit(Monitor *mon)

View File

@ -604,7 +604,7 @@ ETEXI
.params = "index",
.help = "set the default CPU",
.user_print = monitor_user_noop,
.mhandler.cmd_new = do_cpu_set,
.cmd_new_ret = do_cpu_set,
},
STEXI