From nobody Sun Nov 9 22:26:49 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 1551983732674776.875726187852; Thu, 7 Mar 2019 10:35:32 -0800 (PST) Received: from localhost ([127.0.0.1]:57045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1xrd-0006rx-DJ for importer@patchew.org; Thu, 07 Mar 2019 13:35:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wrH-0003kF-5k for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:31:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wrG-000069-80 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:31:03 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:46334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wrF-00005E-Vt for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:31:02 -0500 Received: by mail-wr1-x430.google.com with SMTP id i16so18390203wrs.13 for ; Thu, 07 Mar 2019 09:31:01 -0800 (PST) Received: from 640k.localdomain ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id d206sm9979753wmc.11.2019.03.07.09.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 09:30:59 -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=v/S/LRbmh7uF37H5wG9u5QOYAF4PDKg5RTF0rQAsEI0=; b=WjeNqqE67yqARpTna9bbbKBlK7ynHqKLVh+n8TOfCuijLB/vaCgjZdOwbzYMZF1haf 2eMoeAGQp0UK5ojEs8JHBzDFHQxF7Md+kFYRgQuzInIyCVO34a+Pzkc0CoJGajFhc3gZ VkjFGzpytZp6Ahc9kK4IN8xInC1n7ThUPwf43Z/whGtUX95/CuxXJ/qwB0PoDWrPsJaJ Ch0wTcGKGkRxPYxT/70qegsQQ7uz/ioAVKdZwz0SRMSpwl346mtLXJC7T63nknZq+iuO 5hnKMurEMkZz7nAt9oE/hWVIasYqjmOp8aWfcdH/4+EFMTBGDTe3++hNXXi5cE4UZr5F p0aw== 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=v/S/LRbmh7uF37H5wG9u5QOYAF4PDKg5RTF0rQAsEI0=; b=GS+SRUftT9X73dyre16nEWnE+ELcar0skKqwByXy6DmPSIxF180/3seRe3qaK8inX1 G6xN0UZJxu7Nj0QjiYm1l1UZS+OFYBpJpAuYahGfujcNEVEKZKoQX8bL8mGTsRuivd6+ A5ZYa27LhOiT5edmv1N20se7/sY8X+NjLf6UFwQdGP7/hW5U6nP9djq/V5KckeH7F6vQ DEKUNsHodkJ5u+jiFwWwJ3aUG8xiVeV9Tp0css5mfsmFV8NMnY3Kjy0KhhKfsqWK2jv8 TnfSt25Nu69mAhz7ZUEaYzO7On2bRyqN+QKbh3lRmQkrX1aji0AihV+meqk2tbojvmix EwGg== X-Gm-Message-State: APjAAAUddNWxbIfp2lz3C65BcrIkfH+XEjUB968hLhyTL+8tIhEu6H1V AcFcMw8d2SOkEPNtkZXcALjkccz1 X-Google-Smtp-Source: APXvYqzTiqKNy4q+Z65Exm84IMO1ciqukm7wATKJ+e34ylT+15e3+/lAzqIGh94j7woTDbMdH2Z1BQ== X-Received: by 2002:a5d:6a8e:: with SMTP id s14mr7609506wru.31.1551979860551; Thu, 07 Mar 2019 09:31:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 18:29:54 +0100 Message-Id: <1551979804-6060-48-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::430 Subject: [Qemu-devel] [PULL 47/57] qos-test: ipoctal232 test node 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 Convert tests/ipoctal232-test to a driver node; currently it runs the PCI nop test only, therefore we're not placing it in tests/libqos. This test creates a tpci200 node that produces an interface ipack consumed by the ipoctal232 device. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Paolo Bonzini --- tests/Makefile.include | 5 +---- tests/ipoctal232-test.c | 35 ++++++++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 905a361..3eaa888 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -151,8 +151,6 @@ check-qtest-generic-y +=3D tests/qmp-cmd-test$(EXESUF) check-qtest-generic-y +=3D tests/device-introspect-test$(EXESUF) check-qtest-generic-y +=3D tests/cdrom-test$(EXESUF) =20 -check-qtest-ipack-y +=3D tests/ipoctal232-test$(EXESUF) - check-qtest-pci-y +=3D tests/e1000-test$(EXESUF) check-qtest-pci-$(CONFIG_RTL8139_PCI) +=3D tests/rtl8139-test$(EXESUF) check-qtest-pci-$(CONFIG_PCNET_PCI) +=3D tests/pcnet-test$(EXESUF) @@ -160,7 +158,6 @@ check-qtest-pci-$(CONFIG_EEPRO100_PCI) +=3D tests/eepro= 100-test$(EXESUF) check-qtest-pci-$(CONFIG_NE2000_PCI) +=3D tests/ne2000-test$(EXESUF) check-qtest-pci-$(CONFIG_NVME_PCI) +=3D tests/nvme-test$(EXESUF) check-qtest-pci-$(CONFIG_ES1370) +=3D tests/es1370-test$(EXESUF) -check-qtest-pci-$(CONFIG_IPACK) +=3D $(check-qtest-ipack-y) check-qtest-pci-$(CONFIG_VGA) +=3D tests/display-vga-test$(EXESUF) check-qtest-pci-$(CONFIG_HDA) +=3D tests/intel-hda-test$(EXESUF) check-qtest-pci-$(CONFIG_IVSHMEM_DEVICE) +=3D tests/ivshmem-test$(EXESUF) @@ -755,6 +752,7 @@ qos-test-obj-y +=3D tests/libqos/x86_64_pc-machine.o # Tests qos-test-obj-y +=3D tests/ac97-test.o qos-test-obj-y +=3D tests/e1000e-test.o +qos-test-obj-y +=3D tests/ipoctal232-test.o qos-test-obj-y +=3D tests/pci-test.o qos-test-obj-y +=3D tests/sdhci-test.o qos-test-obj-$(CONFIG_VHOST_NET_USER) +=3D tests/vhost-user-test.o $(chard= ev-obj-y) $(test-io-obj-y) @@ -812,7 +810,6 @@ tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) tests/virtio-ccw-test$(EXESUF): tests/virtio-ccw-test.o tests/display-vga-test$(EXESUF): tests/display-vga-test.o -tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o tests/qom-test$(EXESUF): tests/qom-test.o tests/test-hmp$(EXESUF): tests/test-hmp.o tests/machine-none-test$(EXESUF): tests/machine-none-test.o diff --git a/tests/ipoctal232-test.c b/tests/ipoctal232-test.c index 6849141..42d5371 100644 --- a/tests/ipoctal232-test.c +++ b/tests/ipoctal232-test.c @@ -9,23 +9,40 @@ =20 #include "qemu/osdep.h" #include "libqtest.h" +#include "libqos/qgraph.h" + +typedef struct QIpoctal232 QIpoctal232; + +struct QIpoctal232 { + QOSGraphObject obj; +}; =20 /* Tests only initialization so far. TODO: Replace with functional tests */ -static void nop(void) +static void nop(void *obj, void *data, QGuestAllocator *alloc) { } =20 -int main(int argc, char **argv) +static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc, + void *addr) { - int ret; + QIpoctal232 *ipoctal232 =3D g_new0(QIpoctal232, 1); =20 - g_test_init(&argc, &argv, NULL); - qtest_add_func("/ipoctal232/tpci200/nop", nop); + return &ipoctal232->obj; +} =20 - qtest_start("-device tpci200,id=3Dipack0 -device ipoctal232,bus=3Dipac= k0.0"); - ret =3D g_test_run(); +static void ipoctal232_register_nodes(void) +{ + qos_node_create_driver("ipoctal232", ipoctal232_create); + qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) { + .extra_device_opts =3D "bus=3Dipack0.0", + }); +} =20 - qtest_end(); +libqos_init(ipoctal232_register_nodes); =20 - return ret; +static void register_ipoctal232_test(void) +{ + qos_add_test("nop", "ipoctal232", nop, NULL); } + +libqos_init(register_ipoctal232_test); --=20 1.8.3.1