diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-06-02 15:25:11 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 16:41:48 +0300 |
commit | ca8336f385d998d2bf25b66176c05a3794ee003a (patch) | |
tree | 911874afafed9d13b9de2f9139517e04c6dec087 /hw/i386 | |
parent | de268e134c03612970d6f2c214df6287c9621cc8 (diff) | |
download | qemu-ca8336f385d998d2bf25b66176c05a3794ee003a.tar.gz qemu-ca8336f385d998d2bf25b66176c05a3794ee003a.tar.bz2 qemu-ca8336f385d998d2bf25b66176c05a3794ee003a.zip |
pc: exit QEMU if compat machine doesn't support memory hotlpug
... if user attempts to start it with memory hotplug enabled.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | 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 830aeeec91..4fad414632 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)) { |