From nobody Tue Nov 4 21:59:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533566209576742.9541886779499; Mon, 6 Aug 2018 07:36:49 -0700 (PDT) Received: from localhost ([::1]:34358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmgcm-00065e-Id for importer@patchew.org; Mon, 06 Aug 2018 10:36:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmgan-0004X4-Jf for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:34:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmgam-0000lo-8n for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:34:41 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:39991) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fmgal-0000lN-UK for qemu-devel@nongnu.org; Mon, 06 Aug 2018 10:34:40 -0400 Received: by mail-ed1-x543.google.com with SMTP id e19-v6so5244512edq.7 for ; Mon, 06 Aug 2018 07:34:39 -0700 (PDT) Received: from localhost.localdomain ([194.230.159.126]) by smtp.gmail.com with ESMTPSA id x13-v6sm14615157edx.17.2018.08.06.07.34.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 07:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1MuafVMM0Aksw3x3YUH++8QaAQ8YEfgVjDdRhY5xWA0=; b=N1GNeBn79o9RB9apEyL0GN9UCG1VMnSyZJphifGTCxqX3aE6waFAJ4sZlMpK7+yoj5 kZSW/czJ96pgCYtjWOWQsA8IuuXr9EQ5qXl7eKBYEpbD3cRMXMN6fbzAQp2adZxxCFPh YtORK6pE3k4wbfmthImsN8SzymfyQ/uZvPdSpuIFkJqsczpbnKreob06+/tLZYacOzge eg0YW+CBWFycFVcctnUsrhSMQJzDzpS+m4LSxUwrgFtXRXn2FPNbB1g+S+bjeyCwsHvP RIP+UmFOe1PK2ycjbTpQJiwTyg5OZJeCE1g8OW6dLT7jKBFrBSLYBtkED2s5H+YyIXt8 9V4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1MuafVMM0Aksw3x3YUH++8QaAQ8YEfgVjDdRhY5xWA0=; b=P/YXW4xoDtHiZoLI28p6eig+audTv5tv9D7zt2HVuagcAAIhnaMN0h6Hl8zm//74hu ymUdAWTAuyFzq169R1ClxZiLHUVs/Naj3IekFF2eCCnE2JPgpCWPvJh2UiqSqAb+++Bw IRNbHKbrgBZCa/vzVsk9fmjCaxuZvUDvP5WM4r7mhewoHuV6QY062dNp2MvsV3PcV0h1 l2pUbhb2QeBcDgibtkI25t0GY4Fwe3pb1KW/I26nkgitrKLsjVr62AMMnmXca4kydbuH QrAai30zxedIS1vPoD41YwSb99M3nPJXkaZJtyFpDfj2E5szVCDYJZrsgxGGq/K4AsV8 Cp9Q== X-Gm-Message-State: AOUpUlFrx6siXxLkLXW5T/jX14asz/zFBVAFmxa8VyMmnHqCGyvpDpAf RLyXQhrbd3C2ofzRYi+09s8= X-Google-Smtp-Source: AAOMgpcO1zZmVBtpkT8KjUJpsFItSdkAmiAm3Oau85OEcXFYX+f7DSCU6IDWXoxxMYEjj+vYoe3b6w== X-Received: by 2002:a50:d1c7:: with SMTP id i7-v6mr18469739edg.169.1533566078794; Mon, 06 Aug 2018 07:34:38 -0700 (PDT) From: Emanuele Giuseppe Esposito To: Paolo Bonzini Date: Mon, 6 Aug 2018 16:33:40 +0200 Message-Id: <20180806143412.27722-3-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180806143412.27722-1-e.emanuelegiuseppe@gmail.com> References: <20180806143412.27722-1-e.emanuelegiuseppe@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::543 Subject: [Qemu-devel] [PATCH v2 02/34] tests/qgraph: rename qpci_init_pc functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Stefan Hajnoczi , Emanuele Giuseppe Esposito , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Rename qpci_init_pc in qpci_new_pc, since the function actually allocates a new QPCIBusPC and initialize it. Signed-off-by: Emanuele Giuseppe Esposito --- tests/e1000e-test.c | 2 +- tests/i440fx-test.c | 2 +- tests/ide-test.c | 2 +- tests/libqos/ahci.c | 2 +- tests/libqos/libqos-pc.c | 2 +- tests/libqos/pci-pc.c | 2 +- tests/libqos/pci-pc.h | 9 ++++++++- tests/q35-test.c | 4 ++-- tests/rtl8139-test.c | 2 +- tests/sdhci-test.c | 2 +- tests/tco-test.c | 2 +- tests/usb-hcd-ehci-test.c | 2 +- tests/vhost-user-test.c | 2 +- 13 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c index 32aa738b72..51b9dda404 100644 --- a/tests/e1000e-test.c +++ b/tests/e1000e-test.c @@ -395,7 +395,7 @@ static void data_test_init(e1000e_device *d) test_alloc =3D pc_alloc_init(global_qtest); g_assert_nonnull(test_alloc); =20 - test_bus =3D qpci_init_pc(global_qtest, test_alloc); + test_bus =3D qpci_pc_new(global_qtest, test_alloc); g_assert_nonnull(test_bus); =20 e1000e_device_init(test_bus, d); diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c index 4390e5591e..acee5e6572 100644 --- a/tests/i440fx-test.c +++ b/tests/i440fx-test.c @@ -38,7 +38,7 @@ static QPCIBus *test_start_get_bus(const TestData *s) cmdline =3D g_strdup_printf("-smp %d", s->num_cpus); qtest_start(cmdline); g_free(cmdline); - return qpci_init_pc(global_qtest, NULL); + return qpci_pc_new(global_qtest, NULL); } =20 static void test_i440fx_defaults(gconstpointer opaque) diff --git a/tests/ide-test.c b/tests/ide-test.c index 2384c2c3e2..fce9692ba2 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -150,7 +150,7 @@ static QPCIDevice *get_pci_device(QPCIBar *bmdma_bar, Q= PCIBar *ide_bar) uint16_t vendor_id, device_id; =20 if (!pcibus) { - pcibus =3D qpci_init_pc(global_qtest, NULL); + pcibus =3D qpci_pc_new(global_qtest, NULL); } =20 /* Find PCI device and verify it's the right one */ diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 42d3f76933..4ec516a8c9 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -130,7 +130,7 @@ QPCIDevice *get_ahci_device(QTestState *qts, uint32_t *= fingerprint) uint32_t ahci_fingerprint; QPCIBus *pcibus; =20 - pcibus =3D qpci_init_pc(qts, NULL); + pcibus =3D qpci_pc_new(qts, NULL); =20 /* Find the AHCI PCI device and verify it's the right one. */ ahci =3D qpci_device_find(pcibus, QPCI_DEVFN(0x1F, 0x02)); diff --git a/tests/libqos/libqos-pc.c b/tests/libqos/libqos-pc.c index a9c1aceaa7..72b3eb46f5 100644 --- a/tests/libqos/libqos-pc.c +++ b/tests/libqos/libqos-pc.c @@ -6,7 +6,7 @@ static QOSOps qos_ops =3D { .init_allocator =3D pc_alloc_init_flags, .uninit_allocator =3D pc_alloc_uninit, - .qpci_init =3D qpci_init_pc, + .qpci_init =3D qpci_pc_new, .qpci_free =3D qpci_free_pc, .shutdown =3D qtest_pc_shutdown, }; diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index a7803308b7..83a3a32129 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -115,7 +115,7 @@ static void qpci_pc_config_writel(QPCIBus *bus, int dev= fn, uint8_t offset, uint3 outl(0xcfc, value); } =20 -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc) +QPCIBus *qpci_pc_new(QTestState *qts, QGuestAllocator *alloc) { QPCIBusPC *ret =3D g_new0(QPCIBusPC, 1); =20 diff --git a/tests/libqos/pci-pc.h b/tests/libqos/pci-pc.h index 491eeac756..88be29eaf3 100644 --- a/tests/libqos/pci-pc.h +++ b/tests/libqos/pci-pc.h @@ -16,7 +16,14 @@ #include "libqos/pci.h" #include "libqos/malloc.h" =20 -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc); +/* qpci_pc_new(): +* this function creates a new QPCIBusPC object, + * and properly initialize its fields. + * + * returns the QPCIBus *bus field of a newly + * allocated QPCIBusPC. + */ +QPCIBus *qpci_pc_new(QTestState *qts, QGuestAllocator *alloc); void qpci_free_pc(QPCIBus *bus); =20 #endif diff --git a/tests/q35-test.c b/tests/q35-test.c index 7ea7acc9d8..e3da12ee8c 100644 --- a/tests/q35-test.c +++ b/tests/q35-test.c @@ -87,7 +87,7 @@ static void test_smram_lock(void) =20 qtest_start("-M q35"); =20 - pcibus =3D qpci_init_pc(global_qtest, NULL); + pcibus =3D qpci_pc_new(global_qtest, NULL); g_assert(pcibus !=3D NULL); =20 pcidev =3D qpci_device_find(pcibus, 0); @@ -146,7 +146,7 @@ static void test_tseg_size(const void *data) g_free(cmdline); =20 /* locate the DRAM controller */ - pcibus =3D qpci_init_pc(global_qtest, NULL); + pcibus =3D qpci_pc_new(global_qtest, NULL); g_assert(pcibus !=3D NULL); pcidev =3D qpci_device_find(pcibus, 0); g_assert(pcidev !=3D NULL); diff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c index 68bfc42178..d9045b46c2 100644 --- a/tests/rtl8139-test.c +++ b/tests/rtl8139-test.c @@ -35,7 +35,7 @@ static QPCIDevice *get_device(void) { QPCIDevice *dev; =20 - pcibus =3D qpci_init_pc(global_qtest, NULL); + pcibus =3D qpci_pc_new(global_qtest, NULL); qpci_device_foreach(pcibus, 0x10ec, 0x8139, save_fn, &dev); g_assert(dev !=3D NULL); =20 diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 1d825eb010..5e97590573 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -187,7 +187,7 @@ static QSDHCI *machine_start(const struct sdhci_t *test) global_qtest =3D qtest_startf("-machine %s -device sdhci-pci", test->machine); =20 - s->pci.bus =3D qpci_init_pc(global_qtest, NULL); + s->pci.bus =3D qpci_pc_new(global_qtest, NULL); =20 /* Find PCI device and verify it's the right one */ s->pci.dev =3D qpci_device_find(s->pci.bus, QPCI_DEVFN(4, 0)); diff --git a/tests/tco-test.c b/tests/tco-test.c index 9945fb8469..2f99824d54 100644 --- a/tests/tco-test.c +++ b/tests/tco-test.c @@ -64,7 +64,7 @@ static void test_init(TestData *d) global_qtest =3D qs; qtest_irq_intercept_in(qs, "ioapic"); =20 - d->bus =3D qpci_init_pc(qs, NULL); + d->bus =3D qpci_pc_new(qs, NULL); d->dev =3D qpci_device_find(d->bus, QPCI_DEVFN(0x1f, 0x00)); g_assert(d->dev !=3D NULL); =20 diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c index 55d4743a2a..037e17f496 100644 --- a/tests/usb-hcd-ehci-test.c +++ b/tests/usb-hcd-ehci-test.c @@ -52,7 +52,7 @@ static void ehci_port_test(struct qhc *hc, int port, uint= 32_t expect) =20 static void test_init(void) { - pcibus =3D qpci_init_pc(global_qtest, NULL); + pcibus =3D qpci_pc_new(global_qtest, NULL); g_assert(pcibus !=3D NULL); =20 qusb_pci_init_one(pcibus, &uhci1, QPCI_DEVFN(0x1d, 0), 4); diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index fecc832d99..a01b81d342 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -191,7 +191,7 @@ static void init_virtio_dev(TestServer *s, uint32_t fea= tures_mask) uint32_t features; int i; =20 - s->bus =3D qpci_init_pc(global_qtest, NULL); + s->bus =3D qpci_pc_new(global_qtest, NULL); g_assert_nonnull(s->bus); =20 s->dev =3D qvirtio_pci_device_find(s->bus, VIRTIO_ID_NET); --=20 2.17.1