mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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>
This commit is contained in:
parent
bdd2d42b89
commit
3ab72385b2
29 changed files with 70 additions and 104 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue