aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-04-29 12:11:50 -0300
committerLuiz Capitulino <lcapitulino@redhat.com>2011-06-01 11:42:25 -0300
commite9b4b432e781863869b074d46966bfa0bd672b8f (patch)
treec7a503e5d170876cdb0f047cf15ff21138899187
parenta404666457b54142d6cfe8302bcded9be4cda379 (diff)
downloadqemu-e9b4b432e781863869b074d46966bfa0bd672b8f.zip
qemu-e9b4b432e781863869b074d46966bfa0bd672b8f.tar.gz
qemu-e9b4b432e781863869b074d46966bfa0bd672b8f.tar.bz2
HMP: Use QMP inject nmi implementation
This **CHANGES** the human monitor "nmi" command behavior. Currently it accepts an CPU argument which, when provided, will send the NMI to the specified CPU. This feature is of discussable value though and HMP shouldn't have more features than QMP, so let's use QMP's instead (it's also simpler). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--hmp-commands.hx9
-rw-r--r--monitor.c16
-rw-r--r--qmp-commands.hx2
3 files changed, 8 insertions, 19 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 834e6a8..6ad8806 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -740,10 +740,11 @@ ETEXI
#if defined(TARGET_I386)
{
.name = "nmi",
- .args_type = "cpu_index:i",
- .params = "cpu",
- .help = "inject an NMI on the given CPU",
- .mhandler.cmd = do_inject_nmi,
+ .args_type = "",
+ .params = "",
+ .help = "inject an NMI on all guest's CPUs",
+ .user_print = monitor_user_noop,
+ .mhandler.cmd_new = do_inject_nmi,
},
#endif
STEXI
diff --git a/monitor.c b/monitor.c
index 81d3c9b..6af6a4d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2544,19 +2544,7 @@ static void do_wav_capture(Monitor *mon, const QDict *qdict)
#endif
#if defined(TARGET_I386)
-static void do_inject_nmi(Monitor *mon, const QDict *qdict)
-{
- CPUState *env;
- int cpu_index = qdict_get_int(qdict, "cpu_index");
-
- for (env = first_cpu; env != NULL; env = env->next_cpu)
- if (env->cpu_index == cpu_index) {
- cpu_interrupt(env, CPU_INTERRUPT_NMI);
- break;
- }
-}
-
-static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject **ret_data)
+static int do_inject_nmi(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
CPUState *env;
@@ -2567,7 +2555,7 @@ static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject **ret_dat
return 0;
}
#else
-static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject **ret_data)
+static int do_inject_nmi(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
qerror_report(QERR_UNSUPPORTED);
return -1;
diff --git a/qmp-commands.hx b/qmp-commands.hx
index ae08b7a59..92c5c3a 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -435,7 +435,7 @@ EQMP
.params = "",
.help = "",
.user_print = monitor_user_noop,
- .mhandler.cmd_new = do_inject_nmi_all,
+ .mhandler.cmd_new = do_inject_nmi,
},
SQMP