Re: [PATCH] kvm tools: Use mmap for working with disk image V3

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

 



On Sat, 9 Apr 2011, Sasha Levin wrote:
+struct disk_image *disk_image__new(int fd, uint64_t size)
+{
+	struct disk_image *self;
+
+	self		= malloc(sizeof *self);
+	if (!self)
+		return NULL;
+
+	self->fd	= fd;
+	self->size	= size;
+	self->priv	= mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_NORESERVE, fd, 0);

This needs to be MAP_SHARED to preserve the same semantics. Does it still show a performance improvement if you change it?

			Pekka
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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