aboutsummaryrefslogtreecommitdiff
path: root/softmmu/vl.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2020-05-11 10:11:02 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-06-10 12:09:34 -0400
commit59d55a16edfac087248dc60dd9525bdfcc057bb1 (patch)
tree2562537138650d49d818eb5cc618817283b23fc1 /softmmu/vl.c
parentfbb84f074174aa3bb6fde4a63b569a1f7e64f264 (diff)
downloadqemu-59d55a16edfac087248dc60dd9525bdfcc057bb1.zip
qemu-59d55a16edfac087248dc60dd9525bdfcc057bb1.tar.gz
qemu-59d55a16edfac087248dc60dd9525bdfcc057bb1.tar.bz2
vl.c: run preconfig loop before creating default RAM backend
Default RAM backend depends on numa_uses_legacy_mem(), which is infulenced by -numa options on CLI or set-numa-node QMP command at preconfig time. If QEMU is started with '-preconfig' without -numa, it will lead to creating default RAM backend even if later set-numa-node is used to assing RAM to NUMA nodes using 'memdev' NUMA option. That at best will waste RAM object created by default and with next patch adding a check to prevent usage of conflicting '-M memory-backend' and '-numa memdev' options, it will make QEMU error out if user tries to configure NUMA at preconfig time with memdev option, making set-numa-node unusable. To fix issue, move preconfig loop before default RAM backend is created, so that numa_uses_legacy_mem() would take into account effects of set-numa-node commands executed at preconfig time. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20200511141103.43768-2-imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu/vl.c')
-rw-r--r--softmmu/vl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 05d1a4c..055472d 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4334,12 +4334,13 @@ void qemu_init(int argc, char **argv, char **envp)
parse_numa_opts(current_machine);
+ /* do monitor/qmp handling at preconfig state if requested */
+ qemu_main_loop();
+
if (machine_class->default_ram_id && current_machine->ram_size &&
numa_uses_legacy_mem() && !current_machine->ram_memdev_id) {
create_default_memdev(current_machine, mem_path);
}
- /* do monitor/qmp handling at preconfig state if requested */
- qemu_main_loop();
audio_init_audiodevs();