From patchwork Thu Sep 24 11:37:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 522281 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2285E14027C for ; Thu, 24 Sep 2015 22:03:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=KCeWflsB; dkim-atps=neutral Received: from localhost ([::1]:58431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf5FH-0007S8-8E for incoming@patchwork.ozlabs.org; Thu, 24 Sep 2015 08:03:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf4sW-0001dS-Pk for qemu-devel@nongnu.org; Thu, 24 Sep 2015 07:39:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf4sV-0007OY-UF for qemu-devel@nongnu.org; Thu, 24 Sep 2015 07:39:56 -0400 Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:36208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf4sV-0007OP-RJ for qemu-devel@nongnu.org; Thu, 24 Sep 2015 07:39:55 -0400 Received: by qgx61 with SMTP id 61so41412110qgx.3 for ; Thu, 24 Sep 2015 04:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=DBjw6v9vTLZihgLTzUIgZODn1fOLlNmBCFsasGTguRE=; b=KCeWflsBy+XK89XnrFzMfoj0CyONBlOtBZthipEeOFx2VgqC22bRClZlDCHid4xMoZ 5qh+M7yIadw4n4kYxVMm3p/r7fUXH9uQy1i3QJCVq9e+/EdGFH1S5Ggsl6swoqzhe5Y3 uhVdLIC2quvd+BX0NW1SmR3PUyGEPvAq6nR0WPT0h3TuAqMr0UU5dA/HcOmuGtrirueO 6wKyA8WAu5C9yX5iHgqZ+68xYjoeGSz38nVA3otWnPXIIL8yWjkjV1fB8yvIeZVk105+ k5d+SCCGwUD/pA/22FKqTfcKo4CyJNk2aSkD7C4Gxh9hX090KJF1vpw7mJT1kcPb56yr Y2lw== X-Received: by 10.140.145.75 with SMTP id 72mr44571600qhr.81.1443094795633; Thu, 24 Sep 2015 04:39:55 -0700 (PDT) Received: from localhost (bne75-h02-31-39-163-232.dsl.sta.abo.bbox.fr. [31.39.163.232]) by smtp.gmail.com with ESMTPSA id g20sm3272384qge.9.2015.09.24.04.39.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Sep 2015 04:39:54 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Thu, 24 Sep 2015 13:37:47 +0200 Message-Id: <1443094669-4144-46-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443094669-4144-1-git-send-email-marcandre.lureau@redhat.com> References: <1443094669-4144-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c04::229 Cc: drjones@redhat.com, claudio.fontana@huawei.com, stefanha@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com, cam@cs.ualberta.ca Subject: [Qemu-devel] [PATCH v4 45/47] ivshmem: rename MSI eventfd_table 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: Marc-André Lureau The array is used to have vector specific data, so use a more descriptive name. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 619947e..73644cc 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -66,9 +66,9 @@ typedef struct Peer { EventNotifier *eventfds; } Peer; -typedef struct EventfdEntry { +typedef struct MSIVector { PCIDevice *pdev; -} EventfdEntry; +} MSIVector; typedef struct IVShmemState { /*< private >*/ @@ -99,7 +99,7 @@ typedef struct IVShmemState { int vm_id; uint32_t vectors; uint32_t features; - EventfdEntry *eventfd_table; + MSIVector *msi_vectors; Error *migration_blocker; @@ -284,10 +284,10 @@ static void ivshmem_event(void *opaque, int event) static void fake_irqfd(void *opaque, const uint8_t *buf, int size) { - EventfdEntry *entry = opaque; + MSIVector *entry = opaque; PCIDevice *pdev = entry->pdev; IVShmemState *s = IVSHMEM(pdev); - int vector = entry - s->eventfd_table; + int vector = entry - s->msi_vectors; IVSHMEM_DPRINTF("interrupt on vector %p %d\n", pdev, vector); msix_notify(pdev, vector); @@ -311,10 +311,10 @@ static CharDriverState* create_eventfd_chr_device(void * opaque, EventNotifier * /* if MSI is supported we need multiple interrupts */ if (ivshmem_has_feature(s, IVSHMEM_MSI)) { - s->eventfd_table[vector].pdev = PCI_DEVICE(s); + s->msi_vectors[vector].pdev = PCI_DEVICE(s); qemu_chr_add_handlers(chr, ivshmem_can_receive, fake_irqfd, - ivshmem_event, &s->eventfd_table[vector]); + ivshmem_event, &s->msi_vectors[vector]); } else { qemu_chr_add_handlers(chr, ivshmem_can_receive, ivshmem_receive, ivshmem_event, s); @@ -660,7 +660,7 @@ static int ivshmem_setup_msi(IVShmemState * s) 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)); + s->msi_vectors = g_malloc0(s->vectors * sizeof(MSIVector)); ivshmem_use_msix(s); return 0; @@ -865,7 +865,7 @@ static void pci_ivshmem_exit(PCIDevice *dev) msix_uninit_exclusive_bar(dev); } - g_free(s->eventfd_table); + g_free(s->msi_vectors); } static bool test_msix(void *opaque, int version_id)