summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorJunyan He2018-07-18 09:48:00 +0200
committerMichael S. Tsirkin2018-08-10 12:29:39 +0200
commita4de8552b2580adf6fa4874439217b65d3bdd88b (patch)
tree0cfd280873e9c1a616d17d88a06bc9f32863e2d4 /exec.c
parentconfigure: add libpmem support (diff)
downloadqemu-a4de8552b2580adf6fa4874439217b65d3bdd88b.tar.gz
qemu-a4de8552b2580adf6fa4874439217b65d3bdd88b.tar.xz
qemu-a4de8552b2580adf6fa4874439217b65d3bdd88b.zip
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>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 3b8f91448d..fa3fbc6646 100644
--- a/exec.c
+++ b/exec.c
@@ -2245,6 +2245,9 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
Error *local_err = NULL;
int64_t file_size;
+ /* Just support these ram flags by now. */
+ assert((ram_flags & ~(RAM_SHARED | RAM_PMEM)) == 0);
+
if (xen_enabled()) {
error_setg(errp, "-mem-path not supported with Xen");
return NULL;
@@ -4072,6 +4075,11 @@ err:
return ret;
}
+bool ramblock_is_pmem(RAMBlock *rb)
+{
+ return rb->flags & RAM_PMEM;
+}
+
#endif
void page_size_init(void)