aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorClaudio Imbrenda <imbrenda@linux.ibm.com>2023-05-05 14:00:51 +0200
committerThomas Huth <thuth@redhat.com>2023-05-16 09:14:18 +0200
commit80bd81cadd127c1e2fc784612a52abe392670ba4 (patch)
treeb8bbf72d575a44bb3f3da61ae147d87790b3733f /util
parentda9000784c90d2b645eedaa865b5cf778cb4d37f (diff)
downloadqemu-80bd81cadd127c1e2fc784612a52abe392670ba4.zip
qemu-80bd81cadd127c1e2fc784612a52abe392670ba4.tar.gz
qemu-80bd81cadd127c1e2fc784612a52abe392670ba4.tar.bz2
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 'util')
-rw-r--r--util/async-teardown.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/util/async-teardown.c b/util/async-teardown.c
index 62cdeb0..3ab19c8 100644
--- a/util/async-teardown.c
+++ b/util/async-teardown.c
@@ -12,6 +12,9 @@
*/
#include "qemu/osdep.h"
+#include "qemu/config-file.h"
+#include "qemu/option.h"
+#include "qemu/module.h"
#include <dirent.h>
#include <sys/prctl.h>
#include <sched.h>
@@ -144,3 +147,21 @@ void init_async_teardown(void)
clone(async_teardown_fn, new_stack_for_clone(), CLONE_VM, NULL);
sigprocmask(SIG_SETMASK, &old_signals, NULL);
}
+
+static QemuOptsList qemu_run_with_opts = {
+ .name = "run-with",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head),
+ .desc = {
+ {
+ .name = "async-teardown",
+ .type = QEMU_OPT_BOOL,
+ },
+ { /* end of list */ }
+ },
+};
+
+static void register_teardown(void)
+{
+ qemu_add_opts(&qemu_run_with_opts);
+}
+opts_init(register_teardown);