qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-ppc <qemu-ppc@nongnu.org>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] fix qemu_get_cpu(), should return NULL if CPU not found
Date: Tue, 12 Mar 2013 10:42:09 +0100	[thread overview]
Message-ID: <513EF871.70409@suse.de> (raw)
In-Reply-To: <1362679963-23201-1-git-send-email-imammedo@redhat.com>

Am 07.03.2013 19:12, schrieb Igor Mammedov:
> commit 55e5c2850 breaks CPU not found return value, and returns
> CPU corresponding to the last non NULL env.
> Fix it by returning CPU only if env is not NULL, otherwise CPU is
> not found and function should return NULL.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

D'oh, that was exactly the problem in ppc code I tried to fix by using
this function! ;-)

Thanks, applied to qom-cpu (with modified commit message):
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Pull coming up.

Andreas

> ---
>  exec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/exec.c b/exec.c
> index 46a2830..0a96ddb 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -260,7 +260,7 @@ CPUState *qemu_get_cpu(int index)
>          env = env->next_cpu;
>      }
>  
> -    return cpu;
> +    return env ? cpu : NULL;
>  }
>  
>  void cpu_exec_init(CPUArchState *env)
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

      reply	other threads:[~2013-03-12  9:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 18:12 [Qemu-devel] [PATCH] fix qemu_get_cpu(), should return NULL if CPU not found Igor Mammedov
2013-03-12  9:42 ` Andreas Färber [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=513EF871.70409@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).