Patchwork [1/1] s390: Fix ram_size updating in machine init

login
register
mail settings
Submitter Christian Borntraeger
Date Nov. 20, 2012, 9:28 a.m.
Message ID <1353403714-3093-1-git-send-email-borntraeger@de.ibm.com>
Download mbox | patch
Permalink /patch/200273/
State New
Headers show

Comments

Christian Borntraeger - Nov. 20, 2012, 9:28 a.m.
From: Heinz Graalfs <graalfs@linux.vnet.ibm.com>

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 <graalfs@linux.vnet.ibm.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 hw/s390-virtio.c |    1 -
 1 file changed, 1 deletion(-)
Alexander Graf - Nov. 20, 2012, 9:31 a.m.
On 20.11.2012, at 10:28, Christian Borntraeger wrote:

> From: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
> 
> 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 <graalfs@linux.vnet.ibm.com>
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

Thanks, applied to s390-next.


Alex

> ---
> hw/s390-virtio.c |    1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
> index ebec844..78477af 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;
> -- 
> 1.7.10.1
>

Patch

diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index ebec844..78477af 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;