From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586071; cv=none; d=zohomail.com; s=zohoarc; b=K0+KpNWoQumLmx+gXsD8mFfBV5p9lpCzBoQlexxbRg9bmNtTae4Xs4Rw8Wsz083NJzKKMkONuB8ixlEuXFtXE/hnZl3kLkX4lyTwjC1Hw+T3+YbVL8U1xK3ZHtKTC/shYxGBr9my5kooibTmUG+IzpeaqcsfEbjbAXAHbJCUmjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586071; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QqveO/aqglIimPwR8DhhgAfvf0vgvXxNcRV5shjf3iA=; b=VuGOMDJQYmty9P0aa9rBAt5bRguP0FUdFveYYZ8ulnTt3BoCTczhTg3p35zcBIeuwXGqT/OYLnCUv+kRtJ9ACgK0Fag7L13nH1YOA/rlbDFlIdiWyRN0OVQv83s4YiROucDOweq4Fc0LRfbWprRIjDf4PiFbb+m90E87i1O8GpM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586071366836.4287351393572; Wed, 12 Oct 2022 07:47:51 -0700 (PDT) Received: from localhost ([::1]:58942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid1R-0002r1-MK for importer@patchew.org; Wed, 12 Oct 2022 10:47:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnW-0004yc-4h for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnT-0006jJ-FR for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:24 -0400 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-67-lnSKTmGgM9uv1lXE6QVjqA-1; Wed, 12 Oct 2022 10:33:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF8A2959740 for ; Wed, 12 Oct 2022 14:33:20 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AB112144B20; Wed, 12 Oct 2022 14:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QqveO/aqglIimPwR8DhhgAfvf0vgvXxNcRV5shjf3iA=; b=BnsLpo0tpNbSc0ueCGB/+SXUN4W0XCSbqeCJA7dUBYjS3bW7fsUqofNEu13JRERRyNUrhu oaRUOkTDGmFmO86bF9IgAI6b6Uh9N5wnweqmFC5pt5CFFsToYhFanYREtotDuKGA9ln7qd IKpJJQxR/lUWaDPdiDzGVbym84SS1OQ= X-MC-Unique: lnSKTmGgM9uv1lXE6QVjqA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Juan Quintela Subject: [PULL 01/16] qtest: "-display none" is set in qtest_init() Date: Wed, 12 Oct 2022 16:33:01 +0200 Message-Id: <20221012143316.988561-2-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586072524100001 Content-Type: text/plain; charset="utf-8" From: Juan Quintela So we don't need to set anywhere else. Signed-off-by: Juan Quintela [thuth: Drop changes in tests/qtest/fuzz/ since the fuzzers still need this] Message-Id: <20220902165126.1482-2-quintela@redhat.com> Signed-off-by: Thomas Huth --- tests/qtest/bios-tables-test.c | 2 +- tests/qtest/fuzz-lsi53c895a-test.c | 2 +- tests/qtest/fuzz-megasas-test.c | 2 +- tests/qtest/fuzz-sb16-test.c | 6 +++--- tests/qtest/fuzz-sdcard-test.c | 6 +++--- tests/qtest/fuzz-virtio-scsi-test.c | 2 +- tests/qtest/fuzz-xlnx-dp-test.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 2ebeb530b2..e6096e7f73 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -725,7 +725,7 @@ static char *test_acpi_create_args(test_data *data, con= st char *params, } } else { args =3D g_strdup_printf("-machine %s %s -accel tcg " - "-net none -display none %s " + "-net none %s " "-drive id=3Dhd0,if=3Dnone,file=3D%s,format=3Draw " "-device %s,drive=3Dhd0 ", data->machine, data->tcg_only ? "" : "-accel kvm", diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c89= 5a-test.c index 434c16bf42..392a7ae7ed 100644 --- a/tests/qtest/fuzz-lsi53c895a-test.c +++ b/tests/qtest/fuzz-lsi53c895a-test.c @@ -21,7 +21,7 @@ static void test_lsi_do_msgout_cancel_req(void) return; } =20 - s =3D qtest_init("-M q35 -m 2G -display none -nodefaults " + s =3D qtest_init("-M q35 -m 2G -nodefaults " "-device lsi53c895a,id=3Dscsi " "-device scsi-hd,drive=3Ddisk0 " "-drive file=3Dnull-co://,id=3Ddisk0,if=3Dnone,format= =3Draw"); diff --git a/tests/qtest/fuzz-megasas-test.c b/tests/qtest/fuzz-megasas-tes= t.c index 287fe19fc7..8d7ed3723a 100644 --- a/tests/qtest/fuzz-megasas-test.c +++ b/tests/qtest/fuzz-megasas-test.c @@ -40,7 +40,7 @@ static void test_lp1878263_megasas_zero_iov_cnt(void) */ static void test_gitlab_issue521_megasas_sgl_ovf(void) { - QTestState *s =3D qtest_init("-display none -m 32M -machine q35 " + QTestState *s =3D qtest_init("-m 32M -machine q35 " "-nodefaults -device megasas " "-device scsi-cd,drive=3Dnull0 " "-blockdev " diff --git a/tests/qtest/fuzz-sb16-test.c b/tests/qtest/fuzz-sb16-test.c index add2a2ad39..fc445b1871 100644 --- a/tests/qtest/fuzz-sb16-test.c +++ b/tests/qtest/fuzz-sb16-test.c @@ -15,7 +15,7 @@ */ static void test_fuzz_sb16_0x1c(void) { - QTestState *s =3D qtest_init("-M q35 -display none " + QTestState *s =3D qtest_init("-M q35 " "-device sb16,audiodev=3Dsnd0 " "-audiodev none,id=3Dsnd0"); qtest_outw(s, 0x22c, 0x41); @@ -27,7 +27,7 @@ static void test_fuzz_sb16_0x1c(void) =20 static void test_fuzz_sb16_0x91(void) { - QTestState *s =3D qtest_init("-M pc -display none " + QTestState *s =3D qtest_init("-M pc " "-device sb16,audiodev=3Dnone " "-audiodev id=3Dnone,driver=3Dnone"); qtest_outw(s, 0x22c, 0xf141); @@ -43,7 +43,7 @@ static void test_fuzz_sb16_0x91(void) */ static void test_fuzz_sb16_0xd4(void) { - QTestState *s =3D qtest_init("-M pc -display none " + QTestState *s =3D qtest_init("-M pc " "-device sb16,audiodev=3Dnone " "-audiodev id=3Dnone,driver=3Dnone"); qtest_outb(s, 0x22c, 0x41); diff --git a/tests/qtest/fuzz-sdcard-test.c b/tests/qtest/fuzz-sdcard-test.c index e7fd818148..cd134cdf55 100644 --- a/tests/qtest/fuzz-sdcard-test.c +++ b/tests/qtest/fuzz-sdcard-test.c @@ -18,7 +18,7 @@ static void oss_fuzz_29225(void) { QTestState *s; =20 - s =3D qtest_init(" -display none -m 512m -nodefaults -nographic" + s =3D qtest_init(" -m 512m -nodefaults -nographic" " -device sdhci-pci,sd-spec-version=3D3" " -device sd-card,drive=3Dd0" " -drive if=3Dnone,index=3D0,file=3Dnull-co://,format= =3Draw,id=3Dd0"); @@ -61,7 +61,7 @@ static void oss_fuzz_36217(void) { QTestState *s; =20 - s =3D qtest_init(" -display none -m 32 -nodefaults -nographic" + s =3D qtest_init(" -m 32 -nodefaults -nographic" " -device sdhci-pci,sd-spec-version=3D3 " "-device sd-card,drive=3Dd0 " "-drive if=3Dnone,index=3D0,file=3Dnull-co://,format=3D= raw,id=3Dd0"); @@ -95,7 +95,7 @@ static void oss_fuzz_36391(void) { QTestState *s; =20 - s =3D qtest_init(" -display none -m 512M -nodefaults -nographic" + s =3D qtest_init(" -m 512M -nodefaults -nographic" " -device sdhci-pci,sd-spec-version=3D3" " -device sd-card,drive=3Ddrv" " -drive if=3Dnone,index=3D0,file=3Dnull-co://,format= =3Draw,id=3Ddrv"); diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-= scsi-test.c index 71c91b0356..e37b48b2cc 100644 --- a/tests/qtest/fuzz-virtio-scsi-test.c +++ b/tests/qtest/fuzz-virtio-scsi-test.c @@ -19,7 +19,7 @@ static void test_mmio_oob_from_memory_region_cache(void) { QTestState *s; =20 - s =3D qtest_init("-M pc-q35-5.2 -display none -m 512M " + s =3D qtest_init("-M pc-q35-5.2 -m 512M " "-device virtio-scsi,num_queues=3D8,addr=3D03.0 "); =20 qtest_outl(s, 0xcf8, 0x80001811); diff --git a/tests/qtest/fuzz-xlnx-dp-test.c b/tests/qtest/fuzz-xlnx-dp-tes= t.c index 51e9a37300..e8c483965f 100644 --- a/tests/qtest/fuzz-xlnx-dp-test.c +++ b/tests/qtest/fuzz-xlnx-dp-test.c @@ -14,7 +14,7 @@ */ static void test_fuzz_xlnx_dp_0x3ac(void) { - QTestState *s =3D qtest_init("-M xlnx-zcu102 -display none "); + QTestState *s =3D qtest_init("-M xlnx-zcu102 "); qtest_readl(s, 0xfd4a03ac); qtest_quit(s); } --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586321; cv=none; d=zohomail.com; s=zohoarc; b=C+pcvkCRltxOTtJ4AXOO1aSjcm/aRTO/HAcxk1lajuYMtOjYBj3bTl1Uk9N8DPaBr8p0OZBkqGU+PJ7ACalkooMWto+VBAj4Kssr2g83RMx0aqKmvBJXSyXVWiUaunnzWgy6VL3QHFpxWDb08ulk/gCPwO6vNb1xz2d2JY9UroA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586321; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pxMpdLsJ7uP78UBqiB7q9xhpRgLVZZ5xaoHG9WUYigM=; b=KrZyXhF433dR4qkC1K36WwKf8Zy/elwbcN6Su7fSz3RdC1hcaA0VJt/e9x+/ZV5JOJG7jwwzNtid5biKrESeL130euTSfymoJ15q08tVw7/mwgsRw5qM/bjdbnHKEbwd5ar4mtmGIYcP1TghuZd9Hswn5k707QUb58L1E/hns1I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16655863214421007.6791049878611; Wed, 12 Oct 2022 07:52:01 -0700 (PDT) Received: from localhost ([::1]:39518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid5U-0007GG-4i for importer@patchew.org; Wed, 12 Oct 2022 10:52:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnY-00052j-NS for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:32008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnX-0006jp-7f for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:28 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-573-IclPhM71OqOQxXrRdIRihQ-1; Wed, 12 Oct 2022 10:33:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 145F51C068C9; Wed, 12 Oct 2022 14:33:22 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E2AC2144B20; Wed, 12 Oct 2022 14:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585205; 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=pxMpdLsJ7uP78UBqiB7q9xhpRgLVZZ5xaoHG9WUYigM=; b=NyNTB+TbpaE4flFF6yEhIGGmyeuVaCfYaNqMp2YizhBiB6N9fo3TlHVUZSqYWGr2td4Rj3 PXO91gK6gsk/+HFzro0zWUxLUgxtn7QO2U3Qxo8R4+FGJSXblCxfYn7DUWmiRRxzBK6wkd vStftFHWCjS+cYkQagveNC1ZZEXy5mk= X-MC-Unique: IclPhM71OqOQxXrRdIRihQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: dinglimin , =?UTF-8?q?J=C3=A1n=20Tomko?= Subject: [PULL 02/16] tests/migration: remove the unused local variable Date: Wed, 12 Oct 2022 16:33:02 +0200 Message-Id: <20221012143316.988561-3-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586323358100001 From: dinglimin Remove the unused local variable "records". Signed-off-by: dinglimin Reviewed-by: J=C3=A1n Tomko Message-Id: <20220928080555.2263-1-dinglimin@cmss.chinamobile.com> Signed-off-by: Thomas Huth --- tests/migration/guestperf/engine.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/migration/guestperf/engine.py b/tests/migration/guestper= f/engine.py index 87a6ab2009..59fca2c70b 100644 --- a/tests/migration/guestperf/engine.py +++ b/tests/migration/guestperf/engine.py @@ -65,7 +65,6 @@ def _vcpu_timing(self, pid, tid_list): return records =20 def _cpu_timing(self, pid): - records =3D [] now =3D time.time() =20 jiffies_per_sec =3D os.sysconf(os.sysconf_names['SC_CLK_TCK']) --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665585429; cv=none; d=zohomail.com; s=zohoarc; b=QOi6Y1Ksc6oxEL0KOlXj2mtcKdnO7AEfDRTamVM9vsyWMLSUpCik+vHR5ulG3V+qSglWhteq36Hm3LHj4mM9wpIaekYHJOP+lA9FaNg0pDLnz7v298bsAXfuNooBaFNx4dZQn4WC+3Og5IGlnVT9YqDJh5HKAz7A2RofIhijJrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665585429; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/d0rc1UlbYQ0b2OxmfhxJd2FSCVm+ytrjf647l1qxYE=; b=XuZUBJBOmHXzuYgUT3OUEhkkj0GCC08VEgB8Dc5zqTuuVBid/JW4+kgt+afvPlGrw/QjNKzjd2icVqBgbdYgcr6SFr4zDgjJqAuTTT552lCnNkhSRsDmSFxg5hno7MsjrVVHRp7W54/Oa/D0Wgo7HeAG9TzWQ7XLjl2w4qsYqi4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665585429563371.46470112204133; Wed, 12 Oct 2022 07:37:09 -0700 (PDT) Received: from localhost ([::1]:39386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicr6-0007yp-HC for importer@patchew.org; Wed, 12 Oct 2022 10:37:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicna-00054S-Oh for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnW-0006jm-0q for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:30 -0400 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-381-0hS81VAEPpmp1xrgO16YVQ-1; Wed, 12 Oct 2022 10:33:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2AAF0101AA45; Wed, 12 Oct 2022 14:33:23 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E77C2144B20; Wed, 12 Oct 2022 14:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/d0rc1UlbYQ0b2OxmfhxJd2FSCVm+ytrjf647l1qxYE=; b=GZ3NjZ5M4Vg78l68EEwRJUZatHGK92as0DXNCXzRQSO2MBVomx/2C3VenJ/+oukJyhwkY8 sr+LPdc6XpWtdyHS3S9xOmrJe8xvipdSEKHV69azrSVL5jjQYFUpGjFIf8P7aHzoWGPIJy nK6uxv6y2cAaUk85lMY8BNE8/X4pulU= X-MC-Unique: 0hS81VAEPpmp1xrgO16YVQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 03/16] tests/x86: add helper qtest_qmp_device_del_send() Date: Wed, 12 Oct 2022 16:33:03 +0200 Message-Id: <20221012143316.988561-4-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665585430816100005 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Move sending 'device_del' command to separate function. Function can be used in case of addition action is needed to start actual removing device after sending command. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-2-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth [thuth: Fixed typo] Signed-off-by: Thomas Huth --- tests/qtest/libqtest.h | 10 ++++++++++ tests/qtest/device-plug-test.c | 15 ++------------- tests/qtest/drive_del-test.c | 6 +----- tests/qtest/libqos/pci-pc.c | 8 +------- tests/qtest/libqtest.c | 16 ++++++++++------ 5 files changed, 24 insertions(+), 31 deletions(-) diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index 3abc75964d..65c040e504 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -761,12 +761,22 @@ void qtest_qmp_device_add(QTestState *qts, const char= *driver, const char *id, void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd); #endif /* _WIN32 */ =20 +/** + * qtest_qmp_device_del_send: + * @qts: QTestState instance to operate on + * @id: Identification string + * + * Generic hot-unplugging test via the device_del QMP command. + */ +void qtest_qmp_device_del_send(QTestState *qts, const char *id); + /** * qtest_qmp_device_del: * @qts: QTestState instance to operate on * @id: Identification string * * Generic hot-unplugging test via the device_del QMP command. + * Waiting for command completion event. */ void qtest_qmp_device_del(QTestState *qts, const char *id); =20 diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index e595b45b66..3841de1b8c 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -15,17 +15,6 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" =20 -static void device_del(QTestState *qtest, const char *id) -{ - QDict *resp; - - resp =3D qtest_qmp(qtest, - "{'execute': 'device_del', 'arguments': { 'id': %s } = }", id); - - g_assert(qdict_haskey(resp, "return")); - qobject_unref(resp); -} - static void system_reset(QTestState *qtest) { QDict *resp; @@ -68,7 +57,7 @@ static void process_device_remove(QTestState *qtest, cons= t char *id) * be processed. However during system reset, the removal will be * handled, removing the device. */ - device_del(qtest, id); + qtest_qmp_device_del_send(qtest, id); system_reset(qtest); wait_device_deleted_event(qtest, id); } @@ -112,7 +101,7 @@ static void test_ccw_unplug(void) { QTestState *qtest =3D qtest_initf("-device virtio-balloon-ccw,id=3Ddev= 0"); =20 - device_del(qtest, "dev0"); + qtest_qmp_device_del_send(qtest, "dev0"); wait_device_deleted_event(qtest, "dev0"); =20 qtest_quit(qtest); diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 5e6d58b4dd..467e752b0d 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -143,11 +143,7 @@ static void device_del(QTestState *qts, bool and_reset) { QDict *response; =20 - response =3D qtest_qmp(qts, "{'execute': 'device_del'," - " 'arguments': { 'id': 'dev0' } }"); - g_assert(response); - g_assert(qdict_haskey(response, "return")); - qobject_unref(response); + qtest_qmp_device_del_send(qts, "dev0"); =20 if (and_reset) { response =3D qtest_qmp(qts, "{'execute': 'system_reset' }"); diff --git a/tests/qtest/libqos/pci-pc.c b/tests/qtest/libqos/pci-pc.c index 81c2c055ca..96046287ac 100644 --- a/tests/qtest/libqos/pci-pc.c +++ b/tests/qtest/libqos/pci-pc.c @@ -179,13 +179,7 @@ void qpci_free_pc(QPCIBus *bus) =20 void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t= slot) { - QDict *response; - - response =3D qtest_qmp(qts, "{'execute': 'device_del'," - " 'arguments': {'id': %s}}", id); - g_assert(response); - g_assert(!qdict_haskey(response, "error")); - qobject_unref(response); + qtest_qmp_device_del_send(qts, id); =20 qtest_outl(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); =20 diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 4f4b2d6477..7b6152807b 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1371,15 +1371,19 @@ void qtest_qmp_add_client(QTestState *qts, const ch= ar *protocol, int fd) * * {"return": {}} */ -void qtest_qmp_device_del(QTestState *qts, const char *id) +void qtest_qmp_device_del_send(QTestState *qts, const char *id) { - QDict *rsp; - - rsp =3D qtest_qmp(qts, "{'execute': 'device_del', 'arguments': {'id': = %s}}", - id); - + QDict *rsp =3D qtest_qmp(qts, "{'execute': 'device_del', " + "'arguments': {'id': %s}}", id); + g_assert(rsp); g_assert(qdict_haskey(rsp, "return")); + g_assert(!qdict_haskey(rsp, "error")); qobject_unref(rsp); +} + +void qtest_qmp_device_del(QTestState *qts, const char *id) +{ + qtest_qmp_device_del_send(qts, id); qtest_qmp_eventwait(qts, "DEVICE_DELETED"); } =20 --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665585682; cv=none; d=zohomail.com; s=zohoarc; b=cA74CMe5FFe2SP08fuzSRVowK5lLKE3Y1SUDwHu2uXTTlaULEY2T8kPQLTbnT7zpi3en+5P7i2pwC9u1O1Z4QZE/EoFCkepULI5MmsWCVoTZ+Ga+rKs24BsnsCTtLiGTnVVQoxCnLTb/9JCoi2tCLxFOrQoU8BaD47/hqcrprVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665585682; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z/TEqUsTuY0VENj3wooLQbArhOf1njBISSItMdJCOVU=; b=iwtvKgCOqlJXjCIQ7Uu8Xg+QaJ2dOSraitAcOZxuQ/FZEoRwgrTv6oEdmEMzHrtvGbC67gHW3aeTvY83iGdzNf/r5o0UMDiy+MJosrLSzmhDoSlkxGbiWQiDGNO1xf86+I3RPL3dYNHNJmlFfjnMft49qLr+QbZeEHO1TY5ElT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665585682495319.9513366205347; Wed, 12 Oct 2022 07:41:22 -0700 (PDT) Received: from localhost ([::1]:32826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicvB-000577-ED for importer@patchew.org; Wed, 12 Oct 2022 10:41:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicna-00054Q-ET for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnY-0006k9-FH for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:29 -0400 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-643-UWzB137iOvitro3BL7sl3A-1; Wed, 12 Oct 2022 10:33:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 37F85959744; Wed, 12 Oct 2022 14:33:24 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73B462144B20; Wed, 12 Oct 2022 14:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z/TEqUsTuY0VENj3wooLQbArhOf1njBISSItMdJCOVU=; b=P4YZeQsBzdbJMo/TD4Poj6KCKWxeXT/1+GgPt9BuyZpqoWb7ocheBLJo87UmWa0ySJXMJc K5hc01y/WY8B4EvnAIY888RRYckaO9JKi54O71G8cP/d3nMjAWf2mYUPfMSwyCwq96DJE+ /QVEioLJFKmg44ihLpchNgUhBbrCUyo= X-MC-Unique: UWzB137iOvitro3BL7sl3A-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 04/16] tests/x86: Add subtest with 'q35' machine type to device-plug-test Date: Wed, 12 Oct 2022 16:33:04 +0200 Message-Id: <20221012143316.988561-5-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665585683169100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Configure pci bridge setting to plug pci device and unplug. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-3-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/device-plug-test.c | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index 3841de1b8c..3f44f731d1 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -79,6 +79,19 @@ static void test_pci_unplug_request(void) qtest_quit(qtest); } =20 +static void test_q35_pci_unplug_request(void) +{ + + QTestState *qtest =3D qtest_initf("-machine q35 " + "-device pcie-root-port,id=3Dp1 " + "-device pcie-pci-bridge,bus=3Dp1,id= =3Db1 " + "-device virtio-mouse-pci,bus=3Db1,id= =3Ddev0"); + + process_device_remove(qtest, "dev0"); + + qtest_quit(qtest); +} + static void test_pci_unplug_json_request(void) { const char *arch =3D qtest_get_arch(); @@ -97,6 +110,27 @@ static void test_pci_unplug_json_request(void) qtest_quit(qtest); } =20 +static void test_q35_pci_unplug_json_request(void) +{ + const char *port =3D "-device '{\"driver\": \"pcie-root-port\", " + "\"id\": \"p1\"}'"; + + const char *bridge =3D "-device '{\"driver\": \"pcie-pci-bridge\", " + "\"id\": \"b1\", " + "\"bus\": \"p1\"}'"; + + const char *device =3D "-device '{\"driver\": \"virtio-mouse-pci\", " + "\"bus\": \"b1\", " + "\"id\": \"dev0\"}'"; + + QTestState *qtest =3D qtest_initf("-machine q35 %s %s %s", + port, bridge, device); + + process_device_remove(qtest, "dev0"); + + qtest_quit(qtest); +} + static void test_ccw_unplug(void) { QTestState *qtest =3D qtest_initf("-device virtio-balloon-ccw,id=3Ddev= 0"); @@ -176,5 +210,12 @@ int main(int argc, char **argv) test_spapr_phb_unplug_request); } =20 + if (!strcmp(arch, "x86_64") && qtest_has_machine("q35")) { + qtest_add_func("/device-plug/q35-pci-unplug-request", + test_q35_pci_unplug_request); + qtest_add_func("/device-plug/q35-pci-unplug-json-request", + test_q35_pci_unplug_json_request); + } + return g_test_run(); } --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665585427; cv=none; d=zohomail.com; s=zohoarc; b=h7D0tDIKncDZysff65utbIZI5P/hI5G5aEVNS+RAZjOF568QwQKMYet+cnByR17jnI3UPO9m+vs7lc0MD633JpYJ7z+Cx+cpj3RLPriRg1MMe463mUrwKdXle1J3f78HFBCyXNFxwf4bDUrOzy2WMLHCCIzknUD/5PmlfaTIp3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665585427; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hXxLdExdrIsQYQCjHc+PuZG7XWRORaCdMFxrBy0CRn0=; b=QXgonvqP3c8cODTHjoFpCALYDLSrNyLhJrqWHC5Q/LiRmN6GLnDKmoh2FDPnCocHjWHJMjJk+Oth3MAvCUJa6+gK8elWN/GQyZ7i3Ci4wUmXcK4KknEPTSmlRazgOrkXbMdUghomN4b5iIELYMe8e+pxcX30AZSLwlx0W7HqjPY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665585427439948.3631490913151; Wed, 12 Oct 2022 07:37:07 -0700 (PDT) Received: from localhost ([::1]:39402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicr4-00080j-BC for importer@patchew.org; Wed, 12 Oct 2022 10:37:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicna-00054R-E1 for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnX-0006k3-IT for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:29 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-35-YCYeuqkQPQKu34B9te-o5Q-1; Wed, 12 Oct 2022 10:33:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49180299E751; Wed, 12 Oct 2022 14:33:25 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89AA72144B20; Wed, 12 Oct 2022 14:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hXxLdExdrIsQYQCjHc+PuZG7XWRORaCdMFxrBy0CRn0=; b=AG4B4/K/gQt8YM31FU/U3z5OsZ7gYXljub3EbQmbC/RAH0Tm/bPZa06RIn/BOEATj4Y0+J Mf2ZUXe4AqJcGHo5hGqHfNX+5VqlwtPoimkBfb6byz6cgNIpEmtZlHiFCdIYHgzOTl8R0P sLSx1o76erjmkJcTpCZeuF/Nn+mG52c= X-MC-Unique: YCYeuqkQPQKu34B9te-o5Q-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 05/16] tests/x86: Refactor hot unplug hd-geo-test Date: Wed, 12 Oct 2022 16:33:05 +0200 Message-Id: <20221012143316.988561-6-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665585428879100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Moving common code to function. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-4-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/hd-geo-test.c | 110 ++++++++++++++------------------------ 1 file changed, 40 insertions(+), 70 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index ba772f4d7a..61f4c24b81 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -691,7 +691,8 @@ static void add_virtio_disk(TestArgs *args, args->n_virtio_disks++; } =20 -static void test_override(TestArgs *args, CHSResult expected[]) +static void test_override(TestArgs *args, const char *arch, + CHSResult expected[]) { QTestState *qts; char *joined_args; @@ -700,7 +701,7 @@ static void test_override(TestArgs *args, CHSResult exp= ected[]) =20 joined_args =3D g_strjoinv(" ", args->argv); =20 - qts =3D qtest_initf("-machine pc %s", joined_args); + qts =3D qtest_initf("-machine %s %s", arch, joined_args); fw_cfg =3D pc_fw_cfg_init(qts); =20 read_bootdevices(fw_cfg, expected); @@ -737,7 +738,7 @@ static void test_override_ide(void) add_ide_disk(args, 1, 0, 1, 9000, 120, 30); add_ide_disk(args, 2, 1, 0, 0, 1, 1); add_ide_disk(args, 3, 1, 1, 1, 0, 0); - test_override(args, expected); + test_override(args, "pc", expected); } =20 static void test_override_scsi(void) @@ -759,7 +760,7 @@ static void test_override_scsi(void) add_scsi_disk(args, 1, 0, 0, 1, 0, 9000, 120, 30); add_scsi_disk(args, 2, 0, 0, 2, 0, 1, 0, 0); add_scsi_disk(args, 3, 0, 0, 3, 0, 0, 1, 0); - test_override(args, expected); + test_override(args, "pc", expected); } =20 static void test_override_scsi_2_controllers(void) @@ -782,7 +783,7 @@ static void test_override_scsi_2_controllers(void) add_scsi_disk(args, 1, 0, 0, 1, 0, 9000, 120, 30); add_scsi_disk(args, 2, 1, 0, 0, 1, 1, 0, 0); add_scsi_disk(args, 3, 1, 0, 1, 2, 0, 1, 0); - test_override(args, expected); + test_override(args, "pc", expected); } =20 static void test_override_virtio_blk(void) @@ -797,7 +798,7 @@ static void test_override_virtio_blk(void) add_drive_with_mbr(args, empty_mbr, 1); add_virtio_disk(args, 0, "pci.0", 3, 10000, 120, 30); add_virtio_disk(args, 1, "pci.0", 4, 9000, 120, 30); - test_override(args, expected); + test_override(args, "pc", expected); } =20 static void test_override_zero_chs(void) @@ -808,46 +809,28 @@ static void test_override_zero_chs(void) }; add_drive_with_mbr(args, empty_mbr, 1); add_ide_disk(args, 0, 1, 1, 0, 0, 0); - test_override(args, expected); + test_override(args, "pc", expected); } =20 -static void test_override_scsi_hot_unplug(void) +static void test_override_hot_unplug(TestArgs *args, const char *devid, + CHSResult expected[], CHSResult expec= ted2[]) { QTestState *qts; char *joined_args; QFWCFG *fw_cfg; QDict *response; int i; - TestArgs *args =3D create_args(); - CHSResult expected[] =3D { - {"/pci@i0cf8/scsi@2/channel@0/disk@0,0", {10000, 120, 30} }, - {"/pci@i0cf8/scsi@2/channel@0/disk@1,0", {20, 20, 20} }, - {NULL, {0, 0, 0} } - }; - CHSResult expected2[] =3D { - {"/pci@i0cf8/scsi@2/channel@0/disk@1,0", {20, 20, 20} }, - {NULL, {0, 0, 0} } - }; - add_drive_with_mbr(args, empty_mbr, 1); - add_drive_with_mbr(args, empty_mbr, 1); - add_scsi_controller(args, "virtio-scsi-pci", "pci.0", 2); - add_scsi_disk(args, 0, 0, 0, 0, 0, 10000, 120, 30); - add_scsi_disk(args, 1, 0, 0, 1, 0, 20, 20, 20); =20 joined_args =3D g_strjoinv(" ", args->argv); =20 - qts =3D qtest_initf("-machine pc %s", joined_args); + qts =3D qtest_initf("%s", joined_args); fw_cfg =3D pc_fw_cfg_init(qts); =20 read_bootdevices(fw_cfg, expected); =20 /* unplug device an restart */ - response =3D qtest_qmp(qts, - "{ 'execute': 'device_del'," - " 'arguments': {'id': 'scsi-disk0' }}"); - g_assert(response); - g_assert(!qdict_haskey(response, "error")); - qobject_unref(response); + qtest_qmp_device_del_send(qts, devid); + response =3D qtest_qmp(qts, "{ 'execute': 'system_reset', 'arguments': { }}"); g_assert(response); @@ -872,13 +855,32 @@ static void test_override_scsi_hot_unplug(void) g_free(args); } =20 +static void test_override_scsi_hot_unplug(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + {"/pci@i0cf8/scsi@2/channel@0/disk@0,0", {10000, 120, 30} }, + {"/pci@i0cf8/scsi@2/channel@0/disk@1,0", {20, 20, 20} }, + {NULL, {0, 0, 0} } + }; + CHSResult expected2[] =3D { + {"/pci@i0cf8/scsi@2/channel@0/disk@1,0", {20, 20, 20} }, + {NULL, {0, 0, 0} } + }; + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_scsi_controller(args, "virtio-scsi-pci", "pci.0", 2); + add_scsi_disk(args, 0, 0, 0, 0, 0, 10000, 120, 30); + add_scsi_disk(args, 1, 0, 0, 1, 0, 20, 20, 20); + + args->argc =3D append_arg(args->argc, args->argv, ARGV_SIZE, + g_strdup("-machine pc")); + + test_override_hot_unplug(args, "scsi-disk0", expected, expected2); +} + static void test_override_virtio_hot_unplug(void) { - QTestState *qts; - char *joined_args; - QFWCFG *fw_cfg; - QDict *response; - int i; TestArgs *args =3D create_args(); CHSResult expected[] =3D { {"/pci@i0cf8/scsi@2/disk@0,0", {10000, 120, 30} }, @@ -894,42 +896,10 @@ static void test_override_virtio_hot_unplug(void) add_virtio_disk(args, 0, "pci.0", 2, 10000, 120, 30); add_virtio_disk(args, 1, "pci.0", 3, 20, 20, 20); =20 - joined_args =3D g_strjoinv(" ", args->argv); - - qts =3D qtest_initf("-machine pc %s", joined_args); - fw_cfg =3D pc_fw_cfg_init(qts); - - read_bootdevices(fw_cfg, expected); + args->argc =3D append_arg(args->argc, args->argv, ARGV_SIZE, + g_strdup("-machine pc")); =20 - /* unplug device an restart */ - response =3D qtest_qmp(qts, - "{ 'execute': 'device_del'," - " 'arguments': {'id': 'virtio-disk0' }}"); - g_assert(response); - g_assert(!qdict_haskey(response, "error")); - qobject_unref(response); - response =3D qtest_qmp(qts, - "{ 'execute': 'system_reset', 'arguments': { }}"); - g_assert(response); - g_assert(!qdict_haskey(response, "error")); - qobject_unref(response); - - qtest_qmp_eventwait(qts, "RESET"); - - read_bootdevices(fw_cfg, expected2); - - g_free(joined_args); - qtest_quit(qts); - - g_free(fw_cfg); - - for (i =3D 0; i < args->n_drives; i++) { - unlink(args->drives[i]); - g_free(args->drives[i]); - } - g_free(args->drives); - g_strfreev(args->argv); - g_free(args); + test_override_hot_unplug(args, "virtio-disk0", expected, expected2); } =20 int main(int argc, char **argv) --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665585745; cv=none; d=zohomail.com; s=zohoarc; b=csKbIKaJHQWFzFkC82MVeWu6iDf9835wAZqmcb4OdQZODpUCDKURr3x6Ch8SMNCdtVIjeAWu5I1FrDNTGn576hrB1s6Ww20HvgE5eBKBjgXQ9EKFlIU5wuHAm9fcgiTLqmCS1b2jI5Rpq9SW8X60NOgHTyx1j4tT4CHcaP4sQSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665585745; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2jNxOmmoBaUaYLIRBnrgJe/FO422NAqao0k/4BWbMl0=; b=VJ38OF2BZYGiSz46+WrJG72xxpP32cUrjocbKgRbY62qQIBR0WeL7aNX7pVV4CvuAQzbPJh94WCTgR9eudr6Y2sAMSC9l6dyYvkjKQ73FN0kN5RYrhgBRRnR9/+6xMgiwAqp8bbRh0mv2+7T8Pfh2on8C78rGDLdzIxQal2TKrw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665585745375561.0644145950731; Wed, 12 Oct 2022 07:42:25 -0700 (PDT) Received: from localhost ([::1]:38880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicwA-0005YY-Ju for importer@patchew.org; Wed, 12 Oct 2022 10:42:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnb-00054W-Q8 for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnY-0006kB-GP for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:31 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-zlNH5TTpM2KEOZNszxzWKg-1; Wed, 12 Oct 2022 10:33:26 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 638F91C068C9; Wed, 12 Oct 2022 14:33:26 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 923552144B20; Wed, 12 Oct 2022 14:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2jNxOmmoBaUaYLIRBnrgJe/FO422NAqao0k/4BWbMl0=; b=UrH/QB9yxbQ/8C9lYW0BLLR2B7oc60XxEjjx687V1byDpjCgE9URViG8sDlqC4N+0LPkZ8 sGGG/IEMI9wHtr9c04FDZzGAwv+aVe8GcvEl6jcbsy3dabEdgy/tqSzCgwP/Oa6r6/9M1Y y3XWGHxIlHMW0v1qj3WEqwprp44k894= X-MC-Unique: zlNH5TTpM2KEOZNszxzWKg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 06/16] tests/x86: Add 'q35' machine type to override-tests in hd-geo-test Date: Wed, 12 Oct 2022 16:33:06 +0200 Message-Id: <20221012143316.988561-7-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665585747667100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-5-michael.labiuk@virtuozzo.com> Signed-off-by: Thomas Huth --- tests/qtest/hd-geo-test.c | 97 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 61f4c24b81..278464c379 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -741,6 +741,27 @@ static void test_override_ide(void) test_override(args, "pc", expected); } =20 +static void test_override_sata(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + {"/pci@i0cf8/pci8086,2922@1f,2/drive@0/disk@0", {10000, 120, 30} }, + {"/pci@i0cf8/pci8086,2922@1f,2/drive@1/disk@0", {9000, 120, 30} }, + {"/pci@i0cf8/pci8086,2922@1f,2/drive@2/disk@0", {0, 1, 1} }, + {"/pci@i0cf8/pci8086,2922@1f,2/drive@3/disk@0", {1, 0, 0} }, + {NULL, {0, 0, 0} } + }; + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_ide_disk(args, 0, 0, 0, 10000, 120, 30); + add_ide_disk(args, 1, 1, 0, 9000, 120, 30); + add_ide_disk(args, 2, 2, 0, 0, 1, 1); + add_ide_disk(args, 3, 3, 0, 1, 0, 0); + test_override(args, "q35", expected); +} + static void test_override_scsi(void) { TestArgs *args =3D create_args(); @@ -763,6 +784,42 @@ static void test_override_scsi(void) test_override(args, "pc", expected); } =20 +static void setup_pci_bridge(TestArgs *args, const char *id, const char *r= ootid) +{ + + char *root, *br; + root =3D g_strdup_printf("-device pcie-root-port,id=3D%s", rootid); + br =3D g_strdup_printf("-device pcie-pci-bridge,bus=3D%s,id=3D%s", roo= tid, id); + + args->argc =3D append_arg(args->argc, args->argv, ARGV_SIZE, root); + args->argc =3D append_arg(args->argc, args->argv, ARGV_SIZE, br); +} + +static void test_override_scsi_q35(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + { "/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@0,0", + {10000, 120, 30} + }, + {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@1,0", {9000, 120, = 30} }, + {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@2,0", {1, 0, 0} }, + {"/pci@i0cf8/pci-bridge@1/scsi@3/channel@0/disk@3,0", {0, 1, 0} }, + {NULL, {0, 0, 0} } + }; + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + setup_pci_bridge(args, "pcie.0", "br"); + add_scsi_controller(args, "lsi53c895a", "br", 3); + add_scsi_disk(args, 0, 0, 0, 0, 0, 10000, 120, 30); + add_scsi_disk(args, 1, 0, 0, 1, 0, 9000, 120, 30); + add_scsi_disk(args, 2, 0, 0, 2, 0, 1, 0, 0); + add_scsi_disk(args, 3, 0, 0, 3, 0, 0, 1, 0); + test_override(args, "q35", expected); +} + static void test_override_scsi_2_controllers(void) { TestArgs *args =3D create_args(); @@ -801,6 +858,22 @@ static void test_override_virtio_blk(void) test_override(args, "pc", expected); } =20 +static void test_override_virtio_blk_q35(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + {"/pci@i0cf8/pci-bridge@1/scsi@3/disk@0,0", {10000, 120, 30} }, + {"/pci@i0cf8/pci-bridge@1/scsi@4/disk@0,0", {9000, 120, 30} }, + {NULL, {0, 0, 0} } + }; + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + setup_pci_bridge(args, "pcie.0", "br"); + add_virtio_disk(args, 0, "br", 3, 10000, 120, 30); + add_virtio_disk(args, 1, "br", 4, 9000, 120, 30); + test_override(args, "q35", expected); +} + static void test_override_zero_chs(void) { TestArgs *args =3D create_args(); @@ -812,6 +885,17 @@ static void test_override_zero_chs(void) test_override(args, "pc", expected); } =20 +static void test_override_zero_chs_q35(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + {NULL, {0, 0, 0} } + }; + add_drive_with_mbr(args, empty_mbr, 1); + add_ide_disk(args, 0, 0, 0, 0, 0, 0); + test_override(args, "q35", expected); +} + static void test_override_hot_unplug(TestArgs *args, const char *devid, CHSResult expected[], CHSResult expec= ted2[]) { @@ -944,6 +1028,19 @@ int main(int argc, char **argv) test_override_scsi_hot_unplug); qtest_add_func("hd-geo/override/virtio_hot_unplug", test_override_virtio_hot_unplug); + + if (qtest_has_machine("q35")) { + qtest_add_func("hd-geo/override/sata", test_override_sata); + qtest_add_func("hd-geo/override/virtio_blk_q35", + test_override_virtio_blk_q35); + qtest_add_func("hd-geo/override/zero_chs_q35", + test_override_zero_chs_q35); + + if (qtest_has_device("lsi53c895a")) { + qtest_add_func("hd-geo/override/scsi_q35", + test_override_scsi_q35); + } + } } else { g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; " "skipping hd-geo/override/* tests"); --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586078; cv=none; d=zohomail.com; s=zohoarc; b=fssrphLMFVpsoC5NzlaqtO8cjx40jrOiEsou5CKj069c1Ifn12PtVIfFMvn9dfcVWjJsSFs/KR0NOM61fSI7RRVVX0Z2XXpBKogrAKAIm9u/pgdcS4XlhAdHHs3m+FFTkqxLUQcwCisMYiTPOHLXxisUIYFbwby9oW4DcTRoJxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586078; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6KE+OpO5TzqhZFqpiZi61TdmcpeDGy+ILkKGYTY//A0=; b=coTG8iy5AsISHcuD//JFWUIayv5f/o5T0kI38LM1E/xgJbCy7Q6yk5P16mJ09iE91Wai6Sq6gTsU97tUv0hwpr2c7vm1vC6TcXURRJbUTH+vB2/vmSDWtCkl29r8dHEQqq1zRh6Q+EUWt+QyXqchZdblYALqw5O5c5kB6zZbygI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586078697934.4776332404059; Wed, 12 Oct 2022 07:47:58 -0700 (PDT) Received: from localhost ([::1]:54518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid1Z-00034V-LS for importer@patchew.org; Wed, 12 Oct 2022 10:47:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnh-0005Bd-9e for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnc-0006ko-GI for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:37 -0400 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-284-0GJveknlNDeUOoJQOwqGIA-1; Wed, 12 Oct 2022 10:33:27 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D291833AEC; Wed, 12 Oct 2022 14:33:27 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id AAD732144B20; Wed, 12 Oct 2022 14:33:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6KE+OpO5TzqhZFqpiZi61TdmcpeDGy+ILkKGYTY//A0=; b=KXnAvPYyXjdY/+O6tZwE9F2mHaBwsn52f75uIaq7I9yElbzMQ8bbhZ29oLUxJxgPrtF9Ie yhVltMmT/TaWNlP+gTIEUd8BlA7WAOoisNKrEuNBVO5A9ONhiR2a/TcXj84p5LEUNzVlIf WryafYuTaj6jQDsdnQwA7QLo5mu0nco= X-MC-Unique: 0GJveknlNDeUOoJQOwqGIA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 07/16] tests/x86: Add 'q35' machine type to hotplug hd-geo-test Date: Wed, 12 Oct 2022 16:33:07 +0200 Message-Id: <20221012143316.988561-8-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586080322100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Add pci bridge setting to test hotplug. Duplicate tests for plugging scsi and virtio devices for q35 machine type. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-6-michael.labiuk@virtuozzo.com> Signed-off-by: Thomas Huth --- tests/qtest/hd-geo-test.c | 76 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 278464c379..4a7628077b 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -963,6 +963,42 @@ static void test_override_scsi_hot_unplug(void) test_override_hot_unplug(args, "scsi-disk0", expected, expected2); } =20 +static void test_override_scsi_hot_unplug_q35(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + { + "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/channel@0/disk@0,= 0", + {10000, 120, 30} + }, + { + "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/channel@0/disk@1,= 0", + {20, 20, 20} + }, + {NULL, {0, 0, 0} } + }; + CHSResult expected2[] =3D { + { + "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/channel@0/disk@1,= 0", + {20, 20, 20} + }, + {NULL, {0, 0, 0} } + }; + + args->argc =3D append_arg(args->argc, args->argv, ARGV_SIZE, + g_strdup("-device pcie-root-port,id=3Dp0 " + "-device pcie-pci-bridge,bus=3Dp0,id= =3Db1 " + "-machine q35")); + + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_scsi_controller(args, "virtio-scsi-pci", "b1", 2); + add_scsi_disk(args, 0, 0, 0, 0, 0, 10000, 120, 30); + add_scsi_disk(args, 1, 0, 0, 1, 0, 20, 20, 20); + + test_override_hot_unplug(args, "scsi-disk0", expected, expected2); +} + static void test_override_virtio_hot_unplug(void) { TestArgs *args =3D create_args(); @@ -986,6 +1022,41 @@ static void test_override_virtio_hot_unplug(void) test_override_hot_unplug(args, "virtio-disk0", expected, expected2); } =20 +static void test_override_virtio_hot_unplug_q35(void) +{ + TestArgs *args =3D create_args(); + CHSResult expected[] =3D { + { + "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@2/disk@0,0", + {10000, 120, 30} + }, + { + "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@3/disk@0,0", + {20, 20, 20} + }, + {NULL, {0, 0, 0} } + }; + CHSResult expected2[] =3D { + { + "/pci@i0cf8/pci-bridge@1/pci-bridge@0/scsi@3/disk@0,0", + {20, 20, 20} + }, + {NULL, {0, 0, 0} } + }; + + args->argc =3D append_arg(args->argc, args->argv, ARGV_SIZE, + g_strdup("-device pcie-root-port,id=3Dp0 " + "-device pcie-pci-bridge,bus=3Dp0,id= =3Db1 " + "-machine q35")); + + add_drive_with_mbr(args, empty_mbr, 1); + add_drive_with_mbr(args, empty_mbr, 1); + add_virtio_disk(args, 0, "b1", 2, 10000, 120, 30); + add_virtio_disk(args, 1, "b1", 3, 20, 20, 20); + + test_override_hot_unplug(args, "virtio-disk0", expected, expected2); +} + int main(int argc, char **argv) { Backend i; @@ -1035,11 +1106,14 @@ int main(int argc, char **argv) test_override_virtio_blk_q35); qtest_add_func("hd-geo/override/zero_chs_q35", test_override_zero_chs_q35); - if (qtest_has_device("lsi53c895a")) { qtest_add_func("hd-geo/override/scsi_q35", test_override_scsi_q35); } + qtest_add_func("hd-geo/override/scsi_hot_unplug_q35", + test_override_scsi_hot_unplug_q35); + qtest_add_func("hd-geo/override/virtio_hot_unplug_q35", + test_override_virtio_hot_unplug_q35); } } else { g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; " --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586162; cv=none; d=zohomail.com; s=zohoarc; b=cCSYUXpDJ87+UBTIodABLlas37q8Fb1CouwIdVwaMgipmpywi22/utWag7HwcWociod9uWwF9HwleY2VMesr4RuaqehZfD/x556AsFnNzKQlB4Yoz3v9cFLiJLs3iFKxhu9uJBo236V7dr4PHJcw0w1xpzdhomQQuN/meZ5QGfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586162; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lJlP5MOU0pLgqjxqhbAT+8OY0yYhs5lsBqASSmeazUA=; b=DGYpAbjf5UMIuh0cOAZDppa9Z4UNNRgFYVJ63TOF9KdgrRw1z7pCjQMDsBIL57Cz/KR/cNitByQiOxHKDiM/yxkZXQbTvNLrwldFhRWtwuAoKQu3pdjikuVfE1zanA76hpffbcQHXTOqjqNZ5vtb2ukOggdPbcHSiFu8qwMFA0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586162705619.9750519306813; Wed, 12 Oct 2022 07:49:22 -0700 (PDT) Received: from localhost ([::1]:49284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid2u-0004Us-KS for importer@patchew.org; Wed, 12 Oct 2022 10:49:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicni-0005GS-NF for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnc-0006ku-U9 for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-362-b5IqFWkiND28g5fjg6zFeA-1; Wed, 12 Oct 2022 10:33:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A5A0382ECCB; Wed, 12 Oct 2022 14:33:28 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6D482144B20; Wed, 12 Oct 2022 14:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lJlP5MOU0pLgqjxqhbAT+8OY0yYhs5lsBqASSmeazUA=; b=dqbSe0lkh+E/pntf244KqWICP2GjOx0g9aZ3OITvUToDIcV+x1TnwFHU/Wt2Naw0fsqd+9 VQm6ntRv3OF4Rjh2DMXFT73C/JfdDyKdrZ3IJ2eO9iBmmkcyG2N/LjYLf6wsXkRmr81BWn YDW3vOZY0vcwHMHOLmw188topoFkiLE= X-MC-Unique: b5IqFWkiND28g5fjg6zFeA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 08/16] tests/x86: Fix comment typo in drive_del-test Date: Wed, 12 Oct 2022 16:33:08 +0200 Message-Id: <20221012143316.988561-9-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586163586100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-7-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/drive_del-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 467e752b0d..44b9578801 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -327,7 +327,7 @@ static void test_blockdev_add_device_add_and_del(void) qts =3D qtest_init(machine_addition); =20 /* - * blockdev_add/device_add and device_del. The it drive is used by a + * blockdev_add/device_add and device_del. The drive is used by a * device that unplugs after reset, but it doesn't go away. */ blockdev_add_with_media(qts); --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665585810; cv=none; d=zohomail.com; s=zohoarc; b=hu0ktoZR4yeKFLczQGRKszPY0VpE5LXpV4Y6+94rcMHpTQiDCDGK9AKb/nK6I16uHh4tTitdhGqJaHQq1of0T6C9Rt6ZEPgJtGAliFoYKU022Qm0K8PtJfjIuSVVaGqMgPsKPFM4P/u+6hksahJMvFozrViFvlLGbX054Lhr6p0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665585810; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=K+r7FoNRng7S7CamvjytFYw+Qi/t6Rd9iRxSKlwvyjk=; b=iknLwdSlNRU2GFj0flw5I+VsZNNoh9gXRPGUdHrinBgMfwwJC6FQKuzoyErpI8QPimWSy8fQ9ouMZU74sHK17zU/q6hyWUm5pz8N0JLKZnoSJSSMJ2y/8fgYyQx+Bfb6YsiU5hEjaV4IeYtfKb5AFhqs1rg0JhTY7w0+LmlilMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665585810660478.20712664246093; Wed, 12 Oct 2022 07:43:30 -0700 (PDT) Received: from localhost ([::1]:32912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicxF-0007VB-75 for importer@patchew.org; Wed, 12 Oct 2022 10:43:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicni-0005EC-3M for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnb-0006kh-MA for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:37 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-304-xdTcHrvUMyC-kYysIs6B8A-1; Wed, 12 Oct 2022 10:33:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9967A1C068CA; Wed, 12 Oct 2022 14:33:29 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id D30722144B20; Wed, 12 Oct 2022 14:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+r7FoNRng7S7CamvjytFYw+Qi/t6Rd9iRxSKlwvyjk=; b=BStcrZW73FcA+NZ0q6I9glDZmC8LKRcO+0Ybm9HlH1lQhsd5U0y95z6KngioRe+jhtlfoQ 3vK8TpOmysR5sZXo6Pm2EE8g50krkGq+SjDNugYmusD3fs4weWH+Ipl5J89dm/YpNkACtk nmK+sg8F1ky6SkDFgS+z+xjGaK8cxxc= X-MC-Unique: xdTcHrvUMyC-kYysIs6B8A-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 09/16] tests/x86: replace snprint() by g_strdup_printf() in drive_del-test Date: Wed, 12 Oct 2022 16:33:09 +0200 Message-Id: <20221012143316.988561-10-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665585811819100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Using g_autofree char* and g_strdup_printf(...) instead of ugly snprintf on stack array. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-8-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/drive_del-test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 44b9578801..106c613f4f 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -123,12 +123,10 @@ static const char *qvirtio_get_dev_type(void) =20 static void device_add(QTestState *qts) { - QDict *response; - char driver[32]; - snprintf(driver, sizeof(driver), "virtio-blk-%s", - qvirtio_get_dev_type()); - - response =3D qtest_qmp(qts, "{'execute': 'device_add'," + g_autofree char *driver =3D g_strdup_printf("virtio-blk-%s", + qvirtio_get_dev_type()); + QDict *response =3D + qtest_qmp(qts, "{'execute': 'device_add'," " 'arguments': {" " 'driver': %s," " 'drive': 'drive0'," --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586585; cv=none; d=zohomail.com; s=zohoarc; b=KQLmkiPuncbqkccmu3BKY+lWY4eGzW6XSUTMnrHh/YtB/1pWLITJc88q3+DKgr+stqM6IJBqH3It6Z8hfajQszP+UgOphxJRUXA4FQMp6ajuPHpJfJYcECIMiOTs4Xp3CcYc8cxeQ9UPRBOzHKsJn5l9wUa10656lBoA2RSyMaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586585; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qSwYv3S4Tc7PADzy4Vq5p15+BomgFJxywYVJhHZa0r0=; b=SOOM9O58Ct5iHz55TEguRRuChTd6u6bgqlEGa/+ybsjtMEfHaYDodL12wxhyaTF5gFLLF4otQr1UOpBz+jwJUck0+ThtGpRYjsHYeJufC9swOzuokoSu8dnlmp+ulc+ehctmEhBlX0JcQr+nSBVCtfnlvJR3wtnWrf7UIom7F2o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586585245352.9762815722697; Wed, 12 Oct 2022 07:56:25 -0700 (PDT) Received: from localhost ([::1]:44806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid9j-0003Tv-SP for importer@patchew.org; Wed, 12 Oct 2022 10:56:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnj-0005HK-02 for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicne-0006l7-LO for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 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-400-rP0W09ypO-OVRhH6gDKLlg-1; Wed, 12 Oct 2022 10:33:30 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6AEF800B30; Wed, 12 Oct 2022 14:33:30 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id E19EC2144B20; Wed, 12 Oct 2022 14:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qSwYv3S4Tc7PADzy4Vq5p15+BomgFJxywYVJhHZa0r0=; b=HHPyp9QmHI1HODIRxQEUevA6PuDjI2qt37XvDB/oMLLXnlYrPcs6jUeEjb5iacAx/WVuSq +qGF3T91Nk3RmLvx+R1Jrw6dXUWFT+DY8LY/VxgvFoyWiB9de/INc33NSbX2YMQa1WYWMx dLR1qRWZGZAn9NoSJD/pajX2zg2aihk= X-MC-Unique: rP0W09ypO-OVRhH6gDKLlg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 10/16] tests/x86: Add 'q35' machine type to drive_del-test Date: Wed, 12 Oct 2022 16:33:10 +0200 Message-Id: <20221012143316.988561-11-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586587056100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Configure pci bridge setting to run tests on 'q35' machine type. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-9-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/drive_del-test.c | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 106c613f4f..9a750395a9 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -252,6 +252,27 @@ static void test_cli_device_del(void) qtest_quit(qts); } =20 +static void test_cli_device_del_q35(void) +{ + QTestState *qts; + + /* + * -drive/-device and device_del. Start with a drive used by a + * device that unplugs after reset. + */ + qts =3D qtest_initf("-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co://," + "file.read-zeroes=3Don,format=3Draw " + "-machine q35 -device pcie-root-port,id=3Dp1 " + "-device pcie-pci-bridge,bus=3Dp1,id=3Db1 " + "-device virtio-blk-%s,drive=3Ddrive0,bus=3Db1,id=3D= dev0", + qvirtio_get_dev_type()); + + device_del(qts, true); + g_assert(!has_drive(qts)); + + qtest_quit(qts); +} + static void test_empty_device_del(void) { QTestState *qts; @@ -288,6 +309,43 @@ static void test_device_add_and_del(void) qtest_quit(qts); } =20 +static void device_add_q35(QTestState *qts) +{ + g_autofree char *driver =3D g_strdup_printf("virtio-blk-%s", + qvirtio_get_dev_type()); + QDict *response =3D + qtest_qmp(qts, "{'execute': 'device_add'," + " 'arguments': {" + " 'driver': %s," + " 'drive': 'drive0'," + " 'id': 'dev0'," + " 'bus': 'b1'" + "}}", driver); + g_assert(response); + g_assert(qdict_haskey(response, "return")); + qobject_unref(response); +} + +static void test_device_add_and_del_q35(void) +{ + QTestState *qts; + + /* + * -drive/device_add and device_del. Start with a drive used by a + * device that unplugs after reset. + */ + qts =3D qtest_initf("-machine q35 -device pcie-root-port,id=3Dp1 " + "-device pcie-pci-bridge,bus=3Dp1,id=3Db1 " + "-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co://," + "file.read-zeroes=3Don,format=3Draw"); + + device_add_q35(qts); + device_del(qts, true); + g_assert(!has_drive(qts)); + + qtest_quit(qts); +} + static void test_drive_add_device_add_and_del(void) { QTestState *qts; @@ -312,6 +370,25 @@ static void test_drive_add_device_add_and_del(void) qtest_quit(qts); } =20 +static void test_drive_add_device_add_and_del_q35(void) +{ + QTestState *qts; + + qts =3D qtest_init("-machine q35 -device pcie-root-port,id=3Dp1 " + "-device pcie-pci-bridge,bus=3Dp1,id=3Db1"); + + /* + * drive_add/device_add and device_del. The drive is used by a + * device that unplugs after reset. + */ + drive_add_with_media(qts); + device_add_q35(qts); + device_del(qts, true); + g_assert(!has_drive(qts)); + + qtest_quit(qts); +} + static void test_blockdev_add_device_add_and_del(void) { QTestState *qts; @@ -336,6 +413,25 @@ static void test_blockdev_add_device_add_and_del(void) qtest_quit(qts); } =20 +static void test_blockdev_add_device_add_and_del_q35(void) +{ + QTestState *qts; + + qts =3D qtest_init("-machine q35 -device pcie-root-port,id=3Dp1 " + "-device pcie-pci-bridge,bus=3Dp1,id=3Db1"); + + /* + * blockdev_add/device_add and device_del. The drive is used by a + * device that unplugs after reset, but it doesn't go away. + */ + blockdev_add_with_media(qts); + device_add_q35(qts); + device_del(qts, true); + g_assert(has_blockdev(qts)); + + qtest_quit(qts); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -357,6 +453,17 @@ int main(int argc, char **argv) test_empty_device_del); qtest_add_func("/device_del/blockdev", test_blockdev_add_device_add_and_del); + + if (qtest_has_machine("q35")) { + qtest_add_func("/device_del/drive/cli_device_q35", + test_cli_device_del_q35); + qtest_add_func("/device_del/drive/device_add_q35", + test_device_add_and_del_q35); + qtest_add_func("/device_del/drive/drive_add_device_add_q35", + test_drive_add_device_add_and_del_q35); + qtest_add_func("/device_del/blockdev_q35", + test_blockdev_add_device_add_and_del_q35); + } } =20 return g_test_run(); --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586326; cv=none; d=zohomail.com; s=zohoarc; b=huqMBNLQd58n6Xn0fFYDDK6V85lvS9eas7FAa0r8XUtPJ0e1w3wqaCFNgm4/362lBOLKw3HCaC4Hl/RTjRc0kkcAkiZrAemHE7i2vW1Kt1mMvnBQFRVn3YIdnhtQw83HYHAq1RiRcAg+mCH/d2vIjyCy0mrkXPZ4hmTiPhfy0HY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586326; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UUP0Oo+ELuPQUPK68pgLhXopuf1Cpx+jFZgWtjcHwB0=; b=bx7Uw2r+LL/79n7DwZk9hI6j5eucxljhk0wnalJRneGq0FsAE4SwHHjWf8LhQ8H5ggS2aekdkJq8qDXxxtb4+KJ9yUdWJfyLTf5/yU3gYbnZrIVrkiT7yygJP9KueA6+5j2Y/umu2YZOY9UDWCDUVbnvfek9FHb2+6DUO21ieK4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586326657796.7241705052031; Wed, 12 Oct 2022 07:52:06 -0700 (PDT) Received: from localhost ([::1]:39528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid5Z-0007Kd-DZ for importer@patchew.org; Wed, 12 Oct 2022 10:52:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicni-0005GZ-PO for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicne-0006kz-51 for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-34-84GXSOzUPzSCO7-SG49i_g-1; Wed, 12 Oct 2022 10:33:32 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3F991C068CC; Wed, 12 Oct 2022 14:33:31 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB57A2144B20; Wed, 12 Oct 2022 14:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UUP0Oo+ELuPQUPK68pgLhXopuf1Cpx+jFZgWtjcHwB0=; b=WzsgMVjnhEIvOI290os/cQiyanCFi8WWor8Q5nCFPesYWbfawz3Y9HzP3IJtGtfd/GwM1y 4/4M/emIUvJBbjXdsnDLSCEjze73AktqJFYHH3PXZMkDKXSiRI4depebOZAQB+qrtc/f6W pC+ievmQyYeIH4mkndNV9zWt4p/O63c= X-MC-Unique: 84GXSOzUPzSCO7-SG49i_g-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 11/16] tests/x86: Add 'q35' machine type to ivshmem-test Date: Wed, 12 Oct 2022 16:33:11 +0200 Message-Id: <20221012143316.988561-12-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586327353100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Configure pci bridge setting to test ivshmem on 'q35'. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-10-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/ivshmem-test.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c index 9611d05eb5..cd550c8935 100644 --- a/tests/qtest/ivshmem-test.c +++ b/tests/qtest/ivshmem-test.c @@ -378,6 +378,20 @@ static void test_ivshmem_server(void) close(thread.pipe[0]); } =20 +static void test_ivshmem_hotplug_q35(void) +{ + QTestState *qts =3D qtest_init("-object memory-backend-ram,size=3D1M,i= d=3Dmb1 " + "-device pcie-root-port,id=3Dp1 " + "-device pcie-pci-bridge,bus=3Dp1,id=3Db1= " + "-machine q35"); + + qtest_qmp_device_add(qts, "ivshmem-plain", "iv1", + "{'memdev': 'mb1', 'bus': 'b1'}"); + qtest_qmp_device_del_send(qts, "iv1"); + + qtest_quit(qts); +} + #define PCI_SLOT_HP 0x06 =20 static void test_ivshmem_hotplug(void) @@ -469,6 +483,7 @@ int main(int argc, char **argv) { int ret, fd; gchar dir[] =3D "/tmp/ivshmem-test.XXXXXX"; + const char *arch =3D qtest_get_arch(); =20 g_test_init(&argc, &argv, NULL); =20 @@ -494,6 +509,9 @@ int main(int argc, char **argv) qtest_add_func("/ivshmem/pair", test_ivshmem_pair); qtest_add_func("/ivshmem/server", test_ivshmem_server); } + if (!strcmp(arch, "x86_64") && qtest_has_machine("q35")) { + qtest_add_func("/ivshmem/hotplug-q35", test_ivshmem_hotplug_q35); + } =20 out: ret =3D g_test_run(); --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586611; cv=none; d=zohomail.com; s=zohoarc; b=S8HyNdNzd56J+BhsWEIW5JjvvyQMrblC8S5Gq0rEiHtSWxCyFPc9JG+pNu88gnIRZFxHQ/uWBhzBVI/1UCDmyvQLQvVTcVKS4/86iPhAdU5GnQfOjNd/WqM5t6n3vE44n4w3NTHyS9+7biQWF/sO1pKK4Q5zIsx6WgN9UxQYPfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586611; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U3eXGvdUk/VfHhShsHnHO9DAbvoGG8vf+bPbjE1OJJc=; b=n+GFU9gawhtKcWGChAcjR/Ro/srf9BDwxmRwYGLSgGr9JfW+fDLtcTW0mYSjlR/gs9hPZqO+oezIKo8q5ybVWm6gDb1qefFGtuuJdoojBthtvM+sCiuJR0ZQGwlXbwnnWKpkUIKSMbGlRu+gTt8qvxNBJYk7GRsBK2ibXJUxXqM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586611248459.57836604244505; Wed, 12 Oct 2022 07:56:51 -0700 (PDT) Received: from localhost ([::1]:60904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oidA9-0004d3-WB for importer@patchew.org; Wed, 12 Oct 2022 10:56:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnj-0005JV-MZ for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnh-0006lQ-Kp for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:39 -0400 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-5-FVAv2GA6MrqdQqgNBRNWSw-1; Wed, 12 Oct 2022 10:33:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 15510185A7A8; Wed, 12 Oct 2022 14:33:33 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 084522144B20; Wed, 12 Oct 2022 14:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585217; 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=U3eXGvdUk/VfHhShsHnHO9DAbvoGG8vf+bPbjE1OJJc=; b=SC+ol6+SzHxq1+yD7vWhhsTxHpUjcCX70pShzubEj6G4JWrYSAZY3rchcpXZMDQgFKJL7i 9tgiYe9azIkq7DQHgTosh9VVxuzuQYgLR2bt63uAaM4zHfZsjFw/ySyCGv23EsgU/IShEP UqoPHYeOOLCY2Gq3ZphHPIxMID+0k2k= X-MC-Unique: FVAv2GA6MrqdQqgNBRNWSw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 12/16] tests/avocado: Add missing require_netdev('user') checks Date: Wed, 12 Oct 2022 16:33:12 +0200 Message-Id: <20221012143316.988561-13-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586613245100001 From: Peter Maydell Some avocado tests fail if QEMU was built without libslirp. Add require_netdev('user') checks where necessary: These tests try to ping 10.0.2.2 and expect it to succeed: boot_linux_console.py:BootLinuxConsole.test_arm_emcraft_sf2 boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd ppc_bamboo.py:BambooMachine.test_ppc_bamboo These tests run a commandline that includes '-net user': machine_aspeed.py:AST2x00Machine.test_arm_ast2500_evb_builroot (and others that use the do_test_arm_aspeed_buidroot_start() or do_test_arm_aspeed_sdk_start() helper functions) These changes seem to be sufficient for 'make check-avocado' to not fail on a --disable-slirp build. Signed-off-by: Peter Maydell Message-Id: <20221001195224.2453581-1-peter.maydell@linaro.org> Reviewed-by: Thomas Huth Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/avocado/boot_linux_console.py | 4 ++++ tests/avocado/machine_aspeed.py | 3 +++ tests/avocado/ppc_bamboo.py | 1 + 3 files changed, 8 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux= _console.py index f26e036ab5..ca9d09b0d7 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -381,6 +381,8 @@ def test_arm_emcraft_sf2(self): :avocado: tags=3Du-boot :avocado: tags=3Daccel:tcg """ + self.require_netdev('user') + uboot_url =3D ('https://raw.githubusercontent.com/' 'Subbaraya-Sundeep/qemu-test-binaries/' 'fe371d32e50ca682391e1e70ab98c2942aeffb01/u-boot') @@ -779,6 +781,8 @@ def test_arm_orangepi_sd(self): :avocado: tags=3Dmachine:orangepi-pc :avocado: tags=3Ddevice:sd """ + self.require_netdev('user') + deb_url =3D ('https://apt.armbian.com/pool/main/l/' 'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_= armhf.deb') deb_hash =3D '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0' diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed= .py index 0f64eb636c..124649a24b 100644 --- a/tests/avocado/machine_aspeed.py +++ b/tests/avocado/machine_aspeed.py @@ -93,6 +93,8 @@ def test_arm_ast2500_romulus_openbmc_v2_9_0(self): self.do_test_arm_aspeed(image_path) =20 def do_test_arm_aspeed_buidroot_start(self, image, cpu_id): + self.require_netdev('user') + self.vm.set_console() self.vm.add_args('-drive', 'file=3D' + image + ',if=3Dmtd,format= =3Draw', '-net', 'nic', '-net', 'user') @@ -193,6 +195,7 @@ def wait_for_console_pattern(self, success_message, vm= =3DNone): vm=3Dvm) =20 def do_test_arm_aspeed_sdk_start(self, image, cpu_id): + self.require_netdev('user') self.vm.set_console() self.vm.add_args('-drive', 'file=3D' + image + ',if=3Dmtd,format= =3Draw', '-net', 'nic', '-net', 'user') diff --git a/tests/avocado/ppc_bamboo.py b/tests/avocado/ppc_bamboo.py index 102ff252df..a81be3d608 100644 --- a/tests/avocado/ppc_bamboo.py +++ b/tests/avocado/ppc_bamboo.py @@ -23,6 +23,7 @@ def test_ppc_bamboo(self): :avocado: tags=3Daccel:tcg """ self.require_accelerator("tcg") + self.require_netdev('user') tar_url =3D ('http://landley.net/aboriginal/downloads/binaries/' 'system-image-powerpc-440fp.tar.gz') tar_hash =3D '53e5f16414b195b82d2c70272f81c2eedb39bad9' --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586399; cv=none; d=zohomail.com; s=zohoarc; b=Zm44UvGibGP8KxloQrmHg2l5EaMsLkgb4gRpUK06PPAtVyPidUeSbkFOh4wuNZ29D1POPwj/3ziIJKfacQ76zrojmluG3xn6obWL6htyGnmNGyRPez4KHoVCEMpumsVx30OlRW18rDg28hCzw/1qTGngDrBXAeSbeaBfv3Xw7tE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586399; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hANHaf84v0nOxHvSTCu1XX5AcSLKOywXqLsXd8iIbvY=; b=KauRAbIqaqn2OpWCGKadueTTsXFUqz9EEKaB1Dn7hlPIXaER4gf+R8yjGWBtg2DYBC1AP914lp8R0720UxmVy9djLNcCioWDEe+JT8MDKmKFr1Hjly1fbfmzj3J5xzykCVZf8RDkclCsCcKL83F5Px8Epy9WETZ58KWrl0FqDio= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166558639923823.166793141735866; Wed, 12 Oct 2022 07:53:19 -0700 (PDT) Received: from localhost ([::1]:44744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid6k-0000Md-7i for importer@patchew.org; Wed, 12 Oct 2022 10:53:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicni-0005HF-V4 for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicng-0006lF-LJ for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 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-298-qCS9Tl1fOYaSnxDZovofVA-1; Wed, 12 Oct 2022 10:33:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4706A833AEF for ; Wed, 12 Oct 2022 14:33:34 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62F7D2144B20; Wed, 12 Oct 2022 14:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585216; 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=hANHaf84v0nOxHvSTCu1XX5AcSLKOywXqLsXd8iIbvY=; b=Zm8pDJTFMPoHegwRjTmrlDUhxJD0Z/zv5d8oXWg8RDeQHAYWq1QDRWS69CyPdVTK2cI888 VW8XtgohSddMSYBd7k5bqOdCT3D8LN51IhJglnz/iU74mZ9gzV/q7fd2+vzYUBjHbe4WqF DdB5eBxU9eVCsd2bcPiTFWjcks6ZPAI= X-MC-Unique: qCS9Tl1fOYaSnxDZovofVA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 13/16] qtest: start a VNC test Date: Wed, 12 Oct 2022 16:33:13 +0200 Message-Id: <20221012143316.988561-14-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586399740100001 From: Marc-Andr=C3=A9 Lureau This is some of the simplest test we could perform, it simply connects to the VNC server via passed-in socket FDs and checks the connection can be established. Another series will make this test work on Windows as well. As always, more tests can be added later! :) Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20221006130513.2683873-1-marcandre.lureau@redhat.com> Signed-off-by: Thomas Huth --- tests/qtest/vnc-display-test.c | 103 +++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 8 ++- 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/vnc-display-test.c diff --git a/tests/qtest/vnc-display-test.c b/tests/qtest/vnc-display-test.c new file mode 100644 index 0000000000..e2a9d682bb --- /dev/null +++ b/tests/qtest/vnc-display-test.c @@ -0,0 +1,103 @@ +/* + * VNC display tests + * + * Copyright (c) 2022 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/sockets.h" +#include "libqtest.h" +#include +#include + +typedef struct Test { + QTestState *qts; + VncConnection *conn; + GMainLoop *loop; +} Test; + +static void on_vnc_error(VncConnection* self, + const char* msg) +{ + g_error("vnc-error: %s", msg); +} + +static void on_vnc_auth_failure(VncConnection *self, + const char *msg) +{ + g_error("vnc-auth-failure: %s", msg); +} + +static bool +test_setup(Test *test) +{ +#ifdef WIN32 + g_test_skip("Not supported on Windows yet"); + return false; +#else + int pair[2]; + + test->qts =3D qtest_init("-vnc none -name vnc-test"); + + g_assert_cmpint(qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, pair), =3D=3D= , 0); + + qtest_qmp_add_client(test->qts, "vnc", pair[1]); + + test->conn =3D vnc_connection_new(); + g_signal_connect(test->conn, "vnc-error", + G_CALLBACK(on_vnc_error), NULL); + g_signal_connect(test->conn, "vnc-auth-failure", + G_CALLBACK(on_vnc_auth_failure), NULL); + vnc_connection_set_auth_type(test->conn, VNC_CONNECTION_AUTH_NONE); + vnc_connection_open_fd(test->conn, pair[0]); + + test->loop =3D g_main_loop_new(NULL, FALSE); + return true; +#endif +} + +static void +test_vnc_basic_on_vnc_initialized(VncConnection *self, + Test *test) +{ + const char *name =3D vnc_connection_get_name(test->conn); + + g_assert_cmpstr(name, =3D=3D, "QEMU (vnc-test)"); + g_main_loop_quit(test->loop); +} + +static void +test_vnc_basic(void) +{ + Test test; + + if (!test_setup(&test)) { + return; + } + + g_signal_connect(test.conn, "vnc-initialized", + G_CALLBACK(test_vnc_basic_on_vnc_initialized), &test); + + g_main_loop_run(test.loop); + + qtest_quit(test.qts); + g_object_unref(test.conn); + g_main_loop_unref(test.loop); +} + +int +main(int argc, char **argv) +{ + if (getenv("GTK_VNC_DEBUG")) { + vnc_util_set_debug(true); + } + + g_test_init(&argc, &argv, NULL); + + qtest_add_func("/vnc-display/basic", test_vnc_basic); + + return g_test_run(); +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 455f1bbb7e..c07a5b1a5f 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -306,8 +306,14 @@ qtests =3D { 'vmgenid-test': files('boot-sector.c', 'acpi-utils.c'), } =20 +gvnc =3D dependency('gvnc-1.0', required: false) +if gvnc.found() + qtests +=3D {'vnc-display-test': [gvnc]} + qtests_generic +=3D [ 'vnc-display-test' ] +endif + if dbus_display -qtests +=3D {'dbus-display-test': [dbus_display1, gio]} + qtests +=3D {'dbus-display-test': [dbus_display1, gio]} endif =20 qtest_executables =3D {} --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586582; cv=none; d=zohomail.com; s=zohoarc; b=fvP6qpN9tnJhvGtEl4j95FK2vR6CtHH7X0rK6RqJbiLyswhUzDPVErOdOx5iXyCmNs2Bg0KaXkiA3fCm5BYn7iIONzg1RJ7VINh7zLME+6BRAzUoPzVASjFLmi4aHUwby5YCYnywqvhU+BfwJXWqAsjnuKyLbA2a3StMDiEW4ek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586582; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NG79vfZrr/LdefnLSi5w2DmpmuIrS/ajZ+sJ70ZByWs=; b=LSlabmvRkH0y4NDOZLueYtCs8Yw2gfCIM8mGo1lom6pmTlQx7QUae2TsYTXzhX9aDzU1m1bTjB4n77Y8KJzeRZVONc+Y6kaku5PhfPRxSqP3tG8GyeSvjr2VlnRuhkB+kmGtgiixIG5TQPAYVtnlSbQOlVX+HgK1F6bQjjTWcw0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586582131467.76685293813125; Wed, 12 Oct 2022 07:56:22 -0700 (PDT) Received: from localhost ([::1]:57990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oid9g-0003NO-VT for importer@patchew.org; Wed, 12 Oct 2022 10:56:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnm-0005SI-JC for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnk-0006mJ-OC for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:42 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-OVRZpjLUMN6tGHbkMo1_qA-1; Wed, 12 Oct 2022 10:33:35 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D8BC3C3C96B; Wed, 12 Oct 2022 14:33:35 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EE492144B20; Wed, 12 Oct 2022 14:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585220; 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=NG79vfZrr/LdefnLSi5w2DmpmuIrS/ajZ+sJ70ZByWs=; b=eC23nSeWvlIj16NOdvkSEbbvZN55mLTnMIOLqPaNX9rXmJmEv0E54S3bS+S2RGkwdz+k3/ LZ2BHqx4rIAJd/97PZvcH08Hu8cxXIT+1OEQ5PgdIfmxTOVA3GQkHfq6/OLo7I5UHb7Mzq 1LXvnpFwUCB2tdAufNw8I5sDfXVD4Po= X-MC-Unique: OVRZpjLUMN6tGHbkMo1_qA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 14/16] tests/qtest: migration-test: Avoid using hardcoded /tmp Date: Wed, 12 Oct 2022 16:33:14 +0200 Message-Id: <20221012143316.988561-15-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586583072100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20221006151927.2079583-5-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/migration-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 0d153d6b5e..ef4427ff4d 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -102,7 +102,7 @@ static bool ufd_version_check(void) =20 #endif =20 -static const char *tmpfs; +static char *tmpfs; =20 /* The boot file modifies memory area in [start_address, end_address) * repeatedly. It outputs a 'B' at a fixed rate while it's still running. @@ -2451,10 +2451,10 @@ static bool kvm_dirty_ring_supported(void) =20 int main(int argc, char **argv) { - char template[] =3D "/tmp/migration-test-XXXXXX"; const bool has_kvm =3D qtest_has_accel("kvm"); const bool has_uffd =3D ufd_version_check(); const char *arch =3D qtest_get_arch(); + g_autoptr(GError) err =3D NULL; int ret; =20 g_test_init(&argc, &argv, NULL); @@ -2479,9 +2479,10 @@ int main(int argc, char **argv) return g_test_run(); } =20 - tmpfs =3D g_mkdtemp(template); + tmpfs =3D g_dir_make_tmp("migration-test-XXXXXX", &err); if (!tmpfs) { - g_test_message("g_mkdtemp on path (%s): %s", template, strerror(er= rno)); + g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs, + err->message); } g_assert(tmpfs); =20 @@ -2612,6 +2613,7 @@ int main(int argc, char **argv) g_test_message("unable to rmdir: path (%s): %s", tmpfs, strerror(errno)); } + g_free(tmpfs); =20 return ret; } --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586746; cv=none; d=zohomail.com; s=zohoarc; b=MNyFnHR9qTQ6mV9c6AS40Ar4pxt2COsERWvvatApFD/FvD24Uk8kuIzFONNTOkzqPIyzGHagZjjrRbWMoyMl3V8g4abO6w/L68bQV5bu429A/82o2AiHwnOCxN9cjJFn5svdEhHNOB5oaHgdmfIobhUV6YMnoO3bMKOwSJu+1nA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586746; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w076SWkJJOkjZFaj0BfZJw5JH0gUIJEhmWVlVD4ADqc=; b=AvMFl38PnU0FihlWntJGPIVn2OUcjeEwRlGqNFQRJKeU0kPiBhxFxwAq/0Sr1Th7CO4gqqfZG96bm1HnlkOcPK96OVCrWKGTOAMAnJf8eI9t5ozYJXHbfWJLID8IYmBNd4W4lwSMUuAiOrN27KCStIyog53R1gS0wQx5u42lkeY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586746812138.72080042182324; Wed, 12 Oct 2022 07:59:06 -0700 (PDT) Received: from localhost ([::1]:58754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oidCK-0007qQ-A6 for importer@patchew.org; Wed, 12 Oct 2022 10:59:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnk-0005Mf-Ht for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43215) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicni-0006ll-UY for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:40 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-_4b0MgGkOUyUD-06Dxia7w-1; Wed, 12 Oct 2022 10:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4BC2299E74E; Wed, 12 Oct 2022 14:33:36 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id F00212144B20; Wed, 12 Oct 2022 14:33:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585218; 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=w076SWkJJOkjZFaj0BfZJw5JH0gUIJEhmWVlVD4ADqc=; b=ZU3CMaeDTzmcP27gfuiQeS+iGRRLZNAtxr44A9MaCD3/zIih9wgWSyj/jaJXS/DGaSghTU voIv3tnTZdPVt1bdjUc8ulC1OGuA0RD6Cn53CZqSdP2fBBLAlHvV3GTJsCl7HwOOasy2h3 /guq6w5KmHoR1mCxMAcz1Y5XyS7+qIQ= X-MC-Unique: _4b0MgGkOUyUD-06Dxia7w-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 15/16] tests/qtest: libqtest: Install signal handler via signal() Date: Wed, 12 Oct 2022 16:33:15 +0200 Message-Id: <20221012143316.988561-16-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586748083100001 From: Bin Meng At present the codes uses sigaction() to install signal handler with a flag SA_RESETHAND. Such usage can be covered by the signal() API that is a simplified interface to the general sigaction() facility. Update to use signal() to install the signal handler, as it is available on Windows which we are going to support. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20221006151927.2079583-11-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqtest.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 7b6152807b..b23eb3edc3 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -66,7 +66,7 @@ struct QTestState }; =20 static GHookList abrt_hooks; -static struct sigaction sigact_old; +static void (*sighandler_old)(int); =20 static int qtest_query_target_endianness(QTestState *s); =20 @@ -179,20 +179,12 @@ static void sigabrt_handler(int signo) =20 static void setup_sigabrt_handler(void) { - struct sigaction sigact; - - /* Catch SIGABRT to clean up on g_assert() failure */ - sigact =3D (struct sigaction){ - .sa_handler =3D sigabrt_handler, - .sa_flags =3D SA_RESETHAND, - }; - sigemptyset(&sigact.sa_mask); - sigaction(SIGABRT, &sigact, &sigact_old); + sighandler_old =3D signal(SIGABRT, sigabrt_handler); } =20 static void cleanup_sigabrt_handler(void) { - sigaction(SIGABRT, &sigact_old, NULL); + signal(SIGABRT, sighandler_old); } =20 static bool hook_list_is_empty(GHookList *hook_list) --=20 2.31.1 From nobody Sun Feb 8 12:51:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665586810; cv=none; d=zohomail.com; s=zohoarc; b=Pm08H7rd1Pv+INEsfXQRRusS2vgsW+kGQl7HKQs516C3waru1dqNm091BJCJok8yVo02pScbnJOpYJzw8C24mo1H84qv7II6wKla3U/cbwvEXOb2Z3NlsVKemnyg530V7zl/EoLhM04Uco1tfLS4QdeS4Mpf0kJQmoUbS0Omulo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665586810; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AuHzGaGBncmQNomGwdGk/BrdHJBvT87m/cL3VKwyV7I=; b=fJRaIHCWioB5nVkZgKY8xikSadg8a55WJZqDbU9E7ERxK+YfIaUw78eakFb45uEvU7Se7bfygacJCQXyPz2WU14U2Yvnl4GhKVjHvgLAB64zW+GSjp4ryNz4cEptGwspLvk6U9q09Sj7TDM7j6TcG0dAPD8ZEHpmQUv4T7ADyzk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1665586810952770.5060212634111; Wed, 12 Oct 2022 08:00:10 -0700 (PDT) Received: from localhost ([::1]:40812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oidDM-0000OW-Fq for importer@patchew.org; Wed, 12 Oct 2022 11:00:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnl-0005QR-Jo for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnk-0006mC-2I for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:41 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-301-44vC0LlrOkuqWEQCMvG7cA-1; Wed, 12 Oct 2022 10:33:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 047F1382ECC6 for ; Wed, 12 Oct 2022 14:33:38 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 383A62144B20; Wed, 12 Oct 2022 14:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585219; 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=AuHzGaGBncmQNomGwdGk/BrdHJBvT87m/cL3VKwyV7I=; b=AnPayDw2DmnGqJod1CgJHiOISFd3Pw9QAIM96eQ/xrfJSHEccturuUu8bChbQz1fDUjyjB gj44d1w0XIm1VjffBokPaIwTDEojAwb17UF30y5FuzGMJOny5eR3xONOJYo8KNzVUbXp1Y ZmIeAms+G6chw+rJiqIlaIuBDcX90XE= X-MC-Unique: 44vC0LlrOkuqWEQCMvG7cA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 16/16] tests/unit/test-image-locking: Fix handling of temporary files Date: Wed, 12 Oct 2022 16:33:16 +0200 Message-Id: <20221012143316.988561-17-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665586813053100001 test-image-locking leaves some temporary files around - clean them up. While we're at it, test-image-locking is a unit test, so it should not use "qtest.*" for temporary file names. Give them better names instead, so that it clear where the temporary files come from. Message-Id: <20221012085932.799221-1-thuth@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- tests/unit/test-image-locking.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/test-image-locking.c b/tests/unit/test-image-lockin= g.c index a47299c247..2624cec6a0 100644 --- a/tests/unit/test-image-locking.c +++ b/tests/unit/test-image-locking.c @@ -79,7 +79,7 @@ static void test_image_locking_basic(void) g_autofree char *img_path =3D NULL; uint64_t perm, shared_perm; =20 - int fd =3D g_file_open_tmp("qtest.XXXXXX", &img_path, NULL); + int fd =3D g_file_open_tmp("qemu-tst-img-lock.XXXXXX", &img_path, NULL= ); assert(fd >=3D 0); =20 perm =3D BLK_PERM_WRITE | BLK_PERM_CONSISTENT_READ; @@ -120,7 +120,7 @@ static void test_set_perm_abort(void) g_autofree char *img_path =3D NULL; uint64_t perm, shared_perm; int r; - int fd =3D g_file_open_tmp("qtest.XXXXXX", &img_path, NULL); + int fd =3D g_file_open_tmp("qemu-tst-img-lock.XXXXXX", &img_path, NULL= ); assert(fd >=3D 0); =20 perm =3D BLK_PERM_WRITE | BLK_PERM_CONSISTENT_READ; @@ -140,6 +140,8 @@ static void test_set_perm_abort(void) check_locked_bytes(fd, perm, ~shared_perm); blk_unref(blk1); blk_unref(blk2); + close(fd); + unlink(img_path); } =20 int main(int argc, char **argv) --=20 2.31.1