mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
hostmem-file: add the 'pmem' option
When QEMU emulates vNVDIMM labels and migrates vNVDIMM devices, it needs to know whether the backend storage is a real persistent memory, in order to decide whether special operations should be performed to ensure the data persistence. This boolean option 'pmem' allows users to specify whether the backend storage of memory-backend-file is a real persistent memory. If 'pmem=on', QEMU will set the flag RAM_PMEM in the RAM block of the corresponding memory region. If 'pmem' is set while lack of libpmem support, a error is generated. Signed-off-by: Junyan He <junyan.he@intel.com> Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
17824406fa
commit
a4de8552b2
6 changed files with 85 additions and 2 deletions
|
@ -123,6 +123,9 @@ typedef struct IOMMUNotifier IOMMUNotifier;
|
|||
/* RAM can be migrated */
|
||||
#define RAM_MIGRATABLE (1 << 4)
|
||||
|
||||
/* RAM is a persistent kind memory */
|
||||
#define RAM_PMEM (1 << 5)
|
||||
|
||||
static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,
|
||||
IOMMUNotifierFlag flags,
|
||||
hwaddr start, hwaddr end,
|
||||
|
@ -654,6 +657,7 @@ void memory_region_init_resizeable_ram(MemoryRegion *mr,
|
|||
* (getpagesize()) will be used.
|
||||
* @ram_flags: Memory region features:
|
||||
* - RAM_SHARED: memory must be mmaped with the MAP_SHARED flag
|
||||
* - RAM_PMEM: the memory is persistent memory
|
||||
* Other bits are ignored now.
|
||||
* @path: the path in which to allocate the RAM.
|
||||
* @errp: pointer to Error*, to store an error if it happens.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue