From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ND31Y-0004NB-Cj for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ND31T-0004L3-Af for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:11 -0500 Received: from [199.232.76.173] (port=38917 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ND31T-0004Kz-4l for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6957) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ND31S-0001NS-N9 for qemu-devel@nongnu.org; Tue, 24 Nov 2009 16:34:06 -0500 Date: Tue, 24 Nov 2009 23:31:28 +0200 From: "Michael S. Tsirkin" Message-ID: <20091124213128.GB4703@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] [PATCH 1/2] msix: add helper to mark all msix entries List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, anthony@codemonkey.ws will be used by virtio on soft reset Signed-off-by: Michael S. Tsirkin --- hw/msix.c | 7 +++++++ hw/msix.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/msix.c b/hw/msix.c index 548ffd5..d499441 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 39fa568..a9f7993 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); -- 1.6.5.2.143.g8cc62