From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MMQST-000389-DW for qemu-devel@nongnu.org; Thu, 02 Jul 2009 13:52:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MMQSP-000343-MC for qemu-devel@nongnu.org; Thu, 02 Jul 2009 13:52:29 -0400 Received: from [199.232.76.173] (port=41111 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMQSP-00033z-HH for qemu-devel@nongnu.org; Thu, 02 Jul 2009 13:52:25 -0400 Received: from mx2.redhat.com ([66.187.237.31]:41439) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MMQSO-0007P3-UT for qemu-devel@nongnu.org; Thu, 02 Jul 2009 13:52:25 -0400 Date: Thu, 2 Jul 2009 20:51:51 +0300 From: "Michael S. Tsirkin" Message-ID: <20090702175150.GA27511@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] qemu/virtio: enable msi vectors on load List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, avi@redhat.com, kvm@vger.kernel.org, aliguori@us.ibm.com, kwolf@redhat.com On load, enable msi vectors used by the virtio device. Signed-off-by: Michael S. Tsirkin --- hw/virtio-pci.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index f7da503..4bbdca4 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -129,8 +129,11 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f) if (ret) return ret; msix_load(&proxy->pci_dev, f); - if (msix_present(&proxy->pci_dev)) + if (msix_present(&proxy->pci_dev)) { + msix_vector_unuse(&proxy->pci_dev, proxy->vdev->config_vector); qemu_get_be16s(f, &proxy->vdev->config_vector); + return msix_vector_use(&proxy->pci_dev, proxy->vdev->config_vector); + } return 0; } @@ -140,9 +143,10 @@ static int virtio_pci_load_queue(void * opaque, int n, QEMUFile *f) uint16_t vector; if (!msix_present(&proxy->pci_dev)) return 0; + msix_vector_unuse(&proxy->pci_dev, virtio_queue_vector(proxy->vdev, n)); qemu_get_be16s(f, &vector); virtio_queue_set_vector(proxy->vdev, n, vector); - return 0; + return msix_vector_use(&proxy->pci_dev, vector); } static void virtio_pci_reset(void *opaque) -- 1.6.2.2