[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/23] s390: no need to manually parse for slots and
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH 17/23] s390: no need to manually parse for slots and maxmem |
Date: |
Mon, 31 Aug 2015 13:13:57 +0200 |
From: David Hildenbrand <address@hidden>
ram_slots and maxram_size has already been parsed and verified by
common code for us.
Reviewed-by: Matthew Rosato <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-virtio-ccw.c | 3 +--
hw/s390x/sclp.c | 11 +++--------
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index e2a26e9..d4afe7d 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -109,9 +109,8 @@ static void ccw_init(MachineState *machine)
int ret;
VirtualCssBus *css_bus;
DeviceState *dev;
- QemuOpts *opts = qemu_opts_find(qemu_find_opts("memory"), NULL);
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;
uint64_t kvm_limit;
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 87f4902..3ad5d3a 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++;
--
2.5.1
- [Qemu-devel] [PATCH 00/23] s390x: further patches, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 01/23] s390x/css: handle ccw-0 TIC correctly, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 05/23] s390x/event-facility: fix location of receive mask, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 02/23] s390x/css: ccw-0 enforces count > 0, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 17/23] s390: no need to manually parse for slots and maxmem,
Cornelia Huck <=
- [Qemu-devel] [PATCH 03/23] s390x/event-facility: fix receive mask check, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 16/23] s390/sclp: move sclp_service_interrupt into the sclp device, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 13/23] s390/sclp: temporarily fix unassignment/reassignment of memory subregions, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 11/23] s390/sclp: rework sclp event facility initialization + device realization, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 08/23] s390x/kvm: make setting of in-kernel irq routes more efficient, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 19/23] s390/sclp: ignore memory hotplug operations if it is disabled, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 07/23] pc-bios/s390-ccw: rebuild image, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 18/23] s390: disallow memory hotplug for the s390-virtio machine, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 14/23] s390/sclp: introduce a root sclp device, Cornelia Huck, 2015/08/31
- [Qemu-devel] [PATCH 10/23] sclp/s390: rework sclp cpu hotplug device notification, Cornelia Huck, 2015/08/31