diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2015-05-29 13:14:50 +0200 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2015-09-07 16:10:44 +0200 |
commit | 311467f77eab5c3e1f8e0f6f446201e3a1f46e70 (patch) | |
tree | df58f31367971622c1018abaa9de3bd5dec8e12f /hw/s390x/sclp.c | |
parent | 1723a1b6313851d9704961e1f527312ee0a5fce4 (diff) |
s390: no need to manually parse for slots and maxmem
ram_slots and maxram_size has already been parsed and verified by
common code for us.
Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/sclp.c')
-rw-r--r-- | hw/s390x/sclp.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 87f4902b51..3ad5d3a5b9 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -17,7 +17,7 @@ #include "exec/memory.h" #include "sysemu/sysemu.h" #include "exec/address-spaces.h" -#include "qemu/config-file.h" +#include "hw/boards.h" #include "hw/s390x/sclp.h" #include "hw/s390x/event-facility.h" #include "hw/s390x/s390-pci-bus.h" @@ -31,19 +31,14 @@ static inline SCLPDevice *get_sclp_device(void) static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) { ReadInfo *read_info = (ReadInfo *) sccb; + MachineState *machine = MACHINE(qdev_get_machine()); sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev(); CPUState *cpu; int cpu_count = 0; int i = 0; int increment_size = 20; int rnsize, rnmax; - QemuOpts *opts = qemu_opts_find(qemu_find_opts("memory"), NULL); - int slots = qemu_opt_get_number(opts, "slots", 0); - int max_avail_slots = s390_get_memslot_count(kvm_state); - - if (slots > max_avail_slots) { - slots = max_avail_slots; - } + int slots = MIN(machine->ram_slots, s390_get_memslot_count(kvm_state)); CPU_FOREACH(cpu) { cpu_count++; |