qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 30/32] qapi/options: QAPIfy --watchdog-action ar


From: Markus Armbruster
Subject: [Qemu-devel] [RFC PATCH 30/32] qapi/options: QAPIfy --watchdog-action argument type
Date: Mon, 2 Oct 2017 17:25:50 +0200

Signed-off-by: Markus Armbruster <address@hidden>
---
 qapi/options.json | 2 +-
 vl.c              | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

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);
-- 
2.13.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]