From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxIX5-0008JR-6r for qemu-devel@nongnu.org; Wed, 18 Jun 2014 12:16:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxIWz-0005xA-4s for qemu-devel@nongnu.org; Wed, 18 Jun 2014 12:16:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxIWy-0005wk-T5 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 12:16:13 -0400 Date: Wed, 18 Jun 2014 19:16:30 +0300 From: "Michael S. Tsirkin" Message-ID: <1403108034-32054-16-git-send-email-mst@redhat.com> References: <1403108034-32054-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1403108034-32054-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 015/106] pc: exit QEMU if compat machine doesn't support memory hotlpug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Anthony Liguori , Igor Mammedov From: Igor Mammedov ... if user attempts to start it with memory hotplug enabled. Signed-off-by: Igor Mammedov Acked-by: Peter Crosthwaite Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 830aeee..4fad414 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1225,6 +1225,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)) { -- MST