mvadkert / rpms / qemu

Forked from rpms/qemu 6 years ago
Clone
eff9421
From d42430f94c77a653da486e6f96f6695818f3e81b Mon Sep 17 00:00:00 2001
eff9421
From: Michael S. Tsirkin <mst@redhat.com>
eff9421
Date: Wed, 24 Feb 2010 21:10:04 +0200
eff9421
Subject: [PATCH] vhost: fix log base
eff9421
eff9421
LOG_BASE ioctl gets a pointer to a 64 bit value, not
eff9421
a pointer cast to 64 bit value.
eff9421
eff9421
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eff9421
---
eff9421
 hw/vhost.c |    5 +++--
eff9421
 1 files changed, 3 insertions(+), 2 deletions(-)
eff9421
eff9421
diff --git a/hw/vhost.c b/hw/vhost.c
eff9421
index 019afc2..b63eafa 100644
eff9421
--- a/hw/vhost.c
eff9421
+++ b/hw/vhost.c
eff9421
@@ -241,14 +241,15 @@ static uint64_t vhost_get_log_size(struct vhost_dev *dev)
eff9421
 static inline void vhost_dev_log_resize(struct vhost_dev* dev, uint64_t size)
eff9421
 {
eff9421
 	vhost_log_chunk_t *log;
eff9421
+	uint64_t log_base;
eff9421
 	int r;
eff9421
 	if (size) {
eff9421
 		log = qemu_mallocz(size * sizeof *log);
eff9421
 	} else {
eff9421
 		log = NULL;
eff9421
 	}
eff9421
-	r = ioctl(dev->control, VHOST_SET_LOG_BASE,
eff9421
-		  (uint64_t)(unsigned long)log);
eff9421
+	log_base = (uint64_t)(unsigned long)log;
eff9421
+	r = ioctl(dev->control, VHOST_SET_LOG_BASE, &log_base);
eff9421
 	assert(r >= 0);
eff9421
 	vhost_client_sync_dirty_bitmap(&dev->client, 0,
eff9421
 				       (target_phys_addr_t)~0x0ull);
eff9421
-- 
eff9421
1.6.6.1
eff9421