]> Git Repo - qemu.git/commitdiff
pc: exit QEMU if compat machine doesn't support memory hotlpug
authorIgor Mammedov <[email protected]>
Mon, 2 Jun 2014 13:25:11 +0000 (15:25 +0200)
committerMichael S. Tsirkin <[email protected]>
Thu, 19 Jun 2014 13:41:48 +0000 (16:41 +0300)
... if user attempts to start it with memory hotplug enabled.

Signed-off-by: Igor Mammedov <[email protected]>
Acked-by: Peter Crosthwaite <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/i386/pc.c

index 830aeeec91fbdd63deb7e4da70c4ab1c2b2be504..4fad4146323b5eb58d7757f183cb4947b4835fd7 100644 (file)
@@ -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)) {
This page took 0.028125 seconds and 4 git commands to generate.