diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-08-05 12:01:51 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-08-08 12:57:31 +0200 |
commit | e12f0685e8f6ee57a00d3f304023665aa0e02b8c (patch) | |
tree | 81b17363c5d23a728a57ad295a7fdd10de179ae2 /disas | |
parent | 55794c904df723109b228da28b5db778e0df3110 (diff) |
vl: fix [memory] section with -readconfig
The -M memory.* options do not have magic applied to them like the -m
option, namely no "M" (for mebibytes) is tacked at the end of a suffixless
value for "-M memory.size".
This magic is performed by parse_memory_options, and we have to do it for
both "-m" and the [memory] section of a config file. Storing [memory]
sections directly to machine_opts_dict changed the meaning of
[memory]
size = "1024"
in a -readconfig file from 1024MiB to 8KiB (1024 Bytes rounded up to
8KiB silently). To avoid this, the [memory] section has to be changed
back to QemuOpts (combining [memory] and "-m" will work fine thanks to
.merge_lists being true).
Change parse_memory_options() so that, similar to the older function
set_memory_options(), it operates after command line parsing is done;
and also call it where set_memory_options() used to be.
Note, the parsing code uses exit(1) instead of exit(EXIT_FAILURE) to
match neighboring code.
Reported-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Fixes: ce9d03fb3f ("machine: add mem compound property", 2022-05-12)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'disas')
0 files changed, 0 insertions, 0 deletions