[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/12] vl: allow 'maxmem' without 'slot'
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 11/12] vl: allow 'maxmem' without 'slot' |
Date: |
Mon, 7 May 2018 14:03:14 -0300 |
From: David Hildenbrand <address@hidden>
We will be able to have memory devices (e.g. virtio) not requiring the
slot parameter (e.g. not exposed via ACPI). We still need the maxmem
parameter to setup a proper memory region for device memory. And some
architectures (e.g. s390x) will have to set up the maximum possible guest
address space size based on the maxmem parameter.
As far as I can see, all code (pc.c,spapr.c,ACPI code) should handle
!slots just fine, even though maxmem is set.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
vl.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/vl.c b/vl.c
index 806eec2ef6..12e31d1aa9 100644
--- a/vl.c
+++ b/vl.c
@@ -2868,7 +2868,6 @@ static void set_memory_options(uint64_t *ram_slots,
ram_addr_t *maxram_size,
{
uint64_t sz;
const char *mem_str;
- const char *maxmem_str, *slots_str;
const ram_addr_t default_ram_size = mc->default_ram_size;
QemuOpts *opts = qemu_find_opts_singleton("memory");
Location loc;
@@ -2914,9 +2913,7 @@ static void set_memory_options(uint64_t *ram_slots,
ram_addr_t *maxram_size,
qemu_opt_set_number(opts, "size", ram_size, &error_abort);
*maxram_size = ram_size;
- maxmem_str = qemu_opt_get(opts, "maxmem");
- slots_str = qemu_opt_get(opts, "slots");
- if (maxmem_str && slots_str) {
+ if (qemu_opt_get(opts, "maxmem")) {
uint64_t slots;
sz = qemu_opt_get_size(opts, "maxmem", 0);
@@ -2927,13 +2924,7 @@ static void set_memory_options(uint64_t *ram_slots,
ram_addr_t *maxram_size,
"the initial memory size (0x" RAM_ADDR_FMT ")",
sz, ram_size);
exit(EXIT_FAILURE);
- } else if (sz > ram_size) {
- if (!slots) {
- error_report("invalid value of -m option: maxmem was "
- "specified, but no hotplug slots were specified");
- exit(EXIT_FAILURE);
- }
- } else if (slots) {
+ } else if (slots && sz == ram_size) {
error_report("invalid value of -m option maxmem: "
"memory slots were specified but maximum memory size "
"(0x%" PRIx64 ") is equal to the initial memory size "
@@ -2943,10 +2934,8 @@ static void set_memory_options(uint64_t *ram_slots,
ram_addr_t *maxram_size,
*maxram_size = sz;
*ram_slots = slots;
- } else if ((!maxmem_str && slots_str) ||
- (maxmem_str && !slots_str)) {
- error_report("invalid -m option value: missing "
- "'%s' option", slots_str ? "maxmem" : "slots");
+ } else if (qemu_opt_get(opts, "slots")) {
+ error_report("invalid -m option value: missing 'maxmem' option");
exit(EXIT_FAILURE);
}
--
2.14.3
- [Qemu-devel] [PULL 02/12] machine: make MemoryHotplugState accessible via the machine, (continued)
- [Qemu-devel] [PULL 02/12] machine: make MemoryHotplugState accessible via the machine, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 04/12] pc-dimm: pass in the machine and to the MemoryHotplugState, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 03/12] pc-dimm: no need to pass the memory region, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 06/12] pc-dimm: factor out capacity and slot checks into MemoryDevice, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 05/12] pc-dimm: factor out address search into MemoryDevice code, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 07/12] pc-dimm: move actual plug/unplug of a memory region to MemoryDevice, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 08/12] machine: rename MemoryHotplugState to DeviceMemoryState, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 09/12] pc: rename "hotplug memory" terminology to "device memory", Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 10/12] spapr: rename "hotplug memory" terminology to "device memory", Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 12/12] scripts/device-crash-test: Removed fixed CAN entries, Eduardo Habkost, 2018/05/07
- [Qemu-devel] [PULL 11/12] vl: allow 'maxmem' without 'slot',
Eduardo Habkost <=
- Re: [Qemu-devel] [PULL 00/12] Machine queue, 2018-05-07, Peter Maydell, 2018/05/08