[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 18/33] dimm: get mapped memory region from DIMMDe
From: |
Xiao Guangrong |
Subject: |
[Qemu-devel] [PATCH v6 18/33] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region |
Date: |
Fri, 30 Oct 2015 13:56:12 +0800 |
Curretly, the memory region of backed memory is directly mapped to
guest's address space, however, it is not true for nvdimm device
This patch let dimm device realize this fact and use
DIMMDeviceClass->get_memory_region method to get the mapped memory
region
Signed-off-by: Xiao Guangrong <address@hidden>
---
hw/mem/dimm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/mem/dimm.c b/hw/mem/dimm.c
index 4a63409..498d380 100644
--- a/hw/mem/dimm.c
+++ b/hw/mem/dimm.c
@@ -377,8 +377,9 @@ static void dimm_get_size(Object *obj, Visitor *v, void
*opaque,
int64_t value;
MemoryRegion *mr;
DIMMDevice *dimm = DIMM(obj);
+ DIMMDeviceClass *ddc = DIMM_GET_CLASS(obj);
- mr = host_memory_backend_get_memory(dimm->hostmem, errp);
+ mr = ddc->get_memory_region(dimm);
value = memory_region_size(mr);
visit_type_int(v, &value, name, errp);
--
1.8.3.1
- Re: [Qemu-devel] [PATCH v6 09/33] exec: allow file_ram_alloc to work on file, (continued)
- [Qemu-devel] [PATCH v6 13/33] pc-dimm: make pc_existing_dimms_capacity static and rename it, Xiao Guangrong, 2015/10/30
- [Qemu-devel] [PATCH v6 15/33] stubs: rename qmp_pc_dimm_device_list.c, Xiao Guangrong, 2015/10/30
- [Qemu-devel] [PATCH v6 14/33] pc-dimm: drop the prefix of pc-dimm, Xiao Guangrong, 2015/10/30
- [Qemu-devel] [PATCH v6 18/33] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region,
Xiao Guangrong <=
- [Qemu-devel] [PATCH v6 16/33] pc-dimm: rename pc-dimm.c and pc-dimm.h, Xiao Guangrong, 2015/10/30
- [Qemu-devel] [PATCH v6 19/33] dimm: keep the state of the whole backend memory, Xiao Guangrong, 2015/10/30
- [Qemu-devel] [PATCH v6 17/33] dimm: abstract dimm device from pc-dimm, Xiao Guangrong, 2015/10/30
- [Qemu-devel] [PATCH v6 20/33] dimm: introduce realize callback, Xiao Guangrong, 2015/10/30