summaryrefslogtreecommitdiffstats
path: root/softmmu
diff options
context:
space:
mode:
authorPaolo Bonzini2022-04-14 18:53:00 +0200
committerPaolo Bonzini2022-05-12 12:29:44 +0200
commitfb56b7a052e1443409334c579e617e287a7250d3 (patch)
treefef537f1565dc41a343339c8b4842ee112672860 /softmmu
parentmachine: make memory-backend a link property (diff)
downloadqemu-fb56b7a052e1443409334c579e617e287a7250d3.tar.gz
qemu-fb56b7a052e1443409334c579e617e287a7250d3.tar.xz
qemu-fb56b7a052e1443409334c579e617e287a7250d3.zip
machine: move more memory validation to Machine object
This allows setting memory properties without going through vl.c, and have them validated just the same. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220414165300.555321-6-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/vl.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index f6deec9380..edba74f075 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2027,24 +2027,13 @@ static void qemu_resolve_machine_memdev(void)
error_report("Memory backend '%s' not found", ram_memdev_id);
exit(EXIT_FAILURE);
}
- backend_size = object_property_get_uint(backend, "size", &error_abort);
- if (have_custom_ram_size && backend_size != current_machine->ram_size) {
- error_report("Size specified by -m option must match size of "
- "explicitly specified 'memory-backend' property");
- exit(EXIT_FAILURE);
+ if (!have_custom_ram_size) {
+ backend_size = object_property_get_uint(backend, "size", &error_abort);
+ current_machine->ram_size = backend_size;
}
- current_machine->ram_size = backend_size;
object_property_set_link(OBJECT(current_machine),
"memory-backend", backend, &error_fatal);
}
-
- if (!xen_enabled()) {
- /* On 32-bit hosts, QEMU is limited by virtual address space */
- if (current_machine->ram_size > (2047 << 20) && HOST_LONG_BITS == 32) {
- error_report("at most 2047 MB RAM can be simulated");
- exit(1);
- }
- }
}
static void parse_memory_options(const char *arg)