aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-10-06 14:02:57 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-27 11:48:46 -0200
commitb025c8b4ab108a5a4bb4ef1e2500fc63214e2193 (patch)
treec20422e63aa8c4b489bf87f22fba79ea527c8ae6
parent791e7c820e969a69aa2568fb528dbe9f7e923f5a (diff)
downloadqemu-b025c8b4ab108a5a4bb4ef1e2500fc63214e2193.zip
qemu-b025c8b4ab108a5a4bb4ef1e2500fc63214e2193.tar.gz
qemu-b025c8b4ab108a5a4bb4ef1e2500fc63214e2193.tar.bz2
Monitor: Make mon_set_cpu() public
Also rename it to monitor_set_cpu(). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--monitor.c11
-rw-r--r--monitor.h1
2 files changed, 6 insertions, 6 deletions
diff --git a/monitor.c b/monitor.c
index ea5ccd8..3f99ea0 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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;
diff --git a/monitor.h b/monitor.h
index 4f2d328..9b723b2 100644
--- a/monitor.h
+++ b/monitor.h
@@ -57,6 +57,7 @@ void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
void monitor_print_filename(Monitor *mon, const char *filename);
void monitor_flush(Monitor *mon);
+int monitor_set_cpu(int cpu_index);
typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);