Skip to contentSkip to conversation

pc: fix qemu exiting with error when -m X < 128 with old machines types

PATCH Applied Igor Mammedov 4 participants 5 messages Jul 8, 2014 – Jul 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc: fix qemu exiting with error when -m X < 128 with old machines types

If machine doesn't support memory hotplug then staring QEMU with initial memory less than default will make QEMU exit with following error message:

$QEMU -m 16 -M isapc
qemu-system-i386: "-memory 'slots|maxmem'" is not supported by: isapc

Set maxram_size to initial memory value before parsing 'maxmem' option allows to keep maxmem in sync with initial memory size if no maxmem option was specified.

---
 vl.c | 1 +
 1 file changed, 1 insertion(+)
vl.c +1 -0
index 6e084c2..6abedcf 100644
@@ -3315,6 +3315,7 @@ int main(int argc, char **argv, char **envp)
                     error_report("ram size too large");
                     exit(EXIT_FAILURE);
                 }
+                maxram_size = ram_size;
 
                 maxmem_str = qemu_opt_get(opts, "maxmem");
                 slots_str = qemu_opt_get(opts, "slots");
Signature · 1 line
1.8.5.2 (Apple Git-48)
#1 lore raw
Quoted 7 lines · Igor Mammedov

If machine doesn't support memory hotplug then staring QEMU with initial memory less than default will make QEMU exit with following error message:

$QEMU -m 16 -M isapc
qemu-system-i386: "-memory 'slots|maxmem'" is not supported by: isapc

Quoted 6 lines

Set maxram_size to initial memory value before parsing 'maxmem' option allows to keep maxmem in sync with initial memory size if no maxmem option was specified.

OK this is a regression fix so we need it for 2.1.

Applied, thanks!

Quoted 18 lines
---
 vl.c | 1 +
 1 file changed, 1 insertion(+)
vl.c +1 -0
index 6e084c2..6abedcf 100644
@@ -3315,6 +3315,7 @@ int main(int argc, char **argv, char **envp)
                     error_report("ram size too large");
                     exit(EXIT_FAILURE);
                 }
+                maxram_size = ram_size;
 
                 maxmem_str = qemu_opt_get(opts, "maxmem");
                 slots_str = qemu_opt_get(opts, "slots");
Signature · 1 line
1.8.5.2 (Apple Git-48)
#2 lore raw
Quoted 34 lines
Quoted 1 line
Quoted 1 line · On 7/11/2014 at 12:06 PM, <[email protected]> wrote:
Quoted 7 lines · Igor Mammedov

If machine doesn't support memory hotplug then staring QEMU with initial memory less than default will make QEMU exit with following error message:

$QEMU -m 16 -M isapc
qemu-system-i386: "-memory 'slots|maxmem'" is not supported by: isapc

Quoted 6 lines

Set maxram_size to initial memory value before parsing 'maxmem' option allows to keep maxmem in sync with initial memory size if no maxmem option was specified.

OK this is a regression fix so we need it for 2.1.

Applied, thanks!

Quoted 14 lines
---
 vl.c | 1 +
 1 file changed, 1 insertion(+)
vl.c +1 -0
index 6e084c2..6abedcf 100644
@@ -3315,6 +3315,7 @@ int main(int argc, char **argv, char **envp)
                     error_report("ram size too large");
                     exit(EXIT_FAILURE);
                 }
+                maxram_size = ram_size;
 
Quoted 4 lines
Quoted 4 lines
vl.c +0 -0
                 maxmem_str = qemu_opt_get(opts, "maxmem");
                 slots_str = qemu_opt_get(opts, "slots");
Signature · 1 line
1.8.5.2 (Apple Git-48)

Hopefully this hasn't been forgotten. This is a bad regression for pre v2.1 pc machine types.

Bruce

Reviewed-by on v1 1/1
#3 lore raw
In reply to Igor Mammedov
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 7/8/2014 at 07:29 AM, <[email protected]> wrote:

If machine doesn't support memory hotplug then staring QEMU with initial memory less than default will make QEMU exit with following error message:

$QEMU -m 16 -M isapc
qemu-system-i386: "-memory 'slots|maxmem'" is not supported by: isapc

Set maxram_size to initial memory value before parsing 'maxmem' option allows to keep maxmem in sync with initial memory size if no maxmem option was specified.

---
 vl.c | 1 +
 1 file changed, 1 insertion(+)
vl.c +0 -0
index 6e084c2..6abedcf 100644

vl.c int main(int argc, char **argv, char **envp) · line 3321

Quoted 7 lines
vl.c +1 -0
@@ -3315,6 +3315,7 @@ int main(int argc, char **argv, char **envp)
                     error_report("ram size too large");
                     exit(EXIT_FAILURE);
                 }
+                maxram_size = ram_size;
 
                 maxmem_str = qemu_opt_get(opts, "maxmem");
                 slots_str = qemu_opt_get(opts, "slots");
#4 lore raw
Quoted 28 lines · Bruce Rogers
Quoted 28 lines
Quoted 1 line
Quoted 1 line · On 7/8/2014 at 07:29 AM, <[email protected]> wrote:

If machine doesn't support memory hotplug then staring QEMU with initial memory less than default will make QEMU exit with following error message:

$QEMU -m 16 -M isapc
qemu-system-i386: "-memory 'slots|maxmem'" is not supported by: isapc

Set maxram_size to initial memory value before parsing 'maxmem' option allows to keep maxmem in sync with initial memory size if no maxmem option was specified.

---
 vl.c | 1 +
 1 file changed, 1 insertion(+)
vl.c +1 -0
index 6e084c2..6abedcf 100644
@@ -3315,6 +3315,7 @@ int main(int argc, char **argv, char **envp)
                     error_report("ram size too large");
                     exit(EXIT_FAILURE);
                 }
+                maxram_size = ram_size;
 
Quoted 5 lines

vl.c int main(int argc, char **argv, char **envp) · line 3321

Quoted 2 lines
vl.c +0 -0
                 maxmem_str = qemu_opt_get(opts, "maxmem");
                 slots_str = qemu_opt_get(opts, "slots");

Applied to master, thanks.

-- PMM