summaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/vl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index a0c1a879ce..58a40bcfc1 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4140,6 +4140,9 @@ void qemu_init(int argc, char **argv, char **envp)
machine_opts = qemu_get_machine_opts();
qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
&error_fatal);
+ current_machine->ram_size = ram_size;
+ current_machine->maxram_size = maxram_size;
+ current_machine->ram_slots = ram_slots;
/*
* Note: uses machine properties such as kernel-irqchip, must run
@@ -4301,6 +4304,11 @@ void qemu_init(int argc, char **argv, char **envp)
backend = object_resolve_path_type(current_machine->ram_memdev_id,
TYPE_MEMORY_BACKEND, NULL);
+ if (!backend) {
+ error_report("Memory backend '%s' not found",
+ current_machine->ram_memdev_id);
+ exit(EXIT_FAILURE);
+ }
backend_size = object_property_get_uint(backend, "size", &error_abort);
if (have_custom_ram_size && backend_size != ram_size) {
error_report("Size specified by -m option must match size of "
@@ -4318,10 +4326,6 @@ void qemu_init(int argc, char **argv, char **envp)
}
}
- current_machine->ram_size = ram_size;
- current_machine->maxram_size = maxram_size;
- current_machine->ram_slots = ram_slots;
-
parse_numa_opts(current_machine);
if (machine_class->default_ram_id && current_machine->ram_size &&