From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: qemu-devel@nongnu.org, "Michael Roth" <michael.roth@amd.com>,
alex.bennee@linaro.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
peter.maydell@linaro.org, "Markus Armbruster" <armbru@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 01/12] qapi: expose rtc-reset-reinjection command unconditionally
Date: Thu, 15 May 2025 09:45:52 +0100 [thread overview]
Message-ID: <aCWpn-ZzyygxT-2F@redhat.com> (raw)
In-Reply-To: <20250514234108.3746675-2-pierrick.bouvier@linaro.org>
On Wed, May 14, 2025 at 04:40:57PM -0700, Pierrick Bouvier wrote:
> From: Daniel P. Berrangé <berrange@redhat.com>
>
> This removes the TARGET_I386 condition from the rtc-reset-reinjection
> command. This requires providing a QMP command stub for non-i386 target.
> This in turn requires moving the command out of misc-target.json, since
> that will trigger symbol poisoning errors when built from target
> independent code.
>
> Rather than putting the command into misc.json, it is proposed to create
> misc-$TARGET.json files to hold commands whose impl is conceptually
> only applicable to a single target. This gives an obvious docs hint to
> consumers that the command is only useful in relation a specific target,
> while misc.json is for commands applicable to 2 or more targets.
>
> The current impl of qmp_rtc_reset_reinject() is a no-op if the i386
> RTC is disabled in Kconfig, or if the running machine type lack any
> RTC device. Thus the stub impl for non-i386 targets retains this
> no-op behaviour, instead of reporting a Error which is the more usual
> choice for commands invoked against unsupported configurations.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> qapi/misc-i386.json | 24 ++++++++++++++++++++++++
> qapi/misc-target.json | 17 -----------------
> qapi/qapi-schema.json | 1 +
> hw/i386/monitor.c | 2 +-
> stubs/monitor-i386-rtc.c | 14 ++++++++++++++
> qapi/meson.build | 1 +
> stubs/meson.build | 1 +
> 7 files changed, 42 insertions(+), 18 deletions(-)
> create mode 100644 qapi/misc-i386.json
> create mode 100644 stubs/monitor-i386-rtc.c
> diff --git a/stubs/monitor-i386-rtc.c b/stubs/monitor-i386-rtc.c
> new file mode 100644
> index 00000000000..e78757b24f2
> --- /dev/null
> +++ b/stubs/monitor-i386-rtc.c
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include "qemu/osdep.h"
> +#include "qapi/error.h"
> +#include "qapi/qapi-commands-misc-i386.h"
> +
> +void qmp_rtc_reset_reinjection(Error **errp)
> +{
> + /*
> + * Use of this command is only applicable for x86 machines with an RTC,
> + * and on other machines will silently return without performing any
> + * action.
> + */
> +}
Based on Markus' feedback, I think we need to report an error here
rather than silently ignore the code.
The existing real impl of this method can also benefit from removing
the assert, but that's not in scope of this series
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-05-15 8:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 23:40 [PATCH 00/12] qapi: remove all TARGET_* conditionals from the schema Pierrick Bouvier
2025-05-14 23:40 ` [PATCH 01/12] qapi: expose rtc-reset-reinjection command unconditionally Pierrick Bouvier
2025-05-15 8:45 ` Daniel P. Berrangé [this message]
2025-05-15 16:00 ` Pierrick Bouvier
2025-05-14 23:40 ` [PATCH 02/12] qapi: expand docs for SEV commands Pierrick Bouvier
2025-05-14 23:40 ` [PATCH 03/12] qapi: make SEV commands unconditionally available Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 04/12] qapi: expose query-gic-capability command unconditionally Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 05/12] qapi: make SGX commands unconditionally available Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 06/12] qapi: make Xen event " Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 07/12] qapi: remove the misc-target.json file Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 08/12] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 09/12] qapi: make most CPU commands unconditionally available Pierrick Bouvier
2025-05-15 8:24 ` Richard Henderson
2025-05-15 8:25 ` Richard Henderson
2025-05-15 16:05 ` Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 10/12] qapi: make s390x specific " Pierrick Bouvier
2025-05-14 23:41 ` [PATCH 11/12] qapi: remove qapi_specific_outputs from meson.build Pierrick Bouvier
2025-05-15 8:55 ` Daniel P. Berrangé
2025-05-14 23:41 ` [PATCH 12/12] qapi: make all generated files common Pierrick Bouvier
2025-05-15 8:56 ` Daniel P. Berrangé
2025-05-15 8:25 ` [PATCH 00/12] qapi: remove all TARGET_* conditionals from the schema Richard Henderson
2025-05-15 17:29 ` Pierrick Bouvier
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=aCWpn-ZzyygxT-2F@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).