From nobody Wed Nov 5 10:44:09 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 1534155455452516.2572278511323; Mon, 13 Aug 2018 03:17:35 -0700 (PDT) Received: from localhost ([::1]:38497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp9uo-0008O1-5J for importer@patchew.org; Mon, 13 Aug 2018 06:17:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fp9sV-00070s-3v for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:15:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fp9sT-0001n7-Er for qemu-devel@nongnu.org; Mon, 13 Aug 2018 06:15:11 -0400 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:45766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fp9sT-0001lJ-5a; Mon, 13 Aug 2018 06:15:09 -0400 Received: by mail-ed1-x543.google.com with SMTP id s16-v6so7927303edq.12; Mon, 13 Aug 2018 03:15:09 -0700 (PDT) Received: from localhost.localdomain ([194.230.159.125]) by smtp.gmail.com with ESMTPSA id s27-v6sm11670006edb.73.2018.08.13.03.15.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 03:15:07 -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=DtqQ5CJT2lejwSj6R7RIJef2mq8Kz8Vg8wSlET613t0=; b=UxXeo5uBGZiikmSET/dg+bcveKHbciYUD0Hoy6gB2Cs6UQBALR2qIDuMP20ftLGsqR kOH77izhEjF4qPBPAupe9xO0MIaz+Z6WN893os6c4SEn+V7PVqxxNru6Fw8kT9I2GJm6 jb9ULhxhOUEYtYATB1ItaufVRgbNI1/Dx5t8CUxKquojNWw+YFmcSJttOxGliQ7aUbT4 pH8dumfXrUS5ax9o+sjvOlSQfcUDo+8zC/nRCyEEHqXmuiz/C/d6Osn4O+6jjavi3NTL s1fY7EpchjDjW9rduhYNK+FB2qta5p/mjrMNcj/b3QTjhOOFRwlimf+3lpXhlNWC5FTO OwWw== 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=DtqQ5CJT2lejwSj6R7RIJef2mq8Kz8Vg8wSlET613t0=; b=kSv3meuacR0YrfoueWTq2/BE82fC+RlDuLJIbuklxD3XFLhzDS6inx+Y6dXdTHhvOP WC0yYw82N+Xt32MNbWHf0ZPPv7JqggnYlnhJdBNIzlfW662xY4i1rzu5EBPWEz93mB42 p0Ih72MOx9aZc7u/NcJZO5dUQO7gjLqhVJLaui3DVKXoL7aEo0eixqy1qufpMq3Dv2Ct TUZWD7JzFtrNdMHF82vJLdaVE1hoGkgNNd2uDs0yp9UKwo55IxdnPp0ATo3fOW6YaFCK 6Bgw3JY+uc08Ue+rMUX/forh4xFoi/5Vb8l/C1D1z2effBFRuNuLfXoAj4WmWi43H/zf okjA== X-Gm-Message-State: AOUpUlHkByi8/yxZ/9UUJ70eHt5EdQEmc9TgrQ/NgE88+Mzw01u+8i/u tQDCJg0sXtnNPLKvQ2+nXUjZNR5t0nY= X-Google-Smtp-Source: AA+uWPwpn7KFvee5G8vAqsUGV/dkgUcgoP1A6aIoy4vCAC9Vy6ZLRQEEUNmEDbQxcbIVInDdyJqM0g== X-Received: by 2002:a50:87a8:: with SMTP id a37-v6mr21537408eda.31.1534155307647; Mon, 13 Aug 2018 03:15:07 -0700 (PDT) From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2018 12:14:22 +0200 Message-Id: <20180813101453.10200-3-e.emanuelegiuseppe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813101453.10200-1-e.emanuelegiuseppe@gmail.com> References: <20180813101453.10200-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 02/33] tests/qgraph: rename qpci_init_pc and qpci_init_spapr 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 , Fam Zheng , qemu-block@nongnu.org, "Michael S. Tsirkin" , Jason Wang , Amit Shah , Emanuele Giuseppe Esposito , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Greg Kurz , qemu-ppc@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow , David Gibson 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_pc_new and qpci_init_spapr in qpci_spapr_new, since theese function actually allocate a new pci struct and initialize it. Changed QOSOps field name from qpci_init to qpci_new. 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/libqos-spapr.c | 2 +- tests/libqos/libqos.c | 2 +- tests/libqos/libqos.h | 2 +- tests/libqos/pci-pc.c | 2 +- tests/libqos/pci-pc.h | 9 ++++++++- tests/libqos/pci-spapr.c | 2 +- tests/libqos/pci-spapr.h | 2 +- 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 +- 18 files changed, 26 insertions(+), 19 deletions(-) diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c index 32aa738b72..574801fd38 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_new_pc(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..69205b58a8 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_new_pc(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..ab1fac6074 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_new_pc(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..36814b4a38 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_new_pc(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..293f9b6fe6 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_new =3D qpci_new_pc, .qpci_free =3D qpci_free_pc, .shutdown =3D qtest_pc_shutdown, }; diff --git a/tests/libqos/libqos-spapr.c b/tests/libqos/libqos-spapr.c index a37791e5d0..64addfe577 100644 --- a/tests/libqos/libqos-spapr.c +++ b/tests/libqos/libqos-spapr.c @@ -6,7 +6,7 @@ static QOSOps qos_ops =3D { .init_allocator =3D spapr_alloc_init_flags, .uninit_allocator =3D spapr_alloc_uninit, - .qpci_init =3D qpci_init_spapr, + .qpci_new =3D qpci_new_spapr, .qpci_free =3D qpci_free_spapr, .shutdown =3D qtest_spapr_shutdown, }; diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c index 013ca68581..48b9682d81 100644 --- a/tests/libqos/libqos.c +++ b/tests/libqos/libqos.c @@ -25,7 +25,7 @@ QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fm= t, va_list ap) qs->ops =3D ops; if (ops) { qs->alloc =3D ops->init_allocator(qs->qts, ALLOC_NO_FLAGS); - qs->pcibus =3D ops->qpci_init(qs->qts, qs->alloc); + qs->pcibus =3D ops->qpci_new(qs->qts, qs->alloc); } =20 g_free(cmdline); diff --git a/tests/libqos/libqos.h b/tests/libqos/libqos.h index 07d4b93d1d..1af6035db4 100644 --- a/tests/libqos/libqos.h +++ b/tests/libqos/libqos.h @@ -10,7 +10,7 @@ typedef struct QOSState QOSState; typedef struct QOSOps { QGuestAllocator *(*init_allocator)(QTestState *qts, QAllocOpts); void (*uninit_allocator)(QGuestAllocator *); - QPCIBus *(*qpci_init)(QTestState *qts, QGuestAllocator *alloc); + QPCIBus *(*qpci_new)(QTestState *qts, QGuestAllocator *alloc); void (*qpci_free)(QPCIBus *bus); void (*shutdown)(QOSState *); } QOSOps; diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index a7803308b7..644f45d8b0 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_new_pc(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..84cc300735 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_new_pc(): +* this function creates a new QPCIBusPC object, + * and properly initialize its fields. + * + * returns the QPCIBus *bus field of a newly + * allocated QPCIBusPC. + */ +QPCIBus *qpci_new_pc(QTestState *qts, QGuestAllocator *alloc); void qpci_free_pc(QPCIBus *bus); =20 #endif diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c index c0f7e6db9b..f306cb746d 100644 --- a/tests/libqos/pci-spapr.c +++ b/tests/libqos/pci-spapr.c @@ -160,7 +160,7 @@ static void qpci_spapr_config_writel(QPCIBus *bus, int = devfn, uint8_t offset, #define SPAPR_PCI_MMIO32_WIN_SIZE 0x80000000 /* 2 GiB */ #define SPAPR_PCI_IO_WIN_SIZE 0x10000 =20 -QPCIBus *qpci_init_spapr(QTestState *qts, QGuestAllocator *alloc) +QPCIBus *qpci_new_spapr(QTestState *qts, QGuestAllocator *alloc) { QPCIBusSPAPR *ret =3D g_new0(QPCIBusSPAPR, 1); =20 diff --git a/tests/libqos/pci-spapr.h b/tests/libqos/pci-spapr.h index 387686dfc8..177e8c002c 100644 --- a/tests/libqos/pci-spapr.h +++ b/tests/libqos/pci-spapr.h @@ -11,7 +11,7 @@ #include "libqos/malloc.h" #include "libqos/pci.h" =20 -QPCIBus *qpci_init_spapr(QTestState *qts, QGuestAllocator *alloc); +QPCIBus *qpci_new_spapr(QTestState *qts, QGuestAllocator *alloc); void qpci_free_spapr(QPCIBus *bus); =20 #endif diff --git a/tests/q35-test.c b/tests/q35-test.c index 7ea7acc9d8..34b34bc2b9 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_new_pc(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_new_pc(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..a85c91f197 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_new_pc(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..be3bad6ceb 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_new_pc(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..538ebec036 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_new_pc(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..98b3038b2c 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_new_pc(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..a976808eba 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_new_pc(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