From: Michael S. Tsirkin Date: Tue, 24 Nov 2009 14:44:15 +0000 (+0200) Subject: msix: add helper to unuse all msix entries X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b5f28bcaeec3ca54755f24ae665c4028fc598d77;p=qemu.git msix: add helper to unuse all msix entries will be used by virtio on soft reset Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/msix.c b/hw/msix.c index 548ffd5c8b..d49944111f 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -378,3 +378,10 @@ void msix_vector_unuse(PCIDevice *dev, unsigned vector) if (vector < dev->msix_entries_nr && dev->msix_entry_used[vector]) --dev->msix_entry_used[vector]; } + +void msix_unuse_all_vectors(PCIDevice *dev) +{ + if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) + return; + msix_free_irq_entries(dev); +} diff --git a/hw/msix.h b/hw/msix.h index 39fa568f9c..a9f7993c39 100644 --- a/hw/msix.h +++ b/hw/msix.h @@ -25,6 +25,7 @@ uint32_t msix_bar_size(PCIDevice *dev); int msix_vector_use(PCIDevice *dev, unsigned vector); void msix_vector_unuse(PCIDevice *dev, unsigned vector); +void msix_unuse_all_vectors(PCIDevice *dev); void msix_notify(PCIDevice *dev, unsigned vector);