aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-10-27 15:03:04 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-11-02 15:57:27 +0100
commit22afb46e7c6ed61bd41c199072cb4769d6ab14b2 (patch)
treedcde55a5d193315ccc10a9207c7ad198a43bbde3 /softmmu
parentd12b64eaebd9f0df03c70422336c669a44ed2937 (diff)
watchdog: remove select_watchdog_action
Instead of invoking select_watchdog_action from both HMP and command line, go directly from HMP to QMP and use QemuOpts as the intermediary for the command line. This makes -watchdog-action explicitly a shortcut for "-action watchdog", so that "-watchdog-action" and "-action watchdog" override each other based on the position on the command line; previously, "-action watchdog" always won. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/vl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 570120f5c4..1159a64bce 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3265,12 +3265,12 @@ void qemu_init(int argc, char **argv, char **envp)
exit(1);
}
break;
- case QEMU_OPTION_watchdog_action:
- if (select_watchdog_action(optarg) == -1) {
- error_report("unknown -watchdog-action parameter");
- exit(1);
- }
+ case QEMU_OPTION_watchdog_action: {
+ QemuOpts *opts;
+ opts = qemu_opts_create(qemu_find_opts("action"), NULL, 0, &error_abort);
+ qemu_opt_set(opts, "watchdog", optarg, &error_abort);
break;
+ }
case QEMU_OPTION_parallel:
add_device_config(DEV_PARALLEL, optarg);
default_parallel = 0;