qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: hutao@cn.fujitsu.com, qemu-devel@nongnu.org,
	gaowanlong@cn.fujitsu.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH for 2.1] numa: handle mmaped memory allocation failure correctly
Date: Tue, 17 Jun 2014 14:22:42 +0300	[thread overview]
Message-ID: <20140617112242.GB7457@redhat.com> (raw)
In-Reply-To: <1403000225-19812-1-git-send-email-imammedo@redhat.com>

On Tue, Jun 17, 2014 at 12:17:05PM +0200, Igor Mammedov wrote:
> when memory_region_init_ram_from_file() fails
> memory_region_size() will still return size that was
> provided at region init time.
> Instead use errp to properly detect error condition.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>

Obviously correct, applied.
Thanks!

> ---
> patch depends on current PCI tree that stages last NUMA series
> 
>  numa.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/numa.c b/numa.c
> index eef0717..e471afe 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -238,7 +238,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion *mr, Object *owner,
>          /* Legacy behavior: if allocation failed, fall back to
>           * regular RAM allocation.
>           */
> -        if (!memory_region_size(mr)) {
> +        if (err) {
>              qerror_report_err(err);
>              error_free(err);
>              memory_region_init_ram(mr, owner, name, ram_size);
> -- 
> 1.7.1

      reply	other threads:[~2014-06-17 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 10:17 [Qemu-devel] [PATCH for 2.1] numa: handle mmaped memory allocation failure correctly Igor Mammedov
2014-06-17 11:22 ` Michael S. Tsirkin [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=20140617112242.GB7457@redhat.com \
    --to=mst@redhat.com \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@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).