mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
1723a1b631
commit
311467f77e
|
@ -109,9 +109,8 @@ static void ccw_init(MachineState *machine)
|
||||||
int ret;
|
int ret;
|
||||||
VirtualCssBus *css_bus;
|
VirtualCssBus *css_bus;
|
||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
QemuOpts *opts = qemu_opts_find(qemu_find_opts("memory"), NULL);
|
|
||||||
ram_addr_t pad_size = 0;
|
ram_addr_t pad_size = 0;
|
||||||
ram_addr_t maxmem = qemu_opt_get_size(opts, "maxmem", my_ram_size);
|
ram_addr_t maxmem = machine->maxram_size;
|
||||||
ram_addr_t standby_mem_size = maxmem - my_ram_size;
|
ram_addr_t standby_mem_size = maxmem - my_ram_size;
|
||||||
uint64_t kvm_limit;
|
uint64_t kvm_limit;
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "exec/memory.h"
|
#include "exec/memory.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
#include "exec/address-spaces.h"
|
#include "exec/address-spaces.h"
|
||||||
#include "qemu/config-file.h"
|
#include "hw/boards.h"
|
||||||
#include "hw/s390x/sclp.h"
|
#include "hw/s390x/sclp.h"
|
||||||
#include "hw/s390x/event-facility.h"
|
#include "hw/s390x/event-facility.h"
|
||||||
#include "hw/s390x/s390-pci-bus.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)
|
static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
|
||||||
{
|
{
|
||||||
ReadInfo *read_info = (ReadInfo *) sccb;
|
ReadInfo *read_info = (ReadInfo *) sccb;
|
||||||
|
MachineState *machine = MACHINE(qdev_get_machine());
|
||||||
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
|
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
|
||||||
CPUState *cpu;
|
CPUState *cpu;
|
||||||
int cpu_count = 0;
|
int cpu_count = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int increment_size = 20;
|
int increment_size = 20;
|
||||||
int rnsize, rnmax;
|
int rnsize, rnmax;
|
||||||
QemuOpts *opts = qemu_opts_find(qemu_find_opts("memory"), NULL);
|
int slots = MIN(machine->ram_slots, s390_get_memslot_count(kvm_state));
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPU_FOREACH(cpu) {
|
CPU_FOREACH(cpu) {
|
||||||
cpu_count++;
|
cpu_count++;
|
||||||
|
|
Loading…
Reference in New Issue