From: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: Gleb Natapov <gleb@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Christian Borntraeger <borntraeger@de.ibm.com>,
aliguori@amazon.com, Cornelia Huck <cornelia.huck@de.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 3/5] target-s390: Check for standby memory specification
Date: Tue, 17 Dec 2013 10:58:50 -0500 [thread overview]
Message-ID: <52B074BA.2030207@linux.vnet.ibm.com> (raw)
In-Reply-To: <7634A04F-3B79-4279-BAB9-6F8E773197E8@suse.de>
On 12/16/2013 04:25 PM, Alexander Graf wrote:
>
> On 16.12.2013, at 21:51, Matthew Rosato <mjrosato@linux.vnet.ibm.com> wrote:
>
>> When machine=...,standby-mem={size} has been specified, convert the value
>> to bytes and store it for use.
>>
>> Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
>> ---
>> target-s390x/kvm.c | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
>> index 02ac4ba..d4081f4 100644
>> --- a/target-s390x/kvm.c
>> +++ b/target-s390x/kvm.c
>> @@ -97,11 +97,27 @@ static void *legacy_s390_alloc(size_t size);
>>
>> int kvm_arch_init(KVMState *s)
>> {
>> + int64_t value;
>> +
>> cap_sync_regs = kvm_check_extension(s, KVM_CAP_SYNC_REGS);
>> if (!kvm_check_extension(s, KVM_CAP_S390_GMAP)
>> || !kvm_check_extension(s, KVM_CAP_S390_COW)) {
>> phys_mem_set_alloc(legacy_s390_alloc);
>> }
>> +
>> + value = qemu_opt_get_size(qemu_get_machine_opts(), "standby-mem", -1);
>> +
>> + if (value < 0) {
>> + fprintf(stderr, "qemu: invalid standby-mem size:%"PRId64"\n", value);
>> + exit(1);
>> + }
>> +
>> + if (value != (int64_t)(ram_addr_t)value) {
>> + fprintf(stderr, "qemu: standby size too large\n");
>> + exit(1);
>> + }
>> + standby_mem_size = value * 1024 * 1024;
>
> I would hope qemu_opt_get_size() returns a value in bytes. Why multiply it here?
>
It's actually in megabytes, and this is converting to bytes -- Based on
your comment, it sounds like qemu_opt_get_size should always be
returning a byte value.
FWIW, if I adopt Paolo's comments re: patch 1, this behavior goes away
(and the parsing moves out of s390). Either way, I'll adjust for v2.
>
> Alex
>
>
>
>
next prev parent reply other threads:[~2013-12-17 15:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 20:51 [Qemu-devel] [PATCH 0/5] s390: Support for Hotplug of Standby Memory Matthew Rosato
2013-12-16 20:51 ` [Qemu-devel] [PATCH 1/5] Add the standby-mem machine option Matthew Rosato
2013-12-17 10:09 ` Paolo Bonzini
2013-12-17 15:53 ` Matthew Rosato
2013-12-16 20:51 ` [Qemu-devel] [PATCH 2/5] virtio-ccw: Include standby memory when calculating storage increment Matthew Rosato
2013-12-16 20:51 ` [Qemu-devel] [PATCH 3/5] target-s390: Check for standby memory specification Matthew Rosato
2013-12-16 21:25 ` Alexander Graf
2013-12-17 15:58 ` Matthew Rosato [this message]
2013-12-17 16:48 ` Alexander Graf
2013-12-16 20:51 ` [Qemu-devel] [PATCH 4/5] sclp-s390: Define new SCLP codes and structures Matthew Rosato
2014-01-22 10:08 ` Christian Borntraeger
2014-03-20 9:56 ` Christian Borntraeger
2014-03-20 16:33 ` Matthew Rosato
2014-03-20 16:36 ` Christian Borntraeger
2013-12-16 20:51 ` [Qemu-devel] [PATCH 5/5] sclp-s390: Add memory hotplug SCLPs Matthew Rosato
2013-12-16 21:42 ` Alexander Graf
2013-12-16 23:18 ` Alexander Graf
2013-12-17 16:09 ` Matthew Rosato
2013-12-17 16:06 ` Matthew Rosato
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=52B074BA.2030207@linux.vnet.ibm.com \
--to=mjrosato@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=gleb@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).