Remove local ram_size that hides global one
PATCH 6/24 Remove local ram_size that hides global one
From: Heinz Graalfs <[email protected]>
The global variable 'ram_size' is hidden by the local variable declaration in s390_init()
--- hw/s390-virtio.c | 1 - 1 file changed, 1 deletion(-)
hw/s390-virtio.c +0 -1
@@ -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;
Signature · 1 line
1.7.10.1
Quoted 4 lines · Christian Borntraeger
From: Heinz Graalfs <[email protected]>
The global variable '
ram_size' is hidden by the local variable declaration ins390_init()
That's the point of Eduardo's patch, no? Or do we need access to the global to change its value afterwards? If so, please write a reasonable patch description that actually explains the problem.
Alex
Quoted 22 lines
Signed-off-by Heinz Graalfs <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>---
hw/s390-virtio.c| 1 -1 file changed, 1 deletion(-)hw/s390-virtio.c +0
-1@@ -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;Signature · 1 line
1.7.10.1
Quoted 10 lines · Alexander Graf
Quoted 4 lines · Christian Borntraeger
From: Heinz Graalfs <[email protected]>
The global variable '
ram_size' is hidden by the local variable declaration ins390_init()That's the point of Eduardo's patch, no? Or do we need access to the global to change its value afterwards?
The function later does:
/* lets propagate the changed ram size into the global variable. */
ram_size = my_ram_size;which frankly I think is pretty nasty but then we've never had a very good mechanism for specifying board-specific restrictions around the memory size.
-- PMM
Eduardo Habkost
Reviewed-byQuoted 10 lines · Alexander Graf
Quoted 4 lines · Christian Borntraeger
From: Heinz Graalfs <[email protected]>
The global variable '
ram_size' is hidden by the local variable declaration ins390_init()That's the point of Eduardo's patch, no? Or do we need access to the global to change its value afterwards? If so, please write a reasonable patch description that actually explains the problem.
Actually, I wanted to keep the existing behavior (whatever it was), and use local variables to replace the old function parameters, and change nothing else. Most machines used a local variable named 'ram_size', but the parameter to s390_init() was named 'my_ram_size'.
So, considering that this at least restores the previous behavior:
Quoted 26 lines
Alex
Quoted 22 lines
Signed-off-by Heinz Graalfs <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>---
hw/s390-virtio.c| 1 -1 file changed, 1 deletion(-)hw/s390-virtio.c +0
-1@@ -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;Signature · 1 line
1.7.10.1
Signature · 1 line
Eduardo
Quoted 12 lines · Eduardo Habkost
Quoted 10 lines · Alexander Graf
Quoted 4 lines · Christian Borntraeger
From: Heinz Graalfs <[email protected]>
The global variable '
ram_size' is hidden by the local variable declaration ins390_init()That's the point of Eduardo's patch, no? Or do we need access to the global to change its value afterwards? If so, please write a reasonable patch description that actually explains the problem.
Quoted 8 lines
Actually, I wanted to keep the existing behavior (whatever it was), and use local variables to replace the old function parameters, and change nothing else. Most machines used a local variable named '
ram_size', but the parameter tos390_init()was named 'my_ram_size'.So, considering that this at least restores the previous behavior:
Reviewed-by Eduardo Habkost <[email protected]>
Yup, Heinz, please resend with a patch description that actually tells us what the problem is.
Alex
PATCH 1/1 s390: Fix ram_size updating in machine init
From: Heinz Graalfs <[email protected]>
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)
--- hw/s390-virtio.c | 1 - 1 file changed, 1 deletion(-)
hw/s390-virtio.c +0 -1
@@ -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;
Signature · 1 line
1.7.10.1
Alexander Graf
AppliedRe: [Qemu-devel] [PATCH 1/1] s390: Fix ram_size updating in machine init
Quoted 11 lines · Christian Borntraeger
From: Heinz Graalfs <[email protected]>
The global variable '
ram_size' is hidden by the local variable declaration ins390_init(). Since we want to update the global ram size in certain cases we must not use a localram_sizevariable.
- This fixes booting with unusual ram sizes like -m 67001
- This changes behaviour back to the situation before commit5f072e1f3075bd869e0ace9f2545a85992ac0084
(create struct for machine initialization arguments)
Quoted 3 lines
Signed-off-by Heinz Graalfs <[email protected]>Reviewed-by Eduardo Habkost <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>
Thanks, applied to s390-next.
Alex
Quoted 19 lines
---
hw/s390-virtio.c| 1 -1 file changed, 1 deletion(-)hw/s390-virtio.c +0
-1@@ -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;Signature · 1 line
1.7.10.1