From patchwork Mon Apr 27 12:32:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 20142 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 n3RCYERp011247 for ; Mon, 27 Apr 2009 12:34:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754384AbZD0MeN (ORCPT ); Mon, 27 Apr 2009 08:34:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754251AbZD0MeM (ORCPT ); Mon, 27 Apr 2009 08:34:12 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53945 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754070AbZD0MeM (ORCPT ); Mon, 27 Apr 2009 08:34:12 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3RCXEAS016797; Mon, 27 Apr 2009 08:33:14 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3RCXE50018169; Mon, 27 Apr 2009 08:33:14 -0400 Received: from redhat.com (vpn-10-134.str.redhat.com [10.32.10.134]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3RCXBbe008419; Mon, 27 Apr 2009 08:33:12 -0400 Date: Mon, 27 Apr 2009 15:32:13 +0300 From: "Michael S. Tsirkin" To: Rusty Russell , virtualization@lists.linux-foundation.org, Anthony Liguori , kvm@vger.kernel.org, avi@redhat.com Subject: [PATCH 2/8] virtio_blk: add request_vqs/free_vqs calls Message-ID: <20090427123213.GA1166@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add request_vqs/free_vqs calls to virtio_blk. These will be required for MSI support. Signed-off-by: Michael S. Tsirkin --- drivers/block/virtio_blk.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 5d34764..523eddc 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -224,10 +224,14 @@ static int virtblk_probe(struct virtio_device *vdev) sg_init_table(vblk->sg, vblk->sg_elems); /* We expect one virtqueue, for output. */ + err = virtio_request_vqs(vdev, 1); + if (err) + goto out_free_vblk; + vblk->vq = vdev->config->find_vq(vdev, 0, blk_done); if (IS_ERR(vblk->vq)) { err = PTR_ERR(vblk->vq); - goto out_free_vblk; + goto out_free_vqs; } vblk->pool = mempool_create_kmalloc_pool(1,sizeof(struct virtblk_req)); @@ -324,6 +328,8 @@ out_mempool: mempool_destroy(vblk->pool); out_free_vq: vdev->config->del_vq(vblk->vq); +out_free_vqs: + virtio_free_vqs(vdev); out_free_vblk: kfree(vblk); out: @@ -345,6 +351,7 @@ static void virtblk_remove(struct virtio_device *vdev) put_disk(vblk->disk); mempool_destroy(vblk->pool); vdev->config->del_vq(vblk->vq); + virtio_free_vqs(vdev); kfree(vblk); }