qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 2/4] nvdimm: add functions to initialize and


From: Xiao Guangrong
Subject: Re: [Qemu-devel] [RFC PATCH 2/4] nvdimm: add functions to initialize and perform flush on back store
Date: Thu, 6 Apr 2017 19:52:25 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0



On 03/31/2017 04:41 PM, Haozhong Zhang wrote:
fsync() is used to persist modifications to the back store. If the
host NVDIMM is used as the back store, fsync() on Linux will trigger
the write to the host flush hint address.

Signed-off-by: Haozhong Zhang <address@hidden>
---
 hw/mem/nvdimm.c         | 22 ++++++++++++++++++++++
 include/hw/mem/nvdimm.h | 13 +++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index db896b0..484ab8b 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -78,6 +78,26 @@ static MemoryRegion *nvdimm_get_memory_region(PCDIMMDevice 
*dimm)
     return &nvdimm->nvdimm_mr;
 }

+static void nvdimm_flush_init(NVDIMMDevice *nvdimm, MemoryRegion *hostmem_mr)
+{
+    if (nvdimm->flush_hint_enabled) {
+        nvdimm->backend_fd = memory_region_get_fd(hostmem_mr);

Hmm, IIRC host-mem-file does not initalize backend_fd at all.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]