Received: by 2002:a19:ca48:0:0:0:0:0 with SMTP id h8csp1164086lfj; Mon, 10 Jan 2022 13:28:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlWgD6r1fs0gi9Hea2CC35YgxYm5AgI9+vVIVqgst0Lxkk4f9AEweaBD53uohZPqH77Hgu X-Received: by 2002:a25:d6d5:: with SMTP id n204mr2271056ybg.722.1641850124993; Mon, 10 Jan 2022 13:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641850124; cv=none; d=google.com; s=arc-20160816; b=aHMmHTzHpZ6Lhc6uVdDllJ1RpOdnJaoPtFsSK28CuDqNCr7RZDSwzZ4Adj+EY4Olfq ldkCXuAsBZ8hLBSjS2MoTAtl2tmoZ2Rt0hq6NEoDuDUgFtqAcrwNRf+YmzdWAYG+1gkS 1cN8e5BgcSbkNLJ5H9F+bJbvUvi3qAwv+hNXNHQjCFzCEfzENB851oe6c1M9CTbsiBJS s/ygWjUInHjHKguXF3hjB4mI4GjTd6QkEIrD8Drs17aRT8s3QEwqc0B2wFeOq26VBmbp tvUy6EFHLkXOccDYnQILlXWUxEqVVwLhduMFICPARh1AJN54lUNOR5XKnUsD4PCOhMQZ 7zCQ== 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=fjCPIX7sYGsduvwpSy5PHgafOy9bnm7tWzG6BwNeIdk=; b=amfHr6dZriivKakmeozm+DGUmI6yAKxyefdfWMA2+RDTHpi6q/Gz8/ArtlyEdX7F1l W94kTig50R67X86HYh4FG+2jJTrtNtOPVx021wX8mWlqcGmrqWzZbnW1rzwUVK/6H2w2 xsgQIiNOMCNqm44Ok66lBCesXejqjYvaqkT0duOF3RLmwQPyscZKGQmTmVzpay+BFeAk 1bMfF8H2YPrY/wFPRz3xIuWoU5X9bBW9pQNOhHVxxqQTukgQi0/M277ETDA35G1dLz3g 2cLsArCKt9tMHDOT07t8XBK4DgmAxNZTE3Ah+1jD08Q0Bh2LsVkA5pkVQkGr+rZ40nCi cLFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AadgRwSz; 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 o133si1678427ybc.7.2022.01.10.13.28.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jan 2022 13:28:44 -0800 (PST) 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=AadgRwSz; 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]:56938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n72Dc-00082t-CF for alex.bennee@linaro.org; Mon, 10 Jan 2022 16:28:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n725p-0005V0-O8 for qemu-arm@nongnu.org; Mon, 10 Jan 2022 16:20:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:32376) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n725o-0006nl-3r for qemu-arm@nongnu.org; Mon, 10 Jan 2022 16:20:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641849639; 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=fjCPIX7sYGsduvwpSy5PHgafOy9bnm7tWzG6BwNeIdk=; b=AadgRwSzXvnw05vH2ZYitzCDsn+NZP1XEeb1P/7ioNd6jC98UqFOu8sIz+f5qVibAFaDEQ L4bF4wZc8OxB+h2I9yW0SGs7okyU/945Wl3gNAo1E33KQXoM7o5J9PF5QMle6Ui0wrZl1P nEuk8GniwhKAfRwoL+SMVKIjc8vxyDc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-ve6blxYtMEiBBme_qUapIw-1; Mon, 10 Jan 2022 16:20:31 -0500 X-MC-Unique: ve6blxYtMEiBBme_qUapIw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A13D11935780; Mon, 10 Jan 2022 21:20:29 +0000 (UTC) Received: from laptop.redhat.com (unknown [10.39.194.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id E351E67846; Mon, 10 Jan 2022 21:20:26 +0000 (UTC) From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, thuth@redhat.com, pbonzini@redhat.com, lvivier@redhat.com, qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org, mst@redhat.com, david@gibson.dropbear.id.au, clg@kaod.org Subject: [PATCH 3/6] tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable Date: Mon, 10 Jan 2022 22:19:12 +0100 Message-Id: <20220110211915.2749082-4-eric.auger@redhat.com> In-Reply-To: <20220110211915.2749082-1-eric.auger@redhat.com> References: <20220110211915.2749082-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=170.10.129.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: WYdTVFT7/ZBU 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 --- 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 0273fe4c156..0d656d3af63 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("bus pci.0 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 44f6806fe44..6a28b405221 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 62e670f39be..cea2570884b 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("bus pci.0 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 2a236982118..0d5fa5b3247 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("bus pci.0 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 8bf74e516cc..fdf7dd750b9 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("bus pci.0 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 e6b8cd8e0cf..6b7d2b9eea4 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("bus pci.0 does not support hotplug"); + return; + } + const char *arch = qtest_get_arch(); qtest_qmp_device_add(qts, "virtio-rng-pci", "rng1", -- 2.26.3