From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWX4U-0008IV-Vj for qemu-devel@nongnu.org; Mon, 21 May 2012 14:11:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWX4R-00017H-52 for qemu-devel@nongnu.org; Mon, 21 May 2012 14:11:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWX4Q-00015L-TA for qemu-devel@nongnu.org; Mon, 21 May 2012 14:11:03 -0400 From: Avi Kivity Date: Mon, 21 May 2012 19:37:46 +0300 Message-Id: <1337618267-16669-19-git-send-email-avi@redhat.com> In-Reply-To: <1337618267-16669-1-git-send-email-avi@redhat.com> References: <1337618267-16669-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 18/19] msix: Add msix_nr_vectors_allocated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Jan Kiszka Analogously to msi_nr_vectors_allocated, add a service for MSI-X. Will be used by the virtio-pci layer. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- hw/msix.c | 5 +++++ hw/msix.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/msix.c b/hw/msix.c index 1622e16..59c7a83 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -452,6 +452,11 @@ void msix_unuse_all_vectors(PCIDevice *dev) msix_free_irq_entries(dev); } +unsigned int msix_nr_vectors_allocated(const PCIDevice *dev) +{ + return dev->msix_entries_nr; +} + static int msix_set_notifier_for_vector(PCIDevice *dev, unsigned int vector) { MSIMessage msg; diff --git a/hw/msix.h b/hw/msix.h index f33f18b..50aee82 100644 --- a/hw/msix.h +++ b/hw/msix.h @@ -13,6 +13,8 @@ void msix_write_config(PCIDevice *pci_dev, uint32_t address, int msix_uninit(PCIDevice *d, MemoryRegion *bar); +unsigned int msix_nr_vectors_allocated(const PCIDevice *dev); + void msix_save(PCIDevice *dev, QEMUFile *f); void msix_load(PCIDevice *dev, QEMUFile *f); -- 1.7.10.1