From: Luiz Capitulino <lcapitulino@redhat.com>
To: aliguori@us.ibm.com
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: [Qemu-devel] [PATCH 3/5] HMP: Use QMP inject nmi implementation
Date: Wed, 1 Jun 2011 12:54:03 -0300 [thread overview]
Message-ID: <1306943645-20313-4-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1306943645-20313-1-git-send-email-lcapitulino@redhat.com>
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>
---
hmp-commands.hx | 9 +++++----
monitor.c | 16 ++--------------
qmp-commands.hx | 2 +-
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 ae08b7a..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
--
1.7.4.4
next prev parent reply other threads:[~2011-06-02 0:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 15:54 [Qemu-devel] [PULL 0/5]: Monitor queue Luiz Capitulino
2011-06-01 15:54 ` [Qemu-devel] [PATCH 1/5] QMP: QError: New QERR_UNSUPPORTED Luiz Capitulino
2011-06-01 15:54 ` [Qemu-devel] [PATCH 2/5] QMP: add inject-nmi qmp command Luiz Capitulino
2011-06-04 8:34 ` Blue Swirl
2011-06-06 14:17 ` Luiz Capitulino
2011-06-12 21:22 ` Blue Swirl
2011-06-01 15:54 ` Luiz Capitulino [this message]
2011-06-01 15:54 ` [Qemu-devel] [PATCH 4/5] QMP: add get_events(wait=True) option Luiz Capitulino
2011-06-01 15:54 ` [Qemu-devel] [PATCH 5/5] QMP: add server mode to QEMUMonitorProtocol Luiz Capitulino
2011-06-02 2:19 ` Brad Hards
2011-06-02 9:02 ` Daniel P. Berrange
2011-06-09 12:40 ` [Qemu-devel] [PULL 0/5]: Monitor queue Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1306943645-20313-4-git-send-email-lcapitulino@redhat.com \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).