[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/86] machine: introduce ram-memdev property
From: |
Igor Mammedov |
Subject: |
[PATCH 04/86] machine: introduce ram-memdev property |
Date: |
Tue, 31 Dec 2019 14:02:48 +0100 |
Property will contain link to memory backend that will be
used for backing initial RAM.
Follow up commit will alias -mem-path and -mem-prealloc
CLI options into memory backend options to make memory
handling consistent (using only hostmem backend family
for guest RAM allocation).
Signed-off-by: Igor Mammedov <address@hidden>
---
include/hw/boards.h | 2 ++
hw/core/machine.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 61f8bb8..8e2bf2b 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -4,6 +4,7 @@
#define HW_BOARDS_H
#include "exec/memory.h"
+#include "sysemu/hostmem.h"
#include "sysemu/blockdev.h"
#include "sysemu/accel.h"
#include "qapi/qapi-types-machine.h"
@@ -288,6 +289,7 @@ struct MachineState {
bool enforce_config_section;
bool enable_graphics;
char *memory_encryption;
+ HostMemoryBackend *ram_memdev;
DeviceMemoryState *device_memory;
ram_addr_t ram_size;
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 73bf1f8..4a5cd0d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -847,6 +847,15 @@ static void machine_initfn(Object *obj)
ms->numa_state = g_new0(NumaState, 1);
}
+ object_property_add_link(obj, "ram-memdev", TYPE_MEMORY_BACKEND,
+ (Object **)&ms->ram_memdev,
+ object_property_allow_set_link,
+ OBJ_PROP_LINK_STRONG, &error_abort);
+ object_property_set_description(obj, "ram-memdev",
+ "Set RAM backend"
+ "Valid value is ID of hostmem based
backend",
+ &error_abort);
+
/* Register notifier when init is done for sysbus sanity checks */
ms->sysbus_notifier.notify = machine_init_notify;
qemu_add_machine_init_done_notifier(&ms->sysbus_notifier);
--
2.7.4
- [PATCH 00/86] refactor main RAM allocation to use hostmem backend, Igor Mammedov, 2019/12/31
- [PATCH 02/86] numa: properly check if numa is supported, Igor Mammedov, 2019/12/31
- [PATCH 03/86] numa: remove deprecated -mem-path fallback to anonymous RAM, Igor Mammedov, 2019/12/31
- [PATCH 04/86] machine: introduce ram-memdev property,
Igor Mammedov <=
- [PATCH 01/86] numa: remove not needed check, Igor Mammedov, 2019/12/31
- [PATCH 05/86] machine: alias -mem-path and -mem-prealloc into memory-foo backend, Igor Mammedov, 2019/12/31
- [PATCH 06/86] machine: introduce convenience MachineState::ram, Igor Mammedov, 2019/12/31
- [PATCH 07/86] initialize MachineState::ram in NUMA case, Igor Mammedov, 2019/12/31
- [PATCH 11/86] hw:aspeed: drop warning and bogus ram_size fixup, Igor Mammedov, 2019/12/31
- [PATCH 08/86] alpha:dp264: use memdev for RAM, Igor Mammedov, 2019/12/31
- [PATCH 09/86] arm:aspeed: convert valid RAM sizes to data, Igor Mammedov, 2019/12/31
- [PATCH 10/86] arm:aspeed: actually check RAM size, Igor Mammedov, 2019/12/31
- [PATCH 12/86] arm:aspeed: use memdev for RAM, Igor Mammedov, 2019/12/31