From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, peter.maydell@linaro.org
Subject: Re: [PATCH v2] cpus: Fix botched configure_icount() error API violation fix
Date: Fri, 15 May 2020 08:44:16 +0200 [thread overview]
Message-ID: <2d87501c-4b59-3b89-8281-70f96e8cd989@redhat.com> (raw)
In-Reply-To: <20200515042231.18201-1-armbru@redhat.com>
On 5/15/20 6:22 AM, Markus Armbruster wrote:
> Before recent commit abc9bf69a66, configure_icount() returned early
> when option "shift" was absent: succeed when option "align" was also
> absent, else fail.
>
> Since then, it still errors out when only "align" is present, but
> continues when both are absent. Crashes when examining the value of
> "shift" further. Reproducer: -icount "".
>
> Revert this erroneous part of the commit.
>
> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
> Fixes: Coverity CID 1428754
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> cpus.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 5670c96bcf..ee906dd08f 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -803,8 +803,10 @@ void configure_icount(QemuOpts *opts, Error **errp)
> bool align = qemu_opt_get_bool(opts, "align", false);
> long time_shift = -1;
>
> - if (!option && qemu_opt_get(opts, "align")) {
> - error_setg(errp, "Please specify shift option when using align");
> + if (!option) {
> + if (qemu_opt_get(opts, "align") != NULL) {
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> + error_setg(errp, "Please specify shift option when using align");
> + }
> return;
> }
>
>
next prev parent reply other threads:[~2020-05-15 6:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-15 4:22 [PATCH v2] cpus: Fix botched configure_icount() error API violation fix Markus Armbruster
2020-05-15 6:44 ` Philippe Mathieu-Daudé [this message]
2020-05-21 15:08 ` Paolo Bonzini
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=2d87501c-4b59-3b89-8281-70f96e8cd989@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).