From patchwork Tue Oct 6 19:19:42 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: 526937 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:4830:134:3::10]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EE66E140D71 for ; Wed, 7 Oct 2015 06:29:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=VcJnBPWb; dkim-atps=neutral Received: from lists.gnu.org ([208.118.235.17]:50071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjXvG-0005jz-Eo for incoming@patchwork.ozlabs.org; Tue, 06 Oct 2015 15:29:14 -0400 Received: from localhost ([::1]:53364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjXvG-0004YO-AU for incoming@patchwork.ozlabs.org; Tue, 06 Oct 2015 15:29:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjXoi-0002Qd-TP for qemu-devel@nongnu.org; Tue, 06 Oct 2015 15:22:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjXog-00087X-3f for qemu-devel@nongnu.org; Tue, 06 Oct 2015 15:22:28 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:33802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjXof-00085Q-MR for qemu-devel@nongnu.org; Tue, 06 Oct 2015 15:22:25 -0400 Received: by qgez77 with SMTP id z77so184274709qge.1 for ; Tue, 06 Oct 2015 12:22:25 -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=61ZdyvwUFpnOtIc28rbQgnjJQOwDGvX876LGo1WOt/8=; b=VcJnBPWb9haVwdlLtTn9VpkqbvC5KYnhGMtT022DFDgtpuiuNXbPhavYJ4T9Gn7JqD d3whYG5xcDiLPKv5H42LPZEwV3ut25fjTR2JlUuCsr4I2yyiPD8PHanNWKtq3ahRsRxX P8DSwCGJCvqNaerI/W0dAVG9tkAvJYDLaL97/Jp0vZciPDzYIMiOuYc6TH4zC/HLql4z mTHRB7tWaeIBPK862wOHn9VYnWQ6PR94wqmvwfdVkW3O41myQAhnkXH0or3WuawbuzJy s3xF9JUexIhofzUPIU/nf3S/dYlcvOpKFl4JTtdRx1D4zMfJx3SYkdu+IZH0V17VXa/U 4yXw== X-Received: by 10.140.98.54 with SMTP id n51mr49249629qge.75.1444159345034; Tue, 06 Oct 2015 12:22:25 -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 p39sm8488717qkp.47.2015.10.06.12.22.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2015 12:22:24 -0700 (PDT) From: marcandre.lureau@redhat.com To: peter.maydell@linaro.org Date: Tue, 6 Oct 2015 21:19:42 +0200 Message-Id: <1444159184-18153-47-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444159184-18153-1-git-send-email-marcandre.lureau@redhat.com> References: <1444159184-18153-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::232 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 46/48] 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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 3283874..8581d43 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)