From patchwork Tue May 27 13:01:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 352969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 38271140093 for ; Tue, 27 May 2014 23:36:57 +1000 (EST) Received: from localhost ([::1]:34812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpHYl-0001Ud-1O for incoming@patchwork.ozlabs.org; Tue, 27 May 2014 09:36:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpHYB-0000hw-8X for qemu-devel@nongnu.org; Tue, 27 May 2014 09:36:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpHY4-0008FL-Jk for qemu-devel@nongnu.org; Tue, 27 May 2014 09:36:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpHY4-0008Ex-CC for qemu-devel@nongnu.org; Tue, 27 May 2014 09:36:12 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4RD531B023842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 May 2014 09:05:04 -0400 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4RD3Ihc011965; Tue, 27 May 2014 09:04:58 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Tue, 27 May 2014 15:01:13 +0200 Message-Id: <1401195691-11136-17-git-send-email-imammedo@redhat.com> In-Reply-To: <1401195691-11136-1-git-send-email-imammedo@redhat.com> References: <1401195691-11136-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, alex@alex.org.uk, mst@redhat.com, aik@ozlabs.ru, hutao@cn.fujitsu.com, mjt@tls.msk.ru, tangchen@cn.fujitsu.com, kraxel@redhat.com, pasteka@kabsi.at, s.priebe@profihost.ag, agarcia@igalia.com, armbru@redhat.com, aliguori@amazon.com, david@gibson.dropbear.id.au, lersek@redhat.com, ehabkost@redhat.com, marcel.a@redhat.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, rth@twiddle.net, agraf@suse.de, andrey@xdel.ru, vasilis.liaskovitis@profitbricks.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH v3 16/34] pc: exit QEMU if compat machine doesn't support memory hotlpug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org ... if user attempts to start it with memory hotplug enabled. Signed-off-by: Igor Mammedov --- hw/i386/pc.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5be7b33..af68c99 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1229,6 +1229,16 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory, e820_add_entry(0x100000000ULL, above_4g_mem_size, E820_RAM); } + if (!guest_info->has_reserved_memory && + (machine->ram_slots || + (machine->maxram_size > ram_size))) { + MachineClass *mc = MACHINE_GET_CLASS(machine); + + error_report("\"-memory 'slots|maxmem'\" is not supported by: %s", + mc->name); + exit(EXIT_FAILURE); + } + /* initialize hotplug memory address space */ if (guest_info->has_reserved_memory && (ram_size < machine->maxram_size)) {