From: Michael Tokarev <mjt@tls.msk.ru>
To: Cao jin <caoj.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, marcel@redhat.com
Subject: Re: [Qemu-trivial] [PATCH] set_memory_options: remove code that make no sense
Date: Tue, 03 Nov 2015 15:40:11 +0300 [thread overview]
Message-ID: <5638AB2B.5060700@msgid.tls.msk.ru> (raw)
In-Reply-To: <1446553829-28463-1-git-send-email-caoj.fnst@cn.fujitsu.com>
03.11.2015 15:30, Cao jin wrote:
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> vl.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index f5f7c3f..13f2c8b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2860,11 +2860,6 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
> sz = 0;
> mem_str = qemu_opt_get(opts, "size");
> if (mem_str) {
> - if (!*mem_str) {
> - error_report("missing 'size' option value");
> - exit(EXIT_FAILURE);
> - }
I'm not sure this one is bad or good, it is indeed possible
to specify no value for size=, but if we're to check that,
we'd have to add such checks everywhere.
But the next one...
> sz = qemu_opt_get_size(opts, "size", ram_size);
>
> /* Fix up legacy suffix-less format */
> @@ -2886,10 +2881,6 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
>
> sz = QEMU_ALIGN_UP(sz, 8192);
> ram_size = sz;
> - if (ram_size != sz) {
> - error_report("ram size too large");
> - exit(EXIT_FAILURE);
> - }
is definitely wrong.
sz is uint64_t, while ram_size is ram_addr_t which is
either uint64_t or uintptr_t. Until it is fixed to
always be 64bits, the above code makes (some) sense.
Thanks,
/mjt
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Cao jin <caoj.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, marcel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] set_memory_options: remove code that make no sense
Date: Tue, 03 Nov 2015 15:40:11 +0300 [thread overview]
Message-ID: <5638AB2B.5060700@msgid.tls.msk.ru> (raw)
In-Reply-To: <1446553829-28463-1-git-send-email-caoj.fnst@cn.fujitsu.com>
03.11.2015 15:30, Cao jin wrote:
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> vl.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index f5f7c3f..13f2c8b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2860,11 +2860,6 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
> sz = 0;
> mem_str = qemu_opt_get(opts, "size");
> if (mem_str) {
> - if (!*mem_str) {
> - error_report("missing 'size' option value");
> - exit(EXIT_FAILURE);
> - }
I'm not sure this one is bad or good, it is indeed possible
to specify no value for size=, but if we're to check that,
we'd have to add such checks everywhere.
But the next one...
> sz = qemu_opt_get_size(opts, "size", ram_size);
>
> /* Fix up legacy suffix-less format */
> @@ -2886,10 +2881,6 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
>
> sz = QEMU_ALIGN_UP(sz, 8192);
> ram_size = sz;
> - if (ram_size != sz) {
> - error_report("ram size too large");
> - exit(EXIT_FAILURE);
> - }
is definitely wrong.
sz is uint64_t, while ram_size is ram_addr_t which is
either uint64_t or uintptr_t. Until it is fixed to
always be 64bits, the above code makes (some) sense.
Thanks,
/mjt
next prev parent reply other threads:[~2015-11-03 12:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 12:30 [Qemu-trivial] [PATCH] set_memory_options: remove code that make no sense Cao jin
2015-11-03 12:30 ` [Qemu-devel] " Cao jin
2015-11-03 12:40 ` Michael Tokarev [this message]
2015-11-03 12:40 ` Michael Tokarev
2015-11-04 8:34 ` [Qemu-trivial] " Cao jin
2015-11-04 8:34 ` Cao jin
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=5638AB2B.5060700@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=marcel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.