@samitouri / QOSamiQemu / commits / 5bd649ccf9

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>

Philippe Mathieu-Daudé committed Aug 12, 2026 at 14:45 UTC 5bd649ccf93a6daa26888015deb6bfbc6d764d68
2 files changed +6 -8
hw/core/machine-qmp-cmds.c
+6
@@ -10,6 +10,7 @@
10 #include "qemu/osdep.h"
11 #include "hw/acpi/vmgenid.h"
12 #include "hw/core/boards.h"
13 +#include "hw/core/nmi.h"
14 #include "hw/intc/intc.h"
15 #include "hw/mem/memory-device.h"
16 #include "qapi/error.h"
@@ -448,3 +449,8 @@ void qmp_dump_skeys(const char *filename, Error **errp)
449 }
450 DUMP_SKEYS_INTERFACE_CLASS(oc)->qmp_dump_skeys(filename, errp);
451 }
452 +
453 +void qmp_inject_nmi(Error **errp)
454 +{
455 + nmi_inject(errp);
456 +}
system/cpus.c
-8
@@ -26,7 +26,6 @@
26 #include "qemu/coroutine-tls.h"
27 #include "qapi/error.h"
28 #include "qapi/qapi-commands-machine.h"
29 -#include "qapi/qapi-commands-misc.h"
29 #include "qapi/qapi-events-run-state.h"
30 #include "qapi/qmp/qerror.h"
31 #include "exec/gdbstub.h"
@@ -38,7 +37,6 @@
37 #include "qemu/plugin.h"
38 #include "system/cpus.h"
39 #include "qemu/guest-random.h"
41 -#include "hw/core/nmi.h"
40 #include "system/physmem.h"
41 #include "system/replay.h"
42 #include "system/runstate.h"
@@ -922,9 +920,3 @@ void qmp_pmemsave(uint64_t addr, uint64_t size, const char *filename,
920 exit:
921 fclose(f);
922 }
925 -
926 -void qmp_inject_nmi(Error **errp)
927 -{
928 - nmi_inject(errp);
929 -}
930 -