dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone
Blob Blame History Raw
From d42430f94c77a653da486e6f96f6695818f3e81b Mon Sep 17 00:00:00 2001
From: Michael S. Tsirkin <mst@redhat.com>
Date: Wed, 24 Feb 2010 21:10:04 +0200
Subject: [PATCH] vhost: fix log base

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@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.6.6.1