diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-06 14:02:57 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-27 11:48:46 -0200 |
commit | b025c8b4ab108a5a4bb4ef1e2500fc63214e2193 (patch) | |
tree | c20422e63aa8c4b489bf87f22fba79ea527c8ae6 /monitor.c | |
parent | 791e7c820e969a69aa2568fb528dbe9f7e923f5a (diff) |
Monitor: Make mon_set_cpu() public
Also rename it to monitor_set_cpu().
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -514,7 +514,6 @@ static int do_qmp_capabilities(Monitor *mon, const QDict *params, return 0; } -static int mon_set_cpu(int cpu_index); static void handle_user_command(Monitor *mon, const char *cmdline); static int do_hmp_passthrough(Monitor *mon, const QDict *params, @@ -532,7 +531,7 @@ static int do_hmp_passthrough(Monitor *mon, const QDict *params, cur_mon = &hmp; if (qdict_haskey(params, "cpu-index")) { - ret = mon_set_cpu(qdict_get_int(params, "cpu-index")); + ret = monitor_set_cpu(qdict_get_int(params, "cpu-index")); if (ret < 0) { cur_mon = old_mon; qerror_report(QERR_INVALID_PARAMETER_VALUE, "cpu-index", "a CPU number"); @@ -772,8 +771,8 @@ CommandInfoList *qmp_query_commands(Error **errp) return cmd_list; } -/* get the current CPU defined by the user */ -static int mon_set_cpu(int cpu_index) +/* set the current CPU defined by the user */ +int monitor_set_cpu(int cpu_index) { CPUState *env; @@ -789,7 +788,7 @@ static int mon_set_cpu(int cpu_index) static CPUState *mon_get_cpu(void) { if (!cur_mon->mon_cpu) { - mon_set_cpu(0); + monitor_set_cpu(0); } cpu_synchronize_state(cur_mon->mon_cpu); return cur_mon->mon_cpu; @@ -901,7 +900,7 @@ static void do_info_cpus(Monitor *mon, 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 (monitor_set_cpu(index) < 0) { qerror_report(QERR_INVALID_PARAMETER_VALUE, "index", "a CPU number"); return -1; |