diff options
author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2023-05-05 14:00:51 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-05-16 09:14:18 +0200 |
commit | 80bd81cadd127c1e2fc784612a52abe392670ba4 (patch) | |
tree | b8bbf72d575a44bb3f3da61ae147d87790b3733f /os-posix.c | |
parent | da9000784c90d2b645eedaa865b5cf778cb4d37f (diff) |
util/async-teardown: wire up query-command-line-options
Add new -run-with option with an async-teardown=on|off parameter. It is
visible in the output of query-command-line-options QMP command, so it
can be discovered and used by libvirt.
The option -async-teardown is now redundant, deprecate it.
Reported-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <20230505120051.36605-2-imbrenda@linux.ibm.com>
[thuth: Add curly braces to fix error with GCC 8.5, fix bug in deprecated.rst]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'os-posix.c')
-rw-r--r-- | os-posix.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/os-posix.c b/os-posix.c index 5adc69f560..90ea71725f 100644 --- a/os-posix.c +++ b/os-posix.c @@ -36,6 +36,8 @@ #include "qemu/log.h" #include "sysemu/runstate.h" #include "qemu/cutils.h" +#include "qemu/config-file.h" +#include "qemu/option.h" #ifdef CONFIG_LINUX #include <sys/prctl.h> @@ -152,9 +154,21 @@ int os_parse_cmd_args(int index, const char *optarg) daemonize = 1; break; #if defined(CONFIG_LINUX) + /* deprecated */ case QEMU_OPTION_asyncteardown: init_async_teardown(); break; + case QEMU_OPTION_run_with: { + QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("run-with"), + optarg, false); + if (!opts) { + exit(1); + } + if (qemu_opt_get_bool(opts, "async-teardown", false)) { + init_async_teardown(); + } + break; + } #endif default: return -1; |