All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>,
	 pbonzini@redhat.com, qemu-devel@nongnu.org,  david@redhat.com,
	 borntraeger@de.ibm.com, frankja@linux.ibm.com,
	 fiuczy@linux.ibm.com,  pasic@linux.ibm.com, berrange@redhat.com,
	 alex.bennee@linaro.org
Subject: Re: [PATCH v2 1/1] util/async-teardown: wire up query-command-line-options
Date: Mon, 20 Mar 2023 17:05:07 +0100	[thread overview]
Message-ID: <87355zmmrw.fsf@pond.sub.org> (raw)
In-Reply-To: <6a9ef526-1b30-e9a6-37ee-59ca3dadea9d@redhat.com> (Thomas Huth's message of "Mon, 20 Mar 2023 16:42:17 +0100")

Thomas Huth <thuth@redhat.com> writes:

> On 20/03/2023 16.31, Markus Armbruster wrote:
>> Claudio Imbrenda <imbrenda@linux.ibm.com> writes:
>> 
>>> 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.
>> 
>> There was nothing improper in its wiring.  The issue is that
>> query-command-line-options is junk.  See my recent post
>> 
>>      Subject: query-command-line-options (was: [PATCH 1/7] qemu: capabilities: Introduce QEMU_CAPS_MACHINE_ACPI)
>>      Date: Tue, 07 Mar 2023 10:40:23 +0100
>>      Message-ID: <87jzzsc320.fsf_-_@pond.sub.org>
>> 
>>> This patch fixes the issue by correctly wiring up the commandline
>>> option so that it appears in the output of query-command-line-options.
>>>
>>> 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>
>>> ---
>>>   util/async-teardown.c | 17 +++++++++++++++++
>>>   1 file changed, 17 insertions(+)
>>>
>>> diff --git a/util/async-teardown.c b/util/async-teardown.c
>>> index 62cdeb0f20..c9b9a3cdb2 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,17 @@ 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",
>>> +    .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);
>> 
>> Now it *is* improperly wired up :)
>> 
>> You're defining new QemuOpts config group "async-teardown" with
>> arbitrary option parameters, but don't actually use it for parsing or
>> recording the option.  I figure because you can't: there is no option
>> argument to parse and record, which is what QemuOpts is designed to do.
>> 
>> If you need the feature to be visible in query-command-line-options, you
>> should make it an option parameter (a KEY, not a GROUP), preferably of
>> an existing group / option.
>
> Would it make sense to add it e.g. to "-action" instead, i.e. something like 
> "-action teardown=async" ?

I believe the new parameter "teardown" would be visible in
query-command-line-options.

How well does it fit -action?



  reply	other threads:[~2023-03-20 16:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 13:16 [PATCH v2 0/1] util/async-teardown: wire up query-command-line-options Claudio Imbrenda
2023-03-20 13:16 ` [PATCH v2 1/1] " Claudio Imbrenda
2023-03-20 15:31   ` Markus Armbruster
2023-03-20 15:42     ` Thomas Huth
2023-03-20 16:05       ` Markus Armbruster [this message]
2023-03-20 16:21         ` Claudio Imbrenda
2023-03-21 20:47       ` Paolo Bonzini
2023-03-22  9:28         ` Daniel P. Berrangé
2023-03-22 14:00           ` Thomas Huth
2023-03-22 14:48             ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87355zmmrw.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=fiuczy@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.