qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: qemu-devel@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Michael Roth" <michael.roth@amd.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	berrange@redhat.com, "Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH v2 01/12] qapi: expose rtc-reset-reinjection command unconditionally
Date: Sat, 17 May 2025 10:21:26 +0200	[thread overview]
Message-ID: <87plg7myux.fsf@pond.sub.org> (raw)
In-Reply-To: <20250515172732.3992504-2-pierrick.bouvier@linaro.org> (Pierrick Bouvier's message of "Thu, 15 May 2025 10:27:21 -0700")

Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:

> 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.
>
> The stub impl for non-i386 targets retains this no-op behaviour.
> However, it is now reporting an Error mentioning this command is not
> available for current target.
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

[...]

> diff --git a/stubs/monitor-i386-rtc.c b/stubs/monitor-i386-rtc.c
> new file mode 100644
> index 00000000000..d810f33efec
> --- /dev/null
> +++ b/stubs/monitor-i386-rtc.c
> @@ -0,0 +1,11 @@
> +/* 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)
> +{
> +    error_setg(errp,
> +               "rtc-reset-injection is only available for x86 machines with RTC");
> +}

We get this stub exactly when the command did not exist before the
patch.  Thus, the command fails before and after, only error code and
message change, which is fine.

However, the error message feels brittle: it becomes misleading when we
implement the command for other targets.  Let's dumb it down to
something like "RTC interrupt reinjection backlog reset is not available
for this machine".

[...]



  reply	other threads:[~2025-05-17  8:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 17:27 [PATCH v2 00/12] qapi: remove all TARGET_* conditionals from the schema Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 01/12] qapi: expose rtc-reset-reinjection command unconditionally Pierrick Bouvier
2025-05-17  8:21   ` Markus Armbruster [this message]
2025-05-17 19:39     ` Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 02/12] qapi: expand docs for SEV commands Pierrick Bouvier
2025-05-19  5:57   ` Markus Armbruster
2025-05-21 19:21     ` Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 03/12] qapi: make SEV commands unconditionally available Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 04/12] qapi: expose query-gic-capability command unconditionally Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 05/12] qapi: make SGX commands unconditionally available Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 06/12] qapi: make Xen event " Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 07/12] qapi: remove the misc-target.json file Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 08/12] qapi: Make CpuModelExpansionInfo::deprecated-props optional and generic Pierrick Bouvier
2025-05-19  6:18   ` Markus Armbruster
2025-05-21 19:22     ` Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 09/12] qapi: make most CPU commands unconditionally available Pierrick Bouvier
2025-05-17  6:00   ` Markus Armbruster
2025-05-17 19:41     ` Pierrick Bouvier
2025-05-19  6:29   ` Markus Armbruster
2025-05-21 19:29     ` Pierrick Bouvier
2025-05-22  5:12       ` Markus Armbruster
2025-05-22 18:45         ` Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 10/12] qapi: make s390x specific " Pierrick Bouvier
2025-05-15 17:27 ` [PATCH v2 11/12] qapi: remove qapi_specific_outputs from meson.build Pierrick Bouvier
2025-05-19  8:50   ` Markus Armbruster
2025-05-15 17:27 ` [PATCH v2 12/12] qapi: make all generated files common Pierrick Bouvier
2025-05-19  9:14   ` Markus Armbruster
2025-05-21 22:41 ` [PATCH v2 00/12] qapi: remove all TARGET_* conditionals from the schema 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=87plg7myux.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@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).