From patchwork Thu Jun 14 18:16:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 164989 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 30B33B6FB4 for ; Fri, 15 Jun 2012 04:16:26 +1000 (EST) Received: from localhost ([::1]:42348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfEal-0004lL-TH for incoming@patchwork.ozlabs.org; Thu, 14 Jun 2012 14:16:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfEaY-0004Va-Fb for qemu-devel@nongnu.org; Thu, 14 Jun 2012 14:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfEaT-0007h2-QH for qemu-devel@nongnu.org; Thu, 14 Jun 2012 14:16:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfEaT-0007gq-I0 for qemu-devel@nongnu.org; Thu, 14 Jun 2012 14:16:05 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5EIG3Wo016663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Jun 2012 14:16:04 -0400 Received: from bling.home (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5EIG1fO010465; Thu, 14 Jun 2012 14:16:02 -0400 From: Alex Williamson To: mst@redhat.com Date: Thu, 14 Jun 2012 12:16:01 -0600 Message-ID: <20120614181600.23440.97470.stgit@bling.home> In-Reply-To: <20120614181104.23440.62204.stgit@bling.home> References: <20120614181104.23440.62204.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH v3 2/8] ivshmem: Convert to msix_init_exclusive_bar() interface 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 Trivial conversion, failed to have an uninit before and after. Signed-off-by: Alex Williamson --- hw/ivshmem.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/ivshmem.c b/hw/ivshmem.c index 05559b6..8b49eee 100644 --- a/hw/ivshmem.c +++ b/hw/ivshmem.c @@ -70,7 +70,6 @@ typedef struct IVShmemState { */ MemoryRegion bar; MemoryRegion ivshmem; - MemoryRegion msix_bar; uint64_t ivshmem_size; /* size of shared memory region */ int shm_fd; /* shared memory file descriptor */ @@ -563,16 +562,13 @@ static uint64_t ivshmem_get_size(IVShmemState * s) { static void ivshmem_setup_msi(IVShmemState * s) { - memory_region_init(&s->msix_bar, "ivshmem-msix", 4096); - if (!msix_init(&s->dev, s->vectors, &s->msix_bar, 1, 0)) { - pci_register_bar(&s->dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, - &s->msix_bar); - IVSHMEM_DPRINTF("msix initialized (%d vectors)\n", s->vectors); - } else { + if (msix_init_exclusive_bar(&s->dev, s->vectors, 1)) { IVSHMEM_DPRINTF("msix initialization failed\n"); exit(1); } + IVSHMEM_DPRINTF("msix initialized (%d vectors)\n", s->vectors); + /* allocate QEMU char devices for receiving interrupts */ s->eventfd_table = g_malloc0(s->vectors * sizeof(EventfdEntry));