From nobody Sun Feb 8 18:30:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562358915; cv=none; d=zoho.com; s=zohoarc; b=PvQk8O26H2qipY3ol/Y6PetDa5gBc1EkNSH1MGdDx1tI710In6He3SAciz5pnj4uEKA6xm9m24uAswnp/N8KQy/5+8G+POI1tgVCwoLtdgYwRX+RY4wktS0mX2gSFLPvwF/T7G+l1Zh/CZYodrnJWZslzB5/sP/gu7nr3X5bqRE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562358915; 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:ARC-Authentication-Results; bh=h1tkzDg7kirzmKAjoadskKCl/xFKq2pMLhTi2iA8kag=; b=NV4FybB4Yb0dZ9FBMaZP/+prKjk/l3Sah5iac7p2bBb+KVDmPt+rUqnOt51D+yTVwxM35HVseRprTBjc69xhAvbdcl8Pw+yjrH8hxFdF+G6GuWTjRfxQT/kl+1aTl+V3dRcgW3f/B+MAOrMOzpPKtvv54IcAs4ncZGnbqLG9m6o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562358915491672.4799504562353; Fri, 5 Jul 2019 13:35:15 -0700 (PDT) Received: from localhost ([::1]:55928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUvH-0007sI-7s for importer@patchew.org; Fri, 05 Jul 2019 16:35:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33108) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjUeT-000680-M0 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 16:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjUeS-0007Up-H8 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 16:17:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40084) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjUeP-0007S5-TD; Fri, 05 Jul 2019 16:17:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DB3E3082E06; Fri, 5 Jul 2019 20:17:45 +0000 (UTC) Received: from probe.redhat.com (ovpn-122-149.rdu2.redhat.com [10.10.122.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03DC586432; Fri, 5 Jul 2019 20:17:42 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Fri, 5 Jul 2019 16:16:29 -0400 Message-Id: <20190705201631.26266-17-jsnow@redhat.com> In-Reply-To: <20190705201631.26266-1-jsnow@redhat.com> References: <20190705201631.26266-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 05 Jul 2019 20:17:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 16/18] iotests: Add virtio-scsi device helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , vsementsov@virtuozzo.com, Juan Quintela , Wen Congyang , Xie Changlong , "Dr. David Alan Gilbert" , Markus Armbruster , John Snow , Stefan Hajnoczi , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Seems that it comes up enough. Reviewed-by: Max Reitz Signed-off-by: John Snow --- tests/qemu-iotests/040 | 6 +----- tests/qemu-iotests/093 | 6 ++---- tests/qemu-iotests/139 | 7 ++----- tests/qemu-iotests/238 | 5 +---- tests/qemu-iotests/iotests.py | 4 ++++ 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index b81133a474..657b37103c 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -85,11 +85,7 @@ class TestSingleDrive(ImageCommitTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288',= mid_img) self.vm =3D iotests.VM().add_drive(test_img, "node-name=3Dtop,back= ing.node-name=3Dmid,backing.backing.node-name=3Dbase", interface=3D"none") - if iotests.qemu_default_machine =3D=3D 's390-ccw-virtio': - self.vm.add_device("virtio-scsi-ccw") - else: - self.vm.add_device("virtio-scsi-pci") - + self.vm.add_device(iotests.get_virtio_scsi_device()) self.vm.add_device("scsi-hd,id=3Dscsi0,drive=3Ddrive0") self.vm.launch() =20 diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index d88fbc182e..46153220f8 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -366,10 +366,8 @@ class ThrottleTestGroupNames(iotests.QMPTestCase): class ThrottleTestRemovableMedia(iotests.QMPTestCase): def setUp(self): self.vm =3D iotests.VM() - if iotests.qemu_default_machine =3D=3D 's390-ccw-virtio': - self.vm.add_device("virtio-scsi-ccw,id=3Dvirtio-scsi") - else: - self.vm.add_device("virtio-scsi-pci,id=3Dvirtio-scsi") + self.vm.add_device("{},id=3Dvirtio-scsi".format( + iotests.get_virtio_scsi_device())) self.vm.launch() =20 def tearDown(self): diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index 933b45121a..2176ea51ba 100755 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -35,11 +35,8 @@ class TestBlockdevDel(iotests.QMPTestCase): def setUp(self): iotests.qemu_img('create', '-f', iotests.imgfmt, base_img, '1M') self.vm =3D iotests.VM() - if iotests.qemu_default_machine =3D=3D 's390-ccw-virtio': - self.vm.add_device("virtio-scsi-ccw,id=3Dvirtio-scsi") - else: - self.vm.add_device("virtio-scsi-pci,id=3Dvirtio-scsi") - + self.vm.add_device("{},id=3Dvirtio-scsi".format( + iotests.get_virtio_scsi_device())) self.vm.launch() =20 def tearDown(self): diff --git a/tests/qemu-iotests/238 b/tests/qemu-iotests/238 index 1c0a46fa90..387a77b2cd 100755 --- a/tests/qemu-iotests/238 +++ b/tests/qemu-iotests/238 @@ -23,10 +23,7 @@ import os import iotests from iotests import log =20 -if iotests.qemu_default_machine =3D=3D 's390-ccw-virtio': - virtio_scsi_device =3D 'virtio-scsi-ccw' -else: - virtio_scsi_device =3D 'virtio-scsi-pci' +virtio_scsi_device =3D iotests.get_virtio_scsi_device() =20 vm =3D iotests.VM() vm.launch() diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6135c9663d..8ae7bc353e 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -164,6 +164,10 @@ def qemu_io_silent(*args): (-exitcode, ' '.join(args))) return exitcode =20 +def get_virtio_scsi_device(): + if qemu_default_machine =3D=3D 's390-ccw-virtio': + return 'virtio-scsi-ccw' + return 'virtio-scsi-pci' =20 class QemuIoInteractive: def __init__(self, *args): --=20 2.21.0