Commit 5bd649ccf9 for qemu.org
commit 5bd649ccf93a6daa26888015deb6bfbc6d764d68
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date: Wed Aug 12 14:45:03 2026 +0200
system: Move qmp_inject_nmi() to hw/core/machine-qmp-cmds.c
We figured NMI relates to machines (for their machine-specific
handling), so move the 'inject-nmi' QMP handler with the rest
of machine ones, in hw/core/machine-qmp-cmds.c.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20260812211708.92824-15-philmd@oss.qualcomm.com>
diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index e62cb4ec88..1aa5f26229 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -10,6 +10,7 @@
#include "qemu/osdep.h"
#include "hw/acpi/vmgenid.h"
#include "hw/core/boards.h"
+#include "hw/core/nmi.h"
#include "hw/intc/intc.h"
#include "hw/mem/memory-device.h"
#include "qapi/error.h"
@@ -448,3 +449,8 @@ void qmp_dump_skeys(const char *filename, Error **errp)
}
DUMP_SKEYS_INTERFACE_CLASS(oc)->qmp_dump_skeys(filename, errp);
}
+
+void qmp_inject_nmi(Error **errp)
+{
+ nmi_inject(errp);
+}
diff --git a/system/cpus.c b/system/cpus.c
index 9758cda463..aa2510bf8f 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -26,7 +26,6 @@
#include "qemu/coroutine-tls.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-machine.h"
-#include "qapi/qapi-commands-misc.h"
#include "qapi/qapi-events-run-state.h"
#include "qapi/qmp/qerror.h"
#include "exec/gdbstub.h"
@@ -38,7 +37,6 @@
#include "qemu/plugin.h"
#include "system/cpus.h"
#include "qemu/guest-random.h"
-#include "hw/core/nmi.h"
#include "system/physmem.h"
#include "system/replay.h"
#include "system/runstate.h"
@@ -922,9 +920,3 @@ void qmp_pmemsave(uint64_t addr, uint64_t size, const char *filename,
exit:
fclose(f);
}
-
-void qmp_inject_nmi(Error **errp)
-{
- nmi_inject(errp);
-}
-