qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, philmd@redhat.com
Subject: Re: [PATCH v2] cpus: Fix botched configure_icount() error API violation fix
Date: Thu, 21 May 2020 17:08:59 +0200	[thread overview]
Message-ID: <c9adf045-3f36-06d5-f385-0c0a3659be95@redhat.com> (raw)
In-Reply-To: <20200515042231.18201-1-armbru@redhat.com>

On 15/05/20 06:22, 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) {
> +            error_setg(errp, "Please specify shift option when using align");
> +        }
>          return;
>      }
>  
> 

Got the nicer commit message, too.

Paolo



      parent reply	other threads:[~2020-05-21 15:09 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é
2020-05-21 15:08 ` Paolo Bonzini [this message]

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=c9adf045-3f36-06d5-f385-0c0a3659be95@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --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).