mvadkert / rpms / qemu

Forked from rpms/qemu 6 years ago
Clone
eff9421
From 575c00a2880177295a116d43132566143af69a0b Mon Sep 17 00:00:00 2001
eff9421
From: Michael S. Tsirkin <mst@redhat.com>
eff9421
Date: Wed, 24 Feb 2010 21:09:51 +0200
eff9421
Subject: [PATCH] vhost: move vhost_set_vq_addr
eff9421
eff9421
Move function in file: we'll add another
eff9421
call site in the following patch.
eff9421
eff9421
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
eff9421
---
eff9421
 hw/vhost.c |   38 +++++++++++++++++++-------------------
eff9421
 1 files changed, 19 insertions(+), 19 deletions(-)
eff9421
eff9421
diff --git a/hw/vhost.c b/hw/vhost.c
eff9421
index 3c54596..54386e1 100644
eff9421
--- a/hw/vhost.c
eff9421
+++ b/hw/vhost.c
eff9421
@@ -306,6 +306,25 @@ static void vhost_client_set_memory(CPUPhysMemoryClient *client,
eff9421
 	}
eff9421
 }
eff9421
eff9421
+static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
eff9421
+				    struct vhost_virtqueue *vq,
eff9421
+				    unsigned idx, bool enable_log)
eff9421
+{
eff9421
+	struct vhost_vring_addr addr = {
eff9421
+		.index = idx,
eff9421
+		.desc_user_addr = (u_int64_t)(unsigned long)vq->desc,
eff9421
+		.avail_user_addr = (u_int64_t)(unsigned long)vq->avail,
eff9421
+		.used_user_addr = (u_int64_t)(unsigned long)vq->used,
eff9421
+		.log_guest_addr = vq->used_phys,
eff9421
+		.flags = enable_log ? (1 << VHOST_VRING_F_LOG) : 0,
eff9421
+	};
eff9421
+	int r = ioctl(dev->control, VHOST_SET_VRING_ADDR, &addr);
eff9421
+	if (r < 0) {
eff9421
+		return -errno;
eff9421
+	}
eff9421
+	return 0;
eff9421
+}
eff9421
+
eff9421
 static int vhost_dev_set_log(struct vhost_dev *dev, bool enable_log)
eff9421
 {
eff9421
 	uint64_t features = dev->acked_features;
eff9421
@@ -350,25 +369,6 @@ static int vhost_client_migration_log(struct CPUPhysMemoryClient *client,
eff9421
 	return 0;
eff9421
 }
eff9421
eff9421
-static int vhost_virtqueue_set_addr(struct vhost_dev *dev,
eff9421
-				    struct vhost_virtqueue *vq,
eff9421
-				    unsigned idx, bool enable_log)
eff9421
-{
eff9421
-	struct vhost_vring_addr addr = {
eff9421
-		.index = idx,
eff9421
-		.desc_user_addr = (u_int64_t)(unsigned long)vq->desc,
eff9421
-		.avail_user_addr = (u_int64_t)(unsigned long)vq->avail,
eff9421
-		.used_user_addr = (u_int64_t)(unsigned long)vq->used,
eff9421
-		.log_guest_addr = vq->used_phys,
eff9421
-		.flags = enable_log ? (1 << VHOST_VRING_F_LOG) : 0,
eff9421
-	};
eff9421
-	int r = ioctl(dev->control, VHOST_SET_VRING_ADDR, &addr);
eff9421
-	if (r < 0) {
eff9421
-		return -errno;
eff9421
-	}
eff9421
-	return 0;
eff9421
-}
eff9421
-
eff9421
 static int vhost_virtqueue_init(struct vhost_dev *dev,
eff9421
 				struct VirtIODevice *vdev,
eff9421
 				struct vhost_virtqueue *vq,
eff9421
-- 
eff9421
1.6.6.1
eff9421