Skip to contentSkip to conversation

util/async-teardown: wire up query-command-line-options

PATCH Superseded Claudio Imbrenda 2 participants 3 messages Mar 20, 2023

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util/async-teardown: wire up query-command-line-options

The recently introduced -async-teardown commandline option was not wired up properly and did not show up in the output of the QMP command query-command-line-options. This means that libvirt will have no way to discover whether the feature is supported.

This patch fixes the issue by correctly wiring up the commandline option so that it appears in the output of query-command-line-options.

Fixes c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux")
---
 util/async-teardown.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
util/async-teardown.c +18 -0
index 62cdeb0f20..9a2e7bc146 100644
@@ -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,18 @@ 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_async_teardown_opts = {
+    .name = "async-teardown",
+    .implied_opt_name = "enable",
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_async_teardown_opts.head),
+    .desc = {
+        { /* end of list */ }
+    },
+};
+
+static void register_async_teardown(void)
+{
+    qemu_add_opts(&qemu_async_teardown_opts);
+}
+opts_init(register_async_teardown);
Signature · 1 line
2.39.2
#1 lore raw
Quoted 30 lines · Claudio Imbrenda

The recently introduced -async-teardown commandline option was not wired up properly and did not show up in the output of the QMP command query-command-line-options. This means that libvirt will have no way to discover whether the feature is supported.

This patch fixes the issue by correctly wiring up the commandline option so that it appears in the output of query-command-line-options.

Fixes c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux")
---
  util/async-teardown.c | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
util/async-teardown.c +3 -0
index 62cdeb0f20..9a2e7bc146 100644
@@ -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>

util/async-teardown.c void init_async_teardown(void) · line 153

Quoted 7 lines
util/async-teardown.c +4 -0
@@ -144,3 +147,18 @@ 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_async_teardown_opts = {
+    .name = "async-teardown",
+    .implied_opt_name = "enable",

Are you sure about the "implied_opt_name" field? If I got that right, it's used for options where you can omit the part before the "=" in the first paramter, e.g.

-netdev user

is the same as:

-netdev type=user

... but as far as I can see, there is no way to use

-async-teardown enable=off

at the command line?

Thomas

Quoted 11 lines
util/async-teardown.c +11 -0
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_async_teardown_opts.head),
+    .desc = {
+        { /* end of list */ }
+    },
+};
+
+static void register_async_teardown(void)
+{
+    qemu_add_opts(&qemu_async_teardown_opts);
+}
+opts_init(register_async_teardown);
#2 lore raw
Quoted 32 lines · On Mon, 20 Mar 2023 09:56:05 +0100 Thomas Huth <[email protected]> wrote:
Quoted 31 lines · Claudio Imbrenda

The recently introduced -async-teardown commandline option was not wired up properly and did not show up in the output of the QMP command query-command-line-options. This means that libvirt will have no way to discover whether the feature is supported.

This patch fixes the issue by correctly wiring up the commandline option so that it appears in the output of query-command-line-options.

Fixes c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux")
---
  util/async-teardown.c | 18 ++++++++++++++++++
  1 file changed, 18 insertions(+)
util/async-teardown.c +3 -0
index 62cdeb0f20..9a2e7bc146 100644
@@ -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,18 @@ void init_async_teardown(void)
      clone(async_teardown_fn, new_stack_for_clone(), CLONE_VM, NULL);
Quoted 8 lines

util/async-teardown.c void init_async_teardown(void) · line 153

Quoted 6 lines
util/async-teardown.c +4 -0
      sigprocmask(SIG_SETMASK, &old_signals, NULL);
  }
+
+static QemuOptsList qemu_async_teardown_opts = {
+    .name = "async-teardown",
+    .implied_opt_name = "enable",  

Are you sure about the "implied_opt_name" field? If I got that right, it's

yeah that should not be there, I'll fix and send a v2

Quoted 30 lines

used for options where you can omit the part before the "=" in the first paramter, e.g.

-netdev user

is the same as:

-netdev type=user

... but as far as I can see, there is no way to use

-async-teardown enable=off

at the command line?

Thomas

Quoted 11 lines
util/async-teardown.c +11 -0
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_async_teardown_opts.head),
+    .desc = {
+        { /* end of list */ }
+    },
+};
+
+static void register_async_teardown(void)
+{
+    qemu_add_opts(&qemu_async_teardown_opts);
+}
+opts_init(register_async_teardown);