From 900c0ba373aada4c13d47d95330aa72ec4067ba5 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Wed, 19 Feb 2020 11:08:37 -0500 Subject: machine: alias -mem-path and -mem-prealloc into memory-foo backend Allow machine to opt in for hostmem backend based initial RAM even if user uses old -mem-path/prealloc options by providing MachineClass::default_ram_id Follow up patches will incrementally convert machines to new API, by dropping memory_region_allocate_system_memory() and setting default_ram_id that board used to use before conversion to keep migration stream the same. Signed-off-by: Igor Mammedov Message-Id: <20200219160953.13771-4-imammedo@redhat.com> --- include/sysemu/hostmem.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/sysemu') diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index 4dbdadd39e..5db0d668ec 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -27,6 +27,22 @@ #define MEMORY_BACKEND_CLASS(klass) \ OBJECT_CLASS_CHECK(HostMemoryBackendClass, (klass), TYPE_MEMORY_BACKEND) +/* hostmem-ram.c */ +/** + * @TYPE_MEMORY_BACKEND_RAM: + * name of backend that uses mmap on the anonymous RAM + */ + +#define TYPE_MEMORY_BACKEND_RAM "memory-backend-ram" + +/* hostmem-file.c */ +/** + * @TYPE_MEMORY_BACKEND_FILE: + * name of backend that uses mmap on a file descriptor + */ +#define TYPE_MEMORY_BACKEND_FILE "memory-backend-file" + +typedef struct HostMemoryBackend HostMemoryBackend; typedef struct HostMemoryBackendClass HostMemoryBackendClass; /** -- cgit v1.2.3