[Qemu-devel] [PATCH V13 5/5] docs: Added MAP_SYNC documentation

2019-02-07 Thread Zhang, Yi
From: Zhang Yi Signed-off-by: Zhang Yi --- docs/nvdimm.txt | 22 +++--- qemu-options.hx | 5 + 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 5f158a6..e70f28b 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt

[Qemu-devel] [PATCH V13 5/5] docs: Added MAP_SYNC documentation

2019-02-07 Thread Zhang, Yi
From: Zhang Yi Signed-off-by: Zhang Yi --- docs/nvdimm.txt | 25 ++--- qemu-options.hx | 5 + 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 5f158a6..a168429 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt

[Qemu-devel] [PATCH V13 4/5] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2019-02-07 Thread Zhang, Yi
From: Zhang Yi When a file supporting DAX is used as vNVDIMM backend, mmap it with MAP_SYNC flag in addition which can ensure file system metadata synced in each guest writes to the backend file, without other QEMU actions (e.g., periodic fsync() by QEMU). Current, We have below different

[Qemu-devel] [PATCH V13 2/5] scripts/update-linux-headers: add linux/mman.h

2019-02-07 Thread Zhang, Yi
From: Zhang Yi Add linux/mman.h,asm/mman.h,asm/mman-common.h to linux-headers, So we can use more mmap2 flags. Signed-off-by: Zhang Yi --- scripts/update-linux-headers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update

[Qemu-devel] [PATCH V13 1/5] util/mmap-alloc: Add a 'is_pmem' parameter to qemu_ram_mmap

2019-02-07 Thread Zhang, Yi
From: Zhang Yi besides the existing 'shared' flags, we are going to add 'is_pmem' to qemu_ram_mmap(), which indicated the memory backend file is a persist memory. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi Reviewed-by: Pankaj Gupta --- exec.c

[Qemu-devel] [PATCH V13 3/5] linux-headers: add linux/mman.h.

2019-02-07 Thread Zhang, Yi
From: Zhang Yi Update it to 4.20-rc1 Signed-off-by: Zhang Yi --- linux-headers/asm-arm/mman.h | 4 ++ linux-headers/asm-arm64/mman.h | 1 + linux-headers/asm-generic/hugetlb_encode.h | 36 ++ linux-headers/asm-generic/mman-common.h| 77

[Qemu-devel] [PATCH V13 0/5] support MAP_SYNC for memory-backend-file

2019-02-07 Thread Zhang, Yi
elp user to identify the error. (Dr. David Alan Gilbert) * Patch 3: fix typo in the commit message. (Dr. David Alan Gilbert) Changes in v2: * Add 'sync' option to control the use of MAP_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and

[Qemu-devel] [PATCH V12 2/5] scripts/update-linux-headers: add linux/mman.h

2019-02-06 Thread Zhang, Yi
From: Zhang Yi Add linux/mman.h,asm/mman.h,asm/mman-common.h to linux-headers, So we can use more mmap2 flags. Signed-off-by: Zhang Yi --- scripts/update-linux-headers.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update

[Qemu-devel] [PATCH V12 0/5] support MAP_SYNC for memory-backend-file

