From 8c7c3c58e3e33c80d1eef1514db3c705a4de692e Mon Sep 17 00:00:00 2001 From: Heinz Graalfs Date: Mon, 19 Nov 2012 23:28:34 +0000 Subject: [PATCH 1/2] s390: Fix ram_size updating in machine init The global variable 'ram_size' is hidden by the local variable declaration in s390_init(). Since we want to update the global ram size in certain cases we must not use a local ram_size variable. - This fixes booting with unusual ram sizes like -m 67001 - This changes behaviour back to the situation before commit 5f072e1f3075bd869e0ace9f2545a85992ac0084 (create struct for machine initialization arguments) Signed-off-by: Heinz Graalfs Reviewed-by: Eduardo Habkost Signed-off-by: Christian Borntraeger Signed-off-by: Alexander Graf --- hw/s390-virtio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 685cb5413e..ca1bb09816 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -155,7 +155,6 @@ unsigned s390_del_running_cpu(CPUS390XState *env) static void s390_init(QEMUMachineInitArgs *args) { ram_addr_t my_ram_size = args->ram_size; - ram_addr_t ram_size = args->ram_size; const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; From 773de5c786a6050bbf3b33c0e29d1bd519a40b4b Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Fri, 23 Nov 2012 00:18:12 +0000 Subject: [PATCH 2/2] sclp: Fix uninitialized var in handle_write_event_buf(). Some gcc versions rightly complain about a possibly unitialized rc, so let's move setting it before the QTAILQ_FOREACH(). Signed-off-by: Cornelia Huck Signed-off-by: Christian Borntraeger Signed-off-by: Jens Freimann Signed-off-by: Alexander Graf --- hw/s390x/event-facility.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 93676602a7..bc9cea9e1b 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -112,12 +112,13 @@ static uint16_t handle_write_event_buf(SCLPEventFacility *ef, SCLPEvent *event; SCLPEventClass *ec; + rc = SCLP_RC_INVALID_FUNCTION; + QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) { DeviceState *qdev = kid->child; event = (SCLPEvent *) qdev; ec = SCLP_EVENT_GET_CLASS(event); - rc = SCLP_RC_INVALID_FUNCTION; if (ec->write_event_data && ec->event_type() == event_buf->type) { rc = ec->write_event_data(event, event_buf);