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>
This commit is contained in:
Claudio Imbrenda
2023-05-05 14:00:51 +02:00
committed by Thomas Huth
parent da9000784c
commit 80bd81cadd
4 changed files with 63 additions and 11 deletions

View File

@ -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;