diff mbox series

[RFC,30/32] qapi/options: QAPIfy --watchdog-action argument type

Message ID 20171002152552.27999-31-armbru@redhat.com
State New
Headers show
Series Command line QAPIfication | expand

Commit Message

Markus Armbruster Oct. 2, 2017, 3:25 p.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/options.json | 2 +-
 vl.c              | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/qapi/options.json b/qapi/options.json
index 853908560d..eb1a3e2dde 100644
--- a/qapi/options.json
+++ b/qapi/options.json
@@ -3868,7 +3868,7 @@ 
 # !end texinfo
 ##
 { 'option': '--watchdog-action',
-  'data': 'str',                # FIXME enum
+  'data': 'WatchdogAction',
   'help': [
 "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none",
 "                action when watchdog fires [default=reset]"] }
diff --git a/vl.c b/vl.c
index 4af2905c60..1814a53337 100644
--- a/vl.c
+++ b/vl.c
@@ -3724,11 +3724,8 @@  int main(int argc, char **argv, char **envp)
                 watchdog = qopt[i].u.watchdog.data;
                 break;
             case QAPI_OPTION_KIND_WATCHDOG_ACTION:
-                if (select_watchdog_action(qopt[i].u.watchdog_action.data)
-                    == -1) {
-                    error_report("unknown -watchdog-action parameter");
-                    exit(1);
-                }
+                qmp_watchdog_set_action(qopt[i].u.watchdog_action.data,
+                                        &error_abort);
                 break;
             case QAPI_OPTION_KIND_VIRTIOCONSOLE:
                 add_device_config(DEV_VIRTCON, qopt[i].u.virtioconsole.data);