From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTacb-0001C5-1F for qemu-devel@nongnu.org; Mon, 06 Jun 2011 10:17:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTacY-0008Pb-Mg for qemu-devel@nongnu.org; Mon, 06 Jun 2011 10:17:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTacY-0008PK-3O for qemu-devel@nongnu.org; Mon, 06 Jun 2011 10:17:34 -0400 Date: Mon, 6 Jun 2011 11:17:25 -0300 From: Luiz Capitulino Message-ID: <20110606111725.663edcb1@doriath> In-Reply-To: References: <1306943645-20313-1-git-send-email-lcapitulino@redhat.com> <1306943645-20313-3-git-send-email-lcapitulino@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/5] QMP: add inject-nmi qmp command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: armbru@redhat.com, aliguori@us.ibm.com, Lai Jiangshan , qemu-devel@nongnu.org On Sat, 4 Jun 2011 11:34:17 +0300 Blue Swirl wrote: > On Wed, Jun 1, 2011 at 6:54 PM, Luiz Capitulino = wrote: > > From: Lai Jiangshan > > > > 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. >=20 > Please rename the command to 'x-inject-nmi' to point out that it will > be replaced by a generic method later. Won't the generic interface be called 'inject'? In that case calling this command 'inject-nmi' makes sense as it's exactly what the command does and in the future it can be written in terms of the new 'inject' command. >=20 > > Signed-off-by: Luiz Capitulino > > --- > > =A0monitor.c =A0 =A0 =A0 | =A0 17 +++++++++++++++++ > > =A0qmp-commands.hx | =A0 27 +++++++++++++++++++++++++++ > > =A02 files changed, 44 insertions(+), 0 deletions(-) > > > > diff --git a/monitor.c b/monitor.c > > index f63cce0..81d3c9b 100644 > > --- a/monitor.c > > +++ b/monitor.c > > @@ -2555,6 +2555,23 @@ static void do_inject_nmi(Monitor *mon, const QD= ict *qdict) > > =A0 =A0 =A0 =A0 =A0 =A0 break; > > =A0 =A0 =A0 =A0 } > > =A0} > > + > > +static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject= **ret_data) > > +{ > > + =A0 =A0CPUState *env; > > + > > + =A0 =A0for (env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { > > + =A0 =A0 =A0 =A0cpu_interrupt(env, CPU_INTERRUPT_NMI); > > + =A0 =A0} > > + > > + =A0 =A0return 0; > > +} > > +#else > > +static int do_inject_nmi_all(Monitor *mon, const QDict *qdict, QObject= **ret_data) > > +{ > > + =A0 =A0qerror_report(QERR_UNSUPPORTED); > > + =A0 =A0return -1; > > +} > > =A0#endif > > > > =A0static void do_info_status_print(Monitor *mon, const QObject *data) > > diff --git a/qmp-commands.hx b/qmp-commands.hx > > index a9f109a..ae08b7a 100644 > > --- a/qmp-commands.hx > > +++ b/qmp-commands.hx > > @@ -430,6 +430,33 @@ Example: > > =A0EQMP > > > > =A0 =A0 { > > + =A0 =A0 =A0 =A0.name =A0 =A0 =A0 =3D "inject-nmi", > > + =A0 =A0 =A0 =A0.args_type =A0=3D "", > > + =A0 =A0 =A0 =A0.params =A0 =A0 =3D "", > > + =A0 =A0 =A0 =A0.help =A0 =A0 =A0 =3D "", > > + =A0 =A0 =A0 =A0.user_print =3D monitor_user_noop, > > + =A0 =A0 =A0 =A0.mhandler.cmd_new =3D do_inject_nmi_all, > > + =A0 =A0}, > > + > > +SQMP > > +inject-nmi > > +---------- > > + > > +Inject an NMI on guest's CPUs. > > + > > +Arguments: None. > > + > > +Example: > > + > > +-> { "execute": "inject-nmi" } > > +<- { "return": {} } > > + > > +Note: inject-nmi is only supported for x86 guest currently, it will > > + =A0 =A0 =A0returns "Unsupported" error for non-x86 guest. > > + > > +EQMP > > + > > + =A0 =A0{ > > =A0 =A0 =A0 =A0 .name =A0 =A0 =A0 =3D "migrate", > > =A0 =A0 =A0 =A0 .args_type =A0=3D "detach:-d,blk:-b,inc:-i,uri:s", > > =A0 =A0 =A0 =A0 .params =A0 =A0 =3D "[-d] [-b] [-i] uri", > > -- > > 1.7.4.4 > > > > > > >=20