aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-10 23:49:51 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-19 15:18:16 -0600
commit584cbdb59682db8f052167dd644083076d079890 (patch)
tree24f5977ce3f85f41587f153d5ad79289f85d676b
parent9b9d4d9c79ee7072629f36ea123a28a89ada8845 (diff)
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>
-rw-r--r--monitor.c7
-rw-r--r--qemu-monitor.hx2
2 files changed, 6 insertions, 3 deletions
diff --git a/monitor.c b/monitor.c
index e960c3831b..598dbfe5f2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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)
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index c1bd77335a..835fd05730 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -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