From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: [PATCH 6/8] virtio_balloon: add request_vqs/free_vqs calls Date: Mon, 27 Apr 2009 15:33:02 +0300 Message-ID: <20090427123302.GA1186@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Rusty Russell , virtualization@lists.linux-foundation.org, Anthony Liguori , kvm@vger.kernel.org, avi@redhat.com Return-path: Received: from mx2.redhat.com ([66.187.237.31]:53975 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756066AbZD0Me6 (ORCPT ); Mon, 27 Apr 2009 08:34:58 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Add request_vqs/free_vqs calls to virtio_balloon. These will be required for MSI support. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 5926826..77eac2b 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -217,10 +217,14 @@ static int virtballoon_probe(struct virtio_device *vdev) vb->vdev = vdev; /* We expect two virtqueues. */ + err = virtio_request_vqs(vdev, 2); + if (err) + goto out_free_vb; + vb->inflate_vq = vdev->config->find_vq(vdev, 0, balloon_ack); if (IS_ERR(vb->inflate_vq)) { err = PTR_ERR(vb->inflate_vq); - goto out_free_vb; + goto out_free_vqs; } vb->deflate_vq = vdev->config->find_vq(vdev, 1, balloon_ack); @@ -244,6 +248,8 @@ out_del_deflate_vq: vdev->config->del_vq(vb->deflate_vq); out_del_inflate_vq: vdev->config->del_vq(vb->inflate_vq); +out_free_vqs: + virtio_free_vqs(vdev); out_free_vb: kfree(vb); out: @@ -265,6 +271,7 @@ static void virtballoon_remove(struct virtio_device *vdev) vdev->config->del_vq(vb->deflate_vq); vdev->config->del_vq(vb->inflate_vq); + virtio_free_vqs(vdev); kfree(vb); } -- 1.6.0.6