2019-02-06 Thread Zhang, Yi
Add 'sync' option to control the use of MAP_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qemu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to osdep.h. (Mich

[Qemu-devel] [PATCH V12 1/5] util/mmap-alloc: Add a 'is_pmem' parameter to qemu_ram_mmap

2019-02-06 Thread Zhang, Yi
From: Zhang Yi besides the existing 'shared' flags, we are going to add 'is_pmem' to qemu_ram_mmap(), which indicated the memory backend file is a persist memory. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c| 2 +- include/qe

[Qemu-devel] [PATCH V12 3/5] linux-headers: add linux/mman.h.

2019-02-06 Thread Zhang, Yi
From: Zhang Yi Update it to 4.20-rc1 Signed-off-by: Zhang Yi --- linux-headers/asm-arm/mman.h | 4 ++ linux-headers/asm-arm64/mman.h | 1 + linux-headers/asm-generic/hugetlb_encode.h | 36 ++ linux-headers/asm-generic/mman-common.h| 77

[Qemu-devel] [PATCH V12 5/5] docs: Added MAP_SYNC documentation

2019-02-06 Thread Zhang, Yi
From: Zhang Yi Signed-off-by: Zhang Yi --- docs/nvdimm.txt | 25 ++--- qemu-options.hx | 4 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 5f158a6..e2bf89f 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt

[Qemu-devel] [PATCH V12 4/5] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2019-02-06 Thread Zhang, Yi
From: Zhang Yi When a file supporting DAX is used as vNVDIMM backend, mmap it with MAP_SYNC flag in addition which can ensure file system metadata synced in each guest writes to the backend file, without other QEMU actions (e.g., periodic fsync() by QEMU). Current, We have below different

[Qemu-devel] [PATCH v11 2/3] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2019-01-28 Thread Zhang, Yi
From: Zhang Yi When a file supporting DAX is used as vNVDIMM backend, mmap it with MAP_SYNC flag in addition which can ensure file system metadata synced in each guest writes to the backend file, without other QEMU actions (e.g., periodic fsync() by QEMU). Current, We have below different

[Qemu-devel] [PATCH v11 1/3] util/mmap-alloc: Add a 'is_pmem' parameter to qemu_ram_mmap

2019-01-28 Thread Zhang, Yi
From: Zhang Yi besides the existing 'shared' flags, we are going to add 'is_pmem' to qemu_ram_mmap(), which indicated the memory backend file is a persist memory. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c| 2 +- include/qe

[Qemu-devel] [PATCH v11 3/3] docs: Added MAP_SYNC documentation

2019-01-28 Thread Zhang, Yi
From: Zhang Yi Signed-off-by: Zhang Yi --- docs/nvdimm.txt | 29 - qemu-options.hx | 4 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 5f158a6..9da96aa 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt

[Qemu-devel] [PATCH v11 0/3] support MAP_SYNC for memory-backend-file

2019-01-28 Thread Zhang, Yi
P_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qemu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to osdep.h. (Michael S. Tsirkin) Zhang Yi (3): util/mmap-all

[Qemu-devel] [PATCH V10 0/4] support MAP_SYNC for memory-backend-file

2019-01-22 Thread Zhang, Yi
From: "Zhang,Yi" Linux 4.15 introduces a new mmap flag MAP_SYNC, which can be used to guarantee the write persistence to mmap'ed files supporting DAX (e.g., files on ext4/xfs file system mounted with '-o dax'). A description of MAP_SYNC and MAP_SHARED_VALIDATE

[Qemu-devel] [PATCH V10 1/4] util/mmap-alloc: switch 'shared' to 'flags' parameter

2019-01-22 Thread Zhang, Yi
From: Zhang Yi As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap() and qemu_ram_alloc_from_{file,fd}(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haoz

[Qemu-devel] [PATCH V10 2/4] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2019-01-22 Thread Zhang, Yi
From: Zhang Yi When a file supporting DAX is used as vNVDIMM backend, mmap it with MAP_SYNC flag in addition which can ensure file system metadata synced in each guest writes to the backend file, without other QEMU actions (e.g., periodic fsync() by QEMU). Current, We have below different

[Qemu-devel] [PATCH V10 4/4] docs: Added MAP_SYNC documentation

2019-01-22 Thread Zhang, Yi
From: Zhang Yi Signed-off-by: Zhang Yi --- docs/nvdimm.txt | 29 - qemu-options.hx | 4 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 5f158a6..166c395 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt

[Qemu-devel] [PATCH V10 3/4] hostmem: add more information in error messages

2019-01-22 Thread Zhang, Yi
From: Zhang Yi When there are multiple memory backends in use, including the object type name and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi Reviewed-by: Eduardo Habkost Reviewed-by: Stefano Garzarella

[Qemu-devel] [PATCH V9 5/6] hostmem: add more information in error messages

2019-01-16 Thread Zhang Yi
When there are multiple memory backends in use, including the object type name and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi Reviewed-by: Eduardo Habkost --- backends/hostmem-file.c | 6 -- backends

[Qemu-devel] [PATCH V9 3/6] util/mmap-alloc: switch 'shared' to 'flags' parameter

2019-01-16 Thread Zhang Yi
As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap() and qemu_ram_alloc_from_{file,fd}(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang S

[Qemu-devel] [PATCH V9 6/6] docs: Added MAP_SYNC documentation

2019-01-16 Thread Zhang Yi
Signed-off-by: Zhang Yi --- docs/nvdimm.txt | 21 - qemu-options.hx | 4 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt index 5f158a6..565ba73 100644 --- a/docs/nvdimm.txt +++ b/docs/nvdimm.txt @@ -142,11 +142,30

[Qemu-devel] [PATCH V9 4/6] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2019-01-16 Thread Zhang Yi
When a file supporting DAX is used as vNVDIMM backend, mmap it with MAP_SYNC flag in addition which can ensure file system metadata synced in each guest writes to the backend file, without other QEMU actions (e.g., periodic fsync() by QEMU). Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi

[Qemu-devel] [PATCH V9 2/6] memory: use sparse feature define RAM_FLAG.

2019-01-16 Thread Zhang Yi
Signed-off-by: Zhang Yi Signed-off-by: Michael S. Tsirkin --- include/exec/memory.h | 12 ++-- include/qemu/osdep.h | 9 + 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 667466b..03824d9 100644 --- a/include

[Qemu-devel] [PATCH V9 1/6] numa: Fixed the memory leak of numa error message

2019-01-16 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Signed-off-by: Zhang Yi Reviewed-by: Pankaj gupta Reviewed-by: Igor Mammedov Reviewed-by: Eduardo Habkost --- numa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/numa.c b/numa.c index 50ec016

[Qemu-devel] [PATCH V9 0/6] support MAP_SYNC for memory-backend-file

2019-01-16 Thread Zhang Yi
error. (Dr. David Alan Gilbert) * Patch 3: fix typo in the commit message. (Dr. David Alan Gilbert) Changes in v2: * Add 'sync' option to control the use of MAP_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qe

[Qemu-devel] [PATCH V8 5/5] hostmem-file: add 'sync' option

2019-01-01 Thread Zhang Yi
ss MAP_SYNC to mmap(2) Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 28 docs/nvdimm.txt | 23 ++- exec.c| 2 +- include/exec/memory.h | 4 include/exec/ram_addr

[Qemu-devel] [PATCH V8 2/5] util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter

2019-01-01 Thread Zhang Yi
As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi

[Qemu-devel] [PATCH V8 3/5] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2019-01-01 Thread Zhang Yi
When a file supporting DAX is used as vNVDIMM backend, mmap it with MAP_SYNC flag in addition which can ensure file system metadata synced in each guest writes to the backend file, without other QEMU actions (e.g., periodic fsync() by QEMU). Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi

[Qemu-devel] [PATCH V8 4/5] hostmem: add more information in error messages

2019-01-01 Thread Zhang Yi
When there are multiple memory backends in use, including the object type name, ID and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 6 -- backends/hostmem.c | 8

[Qemu-devel] [PATCH V8 1/5] numa: Fixed the memory leak of numa error message

2019-01-01 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Signed-off-by: Zhang Yi Reviewed-by: Pankaj gupta Reviewed-by: Igor Mammedov --- numa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/numa.c b/numa.c index 50ec016..3875e1e 100644 --- a/numa.c

[Qemu-devel] [PATCH V8 0/5] support MAP_SYNC for memory-backend-file

2019-01-01 Thread Zhang Yi
anges in v2: * Add 'sync' option to control the use of MAP_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qemu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to

[Qemu-devel] [PATCH V7 5/6] hostmem: add more information in error messages

2018-12-18 Thread Zhang Yi
When there are multiple memory backends in use, including the object type name, ID and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 6 -- backends/hostmem.c | 8

[Qemu-devel] [PATCH V7 6/6] hostmem-file: add 'sync' option

2018-12-18 Thread Zhang Yi
ported and 'share=on' 'pmem=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 39 +++ docs/nvdimm.txt |

[Qemu-devel] [PATCH V7 1/6] numa: Fixed the memory leak of numa error message

2018-12-18 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Signed-off-by: Zhang Yi Reviewed-by: Pankaj gupta Reviewed-by: Igor Mammedov --- numa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/numa.c b/numa.c index 50ec016..3875e1e 100644 --- a/numa.c

[Qemu-devel] [PATCH V7 4/6] util/mmap-alloc: Switch the RAM_SYNC flags to OnOffAuto

2018-12-18 Thread Zhang Yi
Signed-off-by: Zhang Yi A set of RAM_SYNC_ON_OFF_AUTO{AUTO,ON,OFF} flags are added to qemu_ram_mmap(): - If RAM_SYNC_ON_OFF_AUTO_ON is present, qemu_ram_mmap() will try to pass MAP_SYNC to mmap(). It will then fail if the host OS or the backend file do not support MAP_SYNC, or MAP_SYNC is

[Qemu-devel] [PATCH V7 3/6] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-12-18 Thread Zhang Yi
: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c| 2 +- include/exec/memory.h | 3 +++ include/exec/ram_addr.h | 1 + include/qemu/mmap-alloc.h | 1 + include/qemu/osdep.h | 29 + util/mmap-alloc.c | 14 ++ 6 files

[Qemu-devel] [PATCH V7 2/6] util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter

2018-12-18 Thread Zhang Yi
As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi

[Qemu-devel] [PATCH V7 0/6] nvdimm: support MAP_SYNC for memory-backend-file

2018-12-18 Thread Zhang Yi
Alan Gilbert) Changes in v2: * Add 'sync' option to control the use of MAP_SYNC. (Eduardo Habkost) * Remove the unnecessary set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qemu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP

[Qemu-devel] [PATCH V6 6/6] hostmem-file: add 'sync' option

2018-12-12 Thread Zhang Yi
x27;share=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 39 +++ docs/nvdimm.txt | 20 +++- include/exec/memo

[Qemu-devel] [PATCH V6 5/6] hostmem: add more information in error messages

2018-12-12 Thread Zhang Yi
When there are multiple memory backends in use, including the object type name, ID and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 6 -- backends/hostmem.c | 8

[Qemu-devel] [PATCH V6 4/6] util/mmap-alloc: Switch the RAM_SYNC flags to OnOffAuto

2018-12-12 Thread Zhang Yi
Signed-off-by: Zhang Yi A set of RAM_SYNC_ON_OFF_AUTO{AUTO,ON,OFF} flags are added to qemu_ram_mmap(): - If RAM_SYNC_ON_OFF_AUTO_ON is present, qemu_ram_mmap() will try to pass MAP_SYNC to mmap(). It will then fail if the host OS or the backend file do not support MAP_SYNC, or MAP_SYNC is

[Qemu-devel] [PATCH V6 2/6] util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter

2018-12-12 Thread Zhang Yi
As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi

[Qemu-devel] [PATCH V6 3/6] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-12-12 Thread Zhang Yi
: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c| 2 +- include/exec/memory.h | 3 +++ include/exec/ram_addr.h | 1 + include/qemu/mmap-alloc.h | 1 + include/qemu/osdep.h | 29 + util/mmap-alloc.c | 13 + 6 files

[Qemu-devel] [PATCH V6 1/6] numa: Fixed the memory leak of numa error message

2018-12-12 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Signed-off-by: Zhang Yi Reviewed-by: Pankaj gupta Reviewed-by: Igor Mammedov --- numa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/numa.c b/numa.c index 50ec016..3875e1e 100644 --- a/numa.c

[Qemu-devel] [PATCH V6 0/6] nvdimm: support MAP_SYNC for memory-backend-file

2018-12-12 Thread Zhang Yi
y set of MAP_SHARED_VALIDATE in some cases and the retry mechanism in qemu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to osdep.h. (Michael S. Tsirkin) Zhang Yi (6): numa: Fixed the memory leak of numa error message util/mmap-alloc: switch qemu_

[Qemu-devel] [PATCH V5_resend 0/7] nvdimm: support MAP_SYNC for memory-backend-file

2018-11-19 Thread Zhang Yi
ault): if MAP_SYNC is supported and 'share=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Zhang Yi (7): numa: Fixed the memory leak of numa error message util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter exec: switch qemu_ra

[Qemu-devel] [PATCH V5_resend 5/7] util/mmap-alloc: Switch the RAM_SYNC flags to OnOffAuto

2018-11-19 Thread Zhang Yi
Signed-off-by: Zhang Yi A set of RAM_SYNC_ON_OFF_AUTO{AUTO,ON,OFF} flags are added to qemu_ram_mmap(): - If RAM_SYNC_ON_OFF_AUTO_ON is present, qemu_ram_mmap() will try to pass MAP_SYNC to mmap(). It will then fail if the host OS or the backend file do not support MAP_SYNC, or MAP_SYNC is

[Qemu-devel] [PATCH V5_resend 6/7] hostmem: add more information in error messages

2018-11-19 Thread Zhang Yi
When there are multiple memory backends in use, including the object type name, ID and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 6 -- backends/hostmem.c | 8

[Qemu-devel] [PATCH V5_resend 2/7] util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter

2018-11-19 Thread Zhang Yi
As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c

[Qemu-devel] [PATCH V5_resend 4/7] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-11-19 Thread Zhang Yi
: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c| 2 +- include/exec/memory.h | 3 +++ include/exec/ram_addr.h | 1 + include/qemu/mmap-alloc.h | 1 + include/standard-headers/linux/mman.h | 44

[Qemu-devel] [PATCH V5_resend 7/7] hostmem-file: add 'sync' option

2018-11-19 Thread Zhang Yi
x27;share=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 39 +++ docs/nvdimm.txt | 20 +++- include/exec/memo

[Qemu-devel] [PATCH V5_resend 1/7] numa: Fixed the memory leak of numa error message

2018-11-19 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Signed-off-by: Zhang Yi --- numa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/numa.c b/numa.c index 50ec016..3875e1e 100644 --- a/numa.c +++ b/numa.c @@ -533,6 +533,7 @@ void

[Qemu-devel] [PATCH V5_resend 3/7] exec: switch qemu_ram_alloc_from_{file, fd} to the 'flags' parameter

2018-11-19 Thread Zhang Yi
As more flag parameters besides the existing 'share' are going to be added to qemu_ram_alloc_from_{file,fd}(), let's swith 'share' to a 'flags' parameters in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang

[Qemu-devel] [PATCH v5 6/7] hostmem: add more information in error messages

2018-11-05 Thread Zhang Yi
When there are multiple memory backends in use, including the object type name, ID and the property name in the error message can help users to locate the error. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 6 -- backends/hostmem.c | 8

[Qemu-devel] [PATCH v5 3/7] exec: switch qemu_ram_alloc_from_{file, fd} to the 'flags' parameter

2018-11-05 Thread Zhang Yi
As more flag parameters besides the existing 'share' are going to be added to qemu_ram_alloc_from_{file,fd}(), let's swith 'share' to a 'flags' parameters in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang

[Qemu-devel] [PATCH v5 7/7] hostmem-file: add 'sync' option

2018-11-05 Thread Zhang Yi
x27;share=on', work as if 'sync=on'; otherwise, work as if 'sync=off' Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 39 +++ docs/nvdimm.txt | 20 +++- include/exec/memo

[Qemu-devel] [PATCH v5 4/7] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()

2018-11-05 Thread Zhang Yi
: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c| 2 +- include/exec/memory.h | 3 +++ include/exec/ram_addr.h | 1 + include/qemu/mmap-alloc.h | 1 + include/standard-headers/linux/mman.h | 44

[Qemu-devel] [PATCH v5 5/7] util/mmap-alloc: Switch the RAM_SYNC flags to OnOffAuto

2018-11-05 Thread Zhang Yi
Signed-off-by: Zhang Yi A set of RAM_SYNC_ON_OFF_AUTO{AUTO,ON,OFF} flags are added to qemu_ram_mmap(): - If RAM_SYNC_ON_OFF_AUTO_ON is present, qemu_ram_mmap() will try to pass MAP_SYNC to mmap(). It will then fail if the host OS or the backend file do not support MAP_SYNC, or MAP_SYNC is

[Qemu-devel] [PATCH v5 0/7] nvdimm: support MAP_SYNC for memory-backend-file

2018-11-05 Thread Zhang Yi
emu_ram_mmap(). (Michael S. Tsirkin) * Move OS dependent definitions of MAP_SYNC and MAP_SHARED_VALIDATE to osdep.h. (Michael S. Tsirkin) Zhang Yi (7): numa: Fixed the memory leak of numa error message util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter exec: switch qemu_ra

[Qemu-devel] [PATCH v5 2/7] util/mmap-alloc: switch qemu_ram_mmap() to 'flags' parameter

2018-11-05 Thread Zhang Yi
As more flag parameters besides the existing 'shared' are going to be added to qemu_ram_mmap(), let's switch 'shared' to a 'flags' parameter in advance, so as to ease the further additions. Signed-off-by: Haozhong Zhang Signed-off-by: Zhang Yi --- exec.c

[Qemu-devel] [PATCH v5 1/7] numa: Fixed the memory leak of numa error message

2018-11-05 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Signed-off-by: Zhang Yi --- numa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/numa.c b/numa.c index 50ec016..3875e1e 100644 --- a/numa.c +++ b/numa.c @@ -533,6 +533,7 @@ void

[Qemu-devel] [PATCH 1/1] hostmem-file: remove the invalid pmem object id.

2018-10-24 Thread Zhang Yi
We will never get the canonical path from the object before object_property_add_child. Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index 639c8d4..9691c48

[Qemu-devel] [PATCH 1/1] hostmem-file: fixed the memory leak while get pmem path.

2018-08-28 Thread Zhang Yi
object_get_canonical_path_component() returns a string which must be freed using g_free(). Reported-by: Peter Maydell Signed-off-by: Michael S. Tsirkin Signed-off-by: Zhang Yi --- backends/hostmem-file.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backends

Re: [Qemu-devel] [RFC PATCH 1/1] nvdimm: let qemu requiring section alignment of pmem resource.

2018-06-11 Thread Zhang,Yi
On δΈ€, 2018-06-11 at 19:55 -0700, Dan Williams wrote: > On Mon, Jun 11, 2018 at 9:26 AM, Stefan Hajnoczi > wrote: > > > > On Mon, Jun 11, 2018 at 06:54:25PM +0800, Zhang Yi wrote: > > > > > > Nvdimm driver use Memory hot-plug APIs to map it's pmem resou

[Qemu-devel] [RFC PATCH 1/1] nvdimm: let qemu requiring section alignment of pmem resource.

2018-06-10 Thread Zhang Yi
won't align to the 128 MB memory section size. Signed-off-by: Zhang Yi --- hw/mem/nvdimm.c | 2 +- include/hw/mem/nvdimm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 4087aca..ff6e171 100644 --- a/hw/mem/nvdimm.c ++