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>
diff --git a/monitor.c b/monitor.c
index 81d3c9b..6af6a4d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2544,19 +2544,7 @@
#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 @@
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;