Received: by 2002:a19:e348:0:0:0:0:0 with SMTP id c8csp727972lfk; Thu, 14 Apr 2022 02:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrIo8btctNDWEcA3KulY4i0kZzO4ChCuz/24o6YWclHLQsaDpzgIUxyWeTDjlG072GRL5d X-Received: by 2002:ad4:44b4:0:b0:444:45d6:ec25 with SMTP id n20-20020ad444b4000000b0044445d6ec25mr2499700qvt.24.1649929358007; Thu, 14 Apr 2022 02:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649929358; cv=none; d=google.com; s=arc-20160816; b=BNOKbME2XQvICsDRevEC4tLBuqtkKNh7FDYnEOLD74gUSCptg24JSp0BWp88hDickg vB3IDfiDlao+gwtyz23Mxf9sMoJqsMufPpefL9SKqAH5uFPhoYwRwHaEvKRaWdDs/t3c dDlkoeG5zg6UcfDsI+F6MLxYOcDZYUVrl/ueGSaBa3xwLvje0EDJWU7+6TNiZmFxJfjr DldxOH1F1ThaQf5pv3hNvrrvgEEsrCRH3Nny+gw5CfGNzfpwOiiABShfBEKDnIbKEC5F E2N7ul8/K1TEX1xFi/R61MwXJq5OoAculFLvXUb05PN82s7UvpKWiP4JDIKhE6wMT/W6 2OVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=aKAb9JFdOAecOP9E3gJB9MjcNCB4nQEXTYYN4vIm/pQ=; b=fDkUkqgqmNRdB5f7jxpdCYrYsaKWLeH341i+3gL2g59oueJSvbFLNVAm33+/xCd7zL YZ6K7sQYJQTzupgCEKkRvNRqkhzTwctrBKNO8Mtdiyu/wL/8rxhMgOLC9/bvA9qEyxXG NJGMJrCvQTBgtMZnfnjxPBqquP/d9kggoK2q5o5GqF4wH+nPwIz3gavRUOUymo476adI 6+14Dw869Tm0AwUaGw8TCvJYSTKohJFZECfvdOlp6BLZQn77r0XCloHqn6/kxMYNkqpV 9lhRUbmq7CRUowkrIyBPlPeqMfVIYa1QxCUoI/7fhhh80AfvnJMbxwkLER2NX168jgKf gNyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WUY0Q1/I"; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e6-20020ac84e46000000b002f148dc10c6si3493291qtw.87.2022.04.14.02.42.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Apr 2022 02:42:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WUY0Q1/I"; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:52560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nevzp-0002kK-G3 for alex.bennee@linaro.org; Thu, 14 Apr 2022 05:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nevvY-0006HZ-De for qemu-arm@nongnu.org; Thu, 14 Apr 2022 05:38:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nevvW-00025m-4e for qemu-arm@nongnu.org; Thu, 14 Apr 2022 05:38:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649929089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aKAb9JFdOAecOP9E3gJB9MjcNCB4nQEXTYYN4vIm/pQ=; b=WUY0Q1/IMx9T5x3MhsAIWNosS/B+hImIuNVbcDsCx7bxiRU78IruUrEFbFIN/taH6nbBe8 tx2qKspkCL30Elz4aTjHYXDlacJNTT9q6tS7RTY3e4E6S52PeS0/4pNz4ZXaEoNlrtwovc qI8f5+W7Q5wTWMZQzvUF/CVRVonFBqU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-396-Kq03LfUyPA2wXmwbmLSUvQ-1; Thu, 14 Apr 2022 05:38:05 -0400 X-MC-Unique: Kq03LfUyPA2wXmwbmLSUvQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79017185A79C; Thu, 14 Apr 2022 09:38:04 +0000 (UTC) Received: from laptop.redhat.com (unknown [10.39.192.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C72343247D; Thu, 14 Apr 2022 09:38:02 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, pbonzini@redhat.com, qemu-arm@nongnu.org, qemu-devel@nongnu.org, mst@redhat.com, david@gibson.dropbear.id.au, clg@kaod.org, eesposit@redhat.com, Coiby.Xu@gmail.com, stefanha@redhat.com Subject: [PATCH v5 2/3] tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable Date: Thu, 14 Apr 2022 11:37:53 +0200 Message-Id: <20220414093754.1034556-3-eric.auger@redhat.com> In-Reply-To: <20220414093754.1034556-1-eric.auger@redhat.com> References: <20220414093754.1034556-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.133.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jean-philippe@linaro.org Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: yiGDa30+uJOG ARM does not not support hotplug on pcie.0. Add a flag on the bus which tells if devices can be hotplugged and skip hotplug tests if the bus cannot be hotplugged. This is a temporary solution to enable the other pci tests on aarch64. Signed-off-by: Eric Auger Acked-by: Thomas Huth Reviewed-by: Alex Bennée --- v1 ->v2: - reword g_test_skip msg into "pci bus does not support hotplug" --- tests/qtest/e1000e-test.c | 6 ++++++ tests/qtest/libqos/pci.h | 1 + tests/qtest/vhost-user-blk-test.c | 10 ++++++++++ tests/qtest/virtio-blk-test.c | 5 +++++ tests/qtest/virtio-net-test.c | 5 +++++ tests/qtest/virtio-rng-test.c | 5 +++++ 6 files changed, 32 insertions(+) diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c index e648fdd409..ad6d7f9303 100644 --- a/tests/qtest/e1000e-test.c +++ b/tests/qtest/e1000e-test.c @@ -235,6 +235,12 @@ static void test_e1000e_multiple_transfers(void *obj, void *data, static void test_e1000e_hotplug(void *obj, void *data, QGuestAllocator * alloc) { QTestState *qts = global_qtest; /* TODO: get rid of global_qtest here */ + QE1000E_PCI *dev = obj; + + if (dev->pci_dev.bus->not_hotpluggable) { + g_test_skip("pci bus does not support hotplug"); + return; + } qtest_qmp_device_add(qts, "e1000e", "e1000e_net", "{'addr': '0x06'}"); qpci_unplug_acpi_device_test(qts, "e1000e_net", 0x06); diff --git a/tests/qtest/libqos/pci.h b/tests/qtest/libqos/pci.h index 44f6806fe4..6a28b40522 100644 --- a/tests/qtest/libqos/pci.h +++ b/tests/qtest/libqos/pci.h @@ -52,6 +52,7 @@ struct QPCIBus { uint64_t pio_alloc_ptr, pio_limit; uint64_t mmio_alloc_ptr, mmio_limit; bool has_buggy_msi; /* TRUE for spapr, FALSE for pci */ + bool not_hotpluggable; /* TRUE if devices cannot be hotplugged */ }; diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c index 62e670f39b..1316aae0fa 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -676,6 +676,11 @@ static void pci_hotplug(void *obj, void *data, QGuestAllocator *t_alloc) QVirtioPCIDevice *dev; QTestState *qts = dev1->pdev->bus->qts; + if (dev1->pdev->bus->not_hotpluggable) { + g_test_skip("pci bus does not support hotplug"); + return; + } + /* plug secondary disk */ qtest_qmp_device_add(qts, "vhost-user-blk-pci", "drv1", "{'addr': %s, 'chardev': 'char2'}", @@ -703,6 +708,11 @@ static void multiqueue(void *obj, void *data, QGuestAllocator *t_alloc) uint64_t features; uint16_t num_queues; + if (pdev1->pdev->bus->not_hotpluggable) { + g_test_skip("bus pci.0 does not support hotplug"); + return; + } + /* * The primary device has 1 queue and VIRTIO_BLK_F_MQ is not enabled. The * VIRTIO specification allows VIRTIO_BLK_F_MQ to be enabled when there is diff --git a/tests/qtest/virtio-blk-test.c b/tests/qtest/virtio-blk-test.c index 2a23698211..acb44c9fb8 100644 --- a/tests/qtest/virtio-blk-test.c +++ b/tests/qtest/virtio-blk-test.c @@ -701,6 +701,11 @@ static void pci_hotplug(void *obj, void *data, QGuestAllocator *t_alloc) QVirtioPCIDevice *dev; QTestState *qts = dev1->pdev->bus->qts; + if (dev1->pdev->bus->not_hotpluggable) { + g_test_skip("pci bus does not support hotplug"); + return; + } + /* plug secondary disk */ qtest_qmp_device_add(qts, "virtio-blk-pci", "drv1", "{'addr': %s, 'drive': 'drive1'}", diff --git a/tests/qtest/virtio-net-test.c b/tests/qtest/virtio-net-test.c index a71395849f..e54817f154 100644 --- a/tests/qtest/virtio-net-test.c +++ b/tests/qtest/virtio-net-test.c @@ -174,6 +174,11 @@ static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc) QTestState *qts = dev->pdev->bus->qts; const char *arch = qtest_get_arch(); + if (dev->pdev->bus->not_hotpluggable) { + g_test_skip("pci bus does not support hotplug"); + return; + } + qtest_qmp_device_add(qts, "virtio-net-pci", "net1", "{'addr': %s}", stringify(PCI_SLOT_HP)); diff --git a/tests/qtest/virtio-rng-test.c b/tests/qtest/virtio-rng-test.c index e6b8cd8e0c..5ce444ad72 100644 --- a/tests/qtest/virtio-rng-test.c +++ b/tests/qtest/virtio-rng-test.c @@ -20,6 +20,11 @@ static void rng_hotplug(void *obj, void *data, QGuestAllocator *alloc) QVirtioPCIDevice *dev = obj; QTestState *qts = dev->pdev->bus->qts; + if (dev->pdev->bus->not_hotpluggable) { + g_test_skip("pci bus does not support hotplug"); + return; + } + const char *arch = qtest_get_arch(); qtest_qmp_device_add(qts, "virtio-rng-pci", "rng1", -- 2.26.3