[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 2/3 V8] qapi, nmi: add inject-nmi qmp command
From: |
Lai Jiangshan |
Subject: |
[Qemu-devel] [RFC PATCH 2/3 V8] qapi, nmi: add inject-nmi qmp command |
Date: |
Wed, 20 Apr 2011 14:19:38 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc14 Thunderbird/3.1.4 |
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: Lai Jiangshan <address@hidden>
---
qapi-schema.json | 12 ++++++++++++
qmp.c | 17 +++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index de6c9a3..6a94d78 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1498,3 +1498,15 @@
# Since: 0.14.0
##
{ 'option': 'vnc', 'data': 'VncConfig', 'implicit': 'address' }
+
+##
+# @inject-nmi:
+#
+# Inject an NMI on the guest.
+#
+# Returns: Nothing on success.
+# If the guest(non-x86) does not support NMI injection, Unsupported
+#
+# Since: 0.15.0
+##
+{ 'command': 'inject-nmi' }
diff --git a/qmp.c b/qmp.c
index 9fdde8f..dac411a 100644
--- a/qmp.c
+++ b/qmp.c
@@ -379,3 +379,20 @@ StatusInfo *qmp_query_status(Error **errp)
return info;
}
+
+#if defined(TARGET_I386)
+void qmp_inject_nmi(Error **errp)
+{
+ CPUState *env;
+
+ for (env = first_cpu; env != NULL; env = env->next_cpu) {
+ cpu_interrupt(env, CPU_INTERRUPT_NMI);
+ }
+}
+#else
+void qmp_inject_nmi(Error **errp)
+{
+ error_set(errp, QERR_UNSUPPORTED,
+ "Injecting NMI is unsupported for the non-x86 guest");
+}
+#endif
--
1.7.4
- Re: [Qemu-devel] [RFC PATCH 0/3 V8] QAPI: add inject-nmi qmp command, (continued)
- Re: [Qemu-devel] [RFC PATCH 0/3 V8] QAPI: add inject-nmi qmp command, Luiz Capitulino, 2011/04/26
- Re: [Qemu-devel] [RFC PATCH 0/3 V8] QAPI: add inject-nmi qmp command, Anthony Liguori, 2011/04/26
- Re: [Qemu-devel] [RFC PATCH 0/3 V8] QAPI: add inject-nmi qmp command, Lai Jiangshan, 2011/04/26
- Re: [Qemu-devel] [RFC PATCH 0/3 V8] QAPI: add inject-nmi qmp command, Luiz Capitulino, 2011/04/27
- [Qemu-devel] [PATCH 1/2 V9] qemu, qmp: QError: New QERR_UNSUPPORTED, Lai Jiangshan, 2011/04/27
- [Qemu-devel] [PATCH 0/2 V9] hmp,qmp: add inject-nmi, Lai Jiangshan, 2011/04/27
- Re: [Qemu-devel] [PATCH 0/2 V9] hmp,qmp: add inject-nmi, Luiz Capitulino, 2011/04/29
- [Qemu-devel] [PATCH 2/2 V9] qmp, inject-nmi: convert do_inject_nmi() to QObject, Lai Jiangshan, 2011/04/27
- Re: [Qemu-devel] [RFC PATCH 0/3 V8] QAPI: add inject-nmi qmp command, Michael Roth, 2011/04/25
- [Qemu-devel] [RFC PATCH 1/3 V8] QError: Introduce QERR_UNSUPPORTED, Lai Jiangshan, 2011/04/20
- [Qemu-devel] [RFC PATCH 2/3 V8] qapi, nmi: add inject-nmi qmp command,
Lai Jiangshan <=
- [Qemu-devel] [RFC PATCH 3/3 V8] qapi-hmp: Convert HMP nmi to use QMP, Lai Jiangshan, 2011/04/20