qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Bruce Rogers <brogers@suse.com>
Cc: qemu-devel@nongnu.org, aliguori@amazon.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] vl.c: Keep maxram_size and ram_size consistent unless specified otherwise
Date: Tue, 8 Jul 2014 15:23:25 +0200	[thread overview]
Message-ID: <20140708152325.789de1e8@igors-macbook-pro.local> (raw)
In-Reply-To: <1404774322-5709-1-git-send-email-brogers@suse.com>

On Mon,  7 Jul 2014 17:05:22 -0600
Bruce Rogers <brogers@suse.com> wrote:

> When using a memory size less than the default amount with older pc
> machine types, a failure occurs because of the way maxram_size and
> ram_size get initialized. Keep maxram_size and ram_size the same,
> except when maxmem is specified on the command line.
> 
> Signed-off-by: Bruce Rogers <brogers@suse.com>
> ---
>  vl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vl.c b/vl.c
> index 6e084c2..0cb8c10 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3345,7 +3345,6 @@ int main(int argc, char **argv, char **envp)
>                                  RAM_ADDR_FMT ")\n", slots, sz,
> ram_size); exit(EXIT_FAILURE);
>                      }
> -                    maxram_size = sz;
>                      ram_slots = slots;
>                  } else if ((!maxmem_str && slots_str) ||
>                             (maxmem_str && !slots_str)) {
> @@ -3353,6 +3352,7 @@ int main(int argc, char **argv, char **envp)
>                              "'%s' option\n", slots_str ? "maxmem" :
> "slots"); exit(EXIT_FAILURE);
>                  }
> +                maxram_size = sz;
Relying here on sz being either ram_size or maxmem is a bit fragile.
It'd be better to set maxram_size to ram_size before parsing maxmem.

I'll post alternative patch. 

>                  break;
>              }
>  #ifdef CONFIG_TPM

  reply	other threads:[~2014-07-08 13:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 23:05 [Qemu-devel] [PATCH] vl.c: Keep maxram_size and ram_size consistent unless specified otherwise Bruce Rogers
2014-07-08 13:23 ` Igor Mammedov [this message]
2014-07-08 13:51   ` Bruce Rogers

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=20140708152325.789de1e8@igors-macbook-pro.local \
    --to=imammedo@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=brogers@suse.com \
    --cc=mst@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).