diff mbox

[3/4] nmi: add errp function parameter to inject_nmi()

Message ID 1463696116-31631-4-git-send-email-bsd@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bandan Das May 19, 2016, 10:15 p.m. UTC
If caller has errp, set it appropriately in case of
an error and pass it along.

Signed-off-by: Bandan Das <bsd@redhat.com>
---
 hw/core/nmi.c          | 4 ++--
 hw/watchdog/watchdog.c | 2 +-
 include/hw/nmi.h       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/hw/core/nmi.c b/hw/core/nmi.c
index cc47025..40324a9 100644
--- a/hw/core/nmi.c
+++ b/hw/core/nmi.c
@@ -73,9 +73,9 @@  void nmi_monitor_handle(int cpu_index, Error **errp)
     }
 }
 
-void inject_nmi(void)
+void inject_nmi(Error **errp)
 {
-    nmi_monitor_handle(0, NULL);
+    nmi_monitor_handle(0, errp);
 }
 
 static const TypeInfo nmi_info = {
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index bbf3646..c3f2c87 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -143,7 +143,7 @@  void watchdog_perform_action(void)
     case WDT_NMI:
         qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_INJECT_NMI,
                                  &error_abort);
-        inject_nmi();
+        inject_nmi(NULL);
         break;
     }
 }
diff --git a/include/hw/nmi.h b/include/hw/nmi.h
index f4cec62..63794d9 100644
--- a/include/hw/nmi.h
+++ b/include/hw/nmi.h
@@ -45,6 +45,6 @@  typedef struct NMIClass {
 } NMIClass;
 
 void nmi_monitor_handle(int cpu_index, Error **errp);
-void inject_nmi(void);
+void inject_nmi(Error **errp);
 
 #endif /* NMI_H */