From nobody Sun Nov 9 22:37:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155198123888226.53014985921368; Thu, 7 Mar 2019 09:53:58 -0800 (PST) Received: from localhost ([127.0.0.1]:56399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1xDK-00051M-U8 for importer@patchew.org; Thu, 07 Mar 2019 12:53:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wqS-0002ln-3k for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wqQ-0007oP-KR for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:12 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:40176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wqQ-0007lC-8z for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:30:10 -0500 Received: by mail-wm1-x344.google.com with SMTP id g20so9982133wmh.5 for ; Thu, 07 Mar 2019 09:30:10 -0800 (PST) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d206sm9979753wmc.11.2019.03.07.09.30.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 09:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/aneWvt80TmInYECf1xnPkchx/0HmGBT7HZv/bi5g2M=; b=L/VQaF3Bc5yTfwiKi8FubhUkfwQn9f1O1gX0amu7k0HP9TbRcc71/uyTxVMlDQkFMA 6jz703tzIYQEBnEcf/2nLqvUA+Fxwxa0is8szKiSTlauxAsWG31vfdjyzCUAWxAQhQUH 86l+VFpm8KB5psNMXpqhTpnTPyI+JuwrB1b0m8AMikD2ZXdZchS3fqLXvmEmU0RZ2LV5 DO5x1Sv3EiAUjfQ5r/ATdgOz0ZqqkUkHL1WbJAS4w+7DcSSZ14Bup3h9Q3GXl7/ULyb9 uj301C9EqdXsCSyMqT1c5SeGh6lQ6f15EmGxX7EGZz5SUan0Fw2rvbGCcpZ1TScKZ6US GrqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/aneWvt80TmInYECf1xnPkchx/0HmGBT7HZv/bi5g2M=; b=ULBICYO/gEbNYZZuEbVTu069aSxRmtNPLBk0ZDtvLU6i2HMX47FCQTLliWTL6zZppg ZdUjIIlOwhwmeuVH+qi4Ls3GTHztAJNXD6vVcnlcpd/uk0JUIXQrG/s7FjwB+1nPBoHG 2o2x96W6Jy3vNnflr/kF8YwDi3zhShJp/HqhvbazTCB3zRY7I5/3cnP4vrjNo9PIbEka ERSf/W4Jx3T06JEui9golpOZEswo87L3tJ+mQBEF6LqCT/5is3G8twjn15gNQVgAxUuj +wQwsrtEYcuijR/Kkofux43RInQUGA7I7BZuSlc7+VReqjVUx4j/7zQbPiGY3XKBK2tj LqbQ== X-Gm-Message-State: APjAAAVgTxGf12LX9U3ymDqi1/meBBXYC61WYbdZCJ4oCHsYX5RmQwjr zr7GDZRLb1pg8T1tVgFElgXq5u78 X-Google-Smtp-Source: APXvYqy5EYZi+XJ4mSpqNS9HKJnqQIsml6T7R5zPtEOQBCb6aJ7WukLO0ss1jfEvYSDzpdtW7zlI3w== X-Received: by 2002:a05:600c:224c:: with SMTP id a12mr6317706wmm.103.1551979808795; Thu, 07 Mar 2019 09:30:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 18:29:10 +0100 Message-Id: <1551979804-6060-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551979804-6060-1-git-send-email-pbonzini@redhat.com> References: <1551979804-6060-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PULL 03/57] tests/libqos: 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: thuth@redhat.com, Emanuele Giuseppe Esposito , lviver@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Emanuele Giuseppe Esposito Rename qpci_init_pc in qpci_pc_new and qpci_init_spapr in qpci_spapr_new, since these function actually allocate a new pci struct and initialize it (compare to object_new and object_initialize). Changed QOSOps field name from qpci_init to qpci_new. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- 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 | 12 +++++++++++- 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, 29 insertions(+), 19 deletions(-) diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c index c9408a5..5525589 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 4390e55..69205b5 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 300d64e..46898d9 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -157,7 +157,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 63fbc9e..cc1b08e 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 a9c1ace..293f9b6 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 a37791e..64addfe 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 c514187..6c91371 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 07d4b93..1af6035 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 a4fc02b..43d7082 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -116,7 +116,7 @@ static void qpci_pc_config_writel(QPCIBus *bus, int dev= fn, uint8_t offset, uint3 qtest_outl(bus->qts, 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 491eeac..5be68ba 100644 --- a/tests/libqos/pci-pc.h +++ b/tests/libqos/pci-pc.h @@ -16,7 +16,17 @@ #include "libqos/pci.h" #include "libqos/malloc.h" =20 -QPCIBus *qpci_init_pc(QTestState *qts, QGuestAllocator *alloc); +/* qpci_pc_new(): + * @qts: The %QTestState for this PC machine + * @alloc: A previously initialized @alloc providing memory for @qts + * + * This function creates a new QPCIBusPC object, + * and properly initialize its fields. + * + * Returns a newly allocated QPCIBus. + */ +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 4c29889..59679f6 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 387686d..177e8c0 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 7ea7acc..34b34bc 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 68bfc42..a85c91f 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 982f5eb..28d481b 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_initf("-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 6bee9a3..f89a42c 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 f28ea27..8bc3e44 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 770e1e6..611d3a7 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -197,7 +197,7 @@ static void init_virtio_dev(QTestState *qts, TestServer= *s, uint32_t features_ma uint32_t features; int i; =20 - s->bus =3D qpci_init_pc(qts, NULL); + s->bus =3D qpci_new_pc(qts, NULL); g_assert_nonnull(s->bus); =20 s->dev =3D qvirtio_pci_device_find(s->bus, VIRTIO_ID_NET); --=20 1.8.3.1