[RFC PATCH kvmtool v1 22/32] Change guest ram mapping from private to shared

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

 



Private mappings don't work with restricted memory since it might
be COWed.

Signed-off-by: Fuad Tabba <tabba@xxxxxxxxxx>
---
 util/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/util.c b/util/util.c
index 1424815..107f34d 100644
--- a/util/util.c
+++ b/util/util.c
@@ -173,7 +173,7 @@ void *mmap_anon_or_hugetlbfs_align(struct kvm *kvm, const char *hugetlbfs_path,
 
 	/* Map the allocated memory in the fd to the specified alignment. */
 	addr_align = (void *)ALIGN((u64)addr_map, align_sz);
-	if (mmap(addr_align, size, PROT_RW, MAP_PRIVATE | MAP_FIXED, fd, 0) ==
+	if (mmap(addr_align, size, PROT_RW, MAP_SHARED | MAP_FIXED, fd, 0) ==
 	    MAP_FAILED) {
 		close(fd);
 		return MAP_FAILED;
-- 
2.39.0.rc0.267.gcb52ba06e7-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux