aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2011-03-07 17:05:15 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2011-06-01 11:42:25 -0300
commita404666457b54142d6cfe8302bcded9be4cda379 (patch)
tree25c51dff72851242c3c71abb54822be24064736c /monitor.c
parent4c5a1e4db7c68b0e7edf5687dc10beeb776bad9f (diff)
QMP: add inject-nmi qmp command
inject-nmi command injects an NMI on all CPUs of guest. It is only supported for x86 guest currently, it will returns "Unsupported" error for non-x86 guest. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index f63cce050f..81d3c9b748 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2555,6 +2555,23 @@ static void do_inject_nmi(Monitor *mon, const QDict *qdict)
break;
}
}
+
+static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject **ret_data)
+{
+ CPUState *env;
+
+ for (env = first_cpu; env != NULL; env = env->next_cpu) {
+ cpu_interrupt(env, CPU_INTERRUPT_NMI);
+ }
+
+ return 0;
+}
+#else
+static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject **ret_data)
+{
+ qerror_report(QERR_UNSUPPORTED);
+ return -1;
+}
#endif
static void do_info_status_print(Monitor *mon, const QObject *data)