diff mbox

[1/3] virtio: find_vqs/del_vqs virtio operations

Message ID 200905121055.58304.borntraeger@de.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Borntraeger May 12, 2009, 8:55 a.m. UTC
Am Tuesday 12 May 2009 00:19:32 schrieb Michael S. Tsirkin:
> This replaces find_vq/del_vq with find_vqs/del_vqs virtio operations,
> and updates all drivers. This is needed for MSI support, because MSI
> needs to know the total number of vectors upfront.
[...]
> diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c

This file contains several copy/paste breakages and needs at least the
patch below to compile.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

---
 drivers/s390/kvm/kvm_virtio.c |   28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

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

Patch

Index: kvm/drivers/s390/kvm/kvm_virtio.c
===================================================================
--- kvm.orig/drivers/s390/kvm/kvm_virtio.c
+++ kvm/drivers/s390/kvm/kvm_virtio.c
@@ -237,23 +237,23 @@  static void kvm_del_vqs(struct virtio_de
 	int i;
 	if (!kdev->vqs)
 		return;
-	for (i = 0; i < ldev->nvqs; ++i)
+	for (i = 0; i < kdev->nvqs; ++i)
 		kvm_del_vq(kdev->vqs[i]);
-	kfree(ldev->vqs);
-	ldev->vqs = NULL;
-	ldev->nvqs = 0;
+	kfree(kdev->vqs);
+	kdev->vqs = NULL;
+	kdev->nvqs = 0;
 }
 
 static int kvm_find_vqs(struct virtio_device *vdev, unsigned nvqs,
-			struct virtqueue *vqs[]
-			void (*callbacks)[](struct virtqueue *))
+			struct virtqueue *vqs[],
+			virtqueue_callback *callbacks[])
 {
 	struct kvm_device *kdev = to_kvmdev(vdev);
 	int i;
 
 	/* We must have this many virtqueues. */
 	if (nvqs > kdev->desc->num_vq)
-		return ERR_PTR(-ENOENT);
+		return -ENOENT;
 
 	kdev->vqs = kmalloc(GFP_KERNEL, nvqs * sizeof *kdev->vqs);
 	if (!kdev->vqs)
@@ -272,20 +272,6 @@  error:
 	return PTR_ERR(vqs[i]);
 }
 
-static void kvm_del_vqs(struct virtio_device *vdev)
-{
-	struct lguest_device *ldev = to_lgdev(vdev);
-	int i;
-
-	if (!ldev->vqs)
-		return;
-	for (i = 0; i < ldev->nvqs; ++i)
-		lg_del_vq(ldev->vqs[i]);
-	kfree(ldev->vqs);
-	ldev->vqs = NULL;
-	ldev->nvqs = 0;
-}
-
 /*
  * The config ops structure as defined by virtio config
  */