From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vswy8-0002aU-VS for qemu-devel@nongnu.org; Tue, 17 Dec 2013 10:54:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vswy0-0002Lu-VE for qemu-devel@nongnu.org; Tue, 17 Dec 2013 10:54:00 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:39381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vswy0-0002Lp-OD for qemu-devel@nongnu.org; Tue, 17 Dec 2013 10:53:52 -0500 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 17 Dec 2013 08:53:51 -0700 Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 7296719D8051 for ; Tue, 17 Dec 2013 08:53:41 -0700 (MST) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp07027.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBHFrko566781302 for ; Tue, 17 Dec 2013 16:53:46 +0100 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBHFrmDd015381 for ; Tue, 17 Dec 2013 08:53:48 -0700 Message-ID: <52B0738A.7070804@linux.vnet.ibm.com> Date: Tue, 17 Dec 2013 10:53:46 -0500 From: Matthew Rosato MIME-Version: 1.0 References: <1387227072-21965-1-git-send-email-mjrosato@linux.vnet.ibm.com> <1387227072-21965-2-git-send-email-mjrosato@linux.vnet.ibm.com> <52B022F1.4010707@redhat.com> In-Reply-To: <52B022F1.4010707@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] Add the standby-mem machine option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: gleb@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, aliguori@amazon.com, cornelia.huck@de.ibm.com, rth@twiddle.net On 12/17/2013 05:09 AM, Paolo Bonzini wrote: > Il 16/12/2013 21:51, Matthew Rosato ha scritto: >> Add the machine=...,standby-mem={size} option and associated >> documentation. > > See how Igor Mammedov's x86 memory hotplug instead added "-m NN,maxmem=NN". > > You could use these two patches: > > http://lists.gnu.org/archive/html/qemu-devel/2013-11/msg03438.html > http://lists.gnu.org/archive/html/qemu-devel/2013-11/msg03439.html > > Paolo Thanks Paolo, good point. I'll take a look at this for the next version. > >> Signed-off-by: Matthew Rosato >> --- >> qemu-options.hx | 6 +++++- >> vl.c | 6 ++++++ >> 2 files changed, 11 insertions(+), 1 deletion(-) >> >> diff --git a/qemu-options.hx b/qemu-options.hx >> index af34483..def4493 100644 >> --- a/qemu-options.hx >> +++ b/qemu-options.hx >> @@ -35,7 +35,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ >> " kernel_irqchip=on|off controls accelerated irqchip support\n" >> " kvm_shadow_mem=size of KVM shadow MMU\n" >> " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" >> - " mem-merge=on|off controls memory merge support (default: on)\n", >> + " mem-merge=on|off controls memory merge support (default: on)\n" >> + " standby-mem=size sets size of additional offline memory\n", >> QEMU_ARCH_ALL) >> STEXI >> @item -machine [type=]@var{name}[,prop=@var{value}[,...]] >> @@ -58,6 +59,9 @@ Include guest memory in a core dump. The default is on. >> Enables or disables memory merge support. This feature, when supported by >> the host, de-duplicates identical memory pages among VMs instances >> (enabled by default). >> +@item standby-mem=size >> +Defines the size, in megabytes, of additional memory to be left offline for >> +future hotplug by the guest. >> @end table >> ETEXI >> >> diff --git a/vl.c b/vl.c >> index b0399de..7d58d24 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -187,6 +187,7 @@ DisplayType display_type = DT_DEFAULT; >> static int display_remote; >> const char* keyboard_layout = NULL; >> ram_addr_t ram_size; >> +ram_addr_t standby_mem_size; >> const char *mem_path = NULL; >> int mem_prealloc = 0; /* force preallocation of physical target memory */ >> int nb_nics; >> @@ -430,6 +431,10 @@ static QemuOptsList qemu_machine_opts = { >> .name = "firmware", >> .type = QEMU_OPT_STRING, >> .help = "firmware image", >> + },{ >> + .name = "standby-mem", >> + .type = QEMU_OPT_SIZE, >> + .help = "standby memory size", >> }, >> { /* End of list */ } >> }, >> @@ -2906,6 +2911,7 @@ int main(int argc, char **argv, char **envp) >> machine = find_default_machine(); >> cpu_model = NULL; >> ram_size = 0; >> + standby_mem_size = 0; >> snapshot = 0; >> cyls = heads = secs = 0; >> translation = BIOS_ATA_TRANSLATION_AUTO; >> > > > >