提交 a4046664 编写于 作者: L Lai Jiangshan 提交者: Luiz Capitulino

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: NLuiz Capitulino <lcapitulino@redhat.com>
上级 4c5a1e4d
......@@ -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)
......
......@@ -427,6 +427,33 @@ Example:
"filename": "/tmp/physical-mem-dump" } }
<- { "return": {} }
EQMP
{
.name = "inject-nmi",
.args_type = "",
.params = "",
.help = "",
.user_print = monitor_user_noop,
.mhandler.cmd_new = do_inject_nmi_all,
},
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
returns "Unsupported" error for non-x86 guest.
EQMP
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册