[fedora-virt] [PATCH 7/7] vhost: fix log base

Michael S. Tsirkin mst at redhat.com
Wed Feb 24 19:10:04 UTC 2010


LOG_BASE ioctl gets a pointer to a 64 bit value, not
a pointer cast to 64 bit value.

Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
 hw/vhost.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/vhost.c b/hw/vhost.c
index 019afc2..b63eafa 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -241,14 +241,15 @@ static uint64_t vhost_get_log_size(struct vhost_dev *dev)
 static inline void vhost_dev_log_resize(struct vhost_dev* dev, uint64_t size)
 {
 	vhost_log_chunk_t *log;
+	uint64_t log_base;
 	int r;
 	if (size) {
 		log = qemu_mallocz(size * sizeof *log);
 	} else {
 		log = NULL;
 	}
-	r = ioctl(dev->control, VHOST_SET_LOG_BASE,
-		  (uint64_t)(unsigned long)log);
+	log_base = (uint64_t)(unsigned long)log;
+	r = ioctl(dev->control, VHOST_SET_LOG_BASE, &log_base);
 	assert(r >= 0);
 	vhost_client_sync_dirty_bitmap(&dev->client, 0,
 				       (target_phys_addr_t)~0x0ull);
-- 
1.7.0.18.g0d53a5


More information about the virt mailing list