From patchwork Tue May 12 08:55:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 23181 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4C8uo9r025565 for ; Tue, 12 May 2009 08:56:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbZELI4B (ORCPT ); Tue, 12 May 2009 04:56:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752147AbZELI4B (ORCPT ); Tue, 12 May 2009 04:56:01 -0400 Received: from mtagate3.de.ibm.com ([195.212.29.152]:40749 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575AbZELIz7 (ORCPT ); Tue, 12 May 2009 04:55:59 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.14.3/8.13.8) with ESMTP id n4C8u0qx099496 for ; Tue, 12 May 2009 08:56:00 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4C8txkp3301584 for ; Tue, 12 May 2009 10:56:00 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4C8tx2Y031054 for ; Tue, 12 May 2009 10:55:59 +0200 Received: from dyn-9-152-212-32.boeblingen.de.ibm.com (dyn-9-152-212-32.boeblingen.de.ibm.com [9.152.212.32]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4C8twS7031043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 12 May 2009 10:55:58 +0200 From: Christian Borntraeger To: "Michael S. Tsirkin" Subject: Re: [PATCH 1/3] virtio: find_vqs/del_vqs virtio operations Date: Tue, 12 May 2009 10:55:58 +0200 User-Agent: KMail/1.9.9 Cc: Rusty Russell , virtualization@lists.linux-foundation.org, Anthony Liguori , kvm@vger.kernel.org, avi@redhat.com, Carsten Otte References: <20090511221932.GA22915@redhat.com> In-Reply-To: <20090511221932.GA22915@redhat.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200905121055.58304.borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- 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 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 */