msix: Add msix_nr_vectors_allocated
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 17 May 2012 13:32:38 +0000 (10:32 -0300)
committerAvi Kivity <avi@redhat.com>
Mon, 21 May 2012 16:22:50 +0000 (19:22 +0300)
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 <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
hw/msix.c
hw/msix.h

index 1622e16188fcdb7a314a9b2131a6992ca5adc769..59c7a8388fd428683a8a916a400b4371f74fa505 100644 (file)
--- 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;
index f33f18b484eacffdcb23327c4e76c1b7263092d1..50aee8221a9b73b25080434dc8f9b5733d6d7e0f 100644 (file)
--- 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);