aboutsummaryrefslogtreecommitdiff
path: root/hw/watchdog
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-08-15 21:37:37 +0800
committerMarkus Armbruster <armbru@redhat.com>2018-08-28 18:21:38 +0200
commit3ab72385b21d8d66df3f5fea42097ce264dc9d6b (patch)
tree47e25323bfe6a14e3cd5bdf66cdc6b94dbfa9533 /hw/watchdog
parentbdd2d42b890b3a908fa3fbdc9661541e1b57eb15 (diff)
qapi: Drop qapi_event_send_FOO()'s Error ** argument
The generated qapi_event_send_FOO() take an Error ** argument. They can't actually fail, because all they do with the argument is passing it to functions that can't fail: the QObject output visitor, and the @qmp_emit callback, which is either monitor_qapi_event_queue() or event_test_emit(). Drop the argument, and pass &error_abort to the QObject output visitor and @qmp_emit instead. Suggested-by: Eric Blake <eblake@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180815133747.25032-4-peterx@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message rewritten, update to qapi-code-gen.txt corrected] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/watchdog')
-rw-r--r--hw/watchdog/watchdog.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 6e8ba061d8..33e6c20184 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -102,17 +102,17 @@ void watchdog_perform_action(void)
{
switch (watchdog_action) {
case WATCHDOG_ACTION_RESET: /* same as 'system_reset' in monitor */
- qapi_event_send_watchdog(WATCHDOG_ACTION_RESET, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_RESET);
qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
break;
case WATCHDOG_ACTION_SHUTDOWN: /* same as 'system_powerdown' in monitor */
- qapi_event_send_watchdog(WATCHDOG_ACTION_SHUTDOWN, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_SHUTDOWN);
qemu_system_powerdown_request();
break;
case WATCHDOG_ACTION_POWEROFF: /* same as 'quit' command in monitor */
- qapi_event_send_watchdog(WATCHDOG_ACTION_POWEROFF, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_POWEROFF);
exit(0);
case WATCHDOG_ACTION_PAUSE: /* same as 'stop' command in monitor */
@@ -120,22 +120,21 @@ void watchdog_perform_action(void)
* you would get a deadlock. Bypass the problem.
*/
qemu_system_vmstop_request_prepare();
- qapi_event_send_watchdog(WATCHDOG_ACTION_PAUSE, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_PAUSE);
qemu_system_vmstop_request(RUN_STATE_WATCHDOG);
break;
case WATCHDOG_ACTION_DEBUG:
- qapi_event_send_watchdog(WATCHDOG_ACTION_DEBUG, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_DEBUG);
fprintf(stderr, "watchdog: timer fired\n");
break;
case WATCHDOG_ACTION_NONE:
- qapi_event_send_watchdog(WATCHDOG_ACTION_NONE, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_NONE);
break;
case WATCHDOG_ACTION_INJECT_NMI:
- qapi_event_send_watchdog(WATCHDOG_ACTION_INJECT_NMI,
- &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_INJECT_NMI);
nmi_monitor_handle(0, NULL);
break;