From patchwork Thu May 17 13:32:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 159904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 20346B6FB9 for ; Thu, 17 May 2012 23:34:04 +1000 (EST) Received: from localhost ([::1]:49327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SV0q9-0002w6-R9 for incoming@patchwork.ozlabs.org; Thu, 17 May 2012 09:34:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SV0pU-0001mp-MI for qemu-devel@nongnu.org; Thu, 17 May 2012 09:33:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SV0pN-0004bc-DL for qemu-devel@nongnu.org; Thu, 17 May 2012 09:33:20 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:58321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SV0pN-0004bR-76 for qemu-devel@nongnu.org; Thu, 17 May 2012 09:33:13 -0400 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate01.web.de (Postfix) with ESMTP id A8DDA1AE78AD6 for ; Thu, 17 May 2012 15:33:11 +0200 (CEST) Received: from localhost.localdomain ([187.105.13.240]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0MCIYT-1SMSFo40Y5-0097w3; Thu, 17 May 2012 15:33:11 +0200 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Thu, 17 May 2012 10:32:38 -0300 Message-Id: <7b8279e9f2559bc86cc0f2ce779115f10d21542b.1337261556.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V02:K0:5YeqXReV1a83T0WhzvlX4qPwCL4qj9lifdR3dKAW60c +k7eLffc/FaC42BtP+Ml2BcnaY28e1PQ9E2Hc96eHLTgqfb+60 +gzRRJzzQI2tGJXwNN2pmF+5/ziCaujjiBaxd3R/k4SXzmwZFj oz+6WAL9wOrgdpri/E/am7dDmCuPJHGQ0FRMy23BaW/MgT5Rjs CHWYWpxDF3368T1hb3LOA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.221 Cc: qemu-devel , kvm@vger.kernel.org, "Michael S. Tsirkin" Subject: [Qemu-devel] [RFC][PATCH v2 10/11] msix: Add msix_nr_vectors_allocated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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 --- hw/msix.c | 5 +++++ hw/msix.h | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) 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);