From nobody Tue Nov 11 22:35:18 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; 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=1565998267; cv=none; d=zoho.com; s=zohoarc; b=OtycVsx2eLElSuqT/YgcAcbrNj4XGyDxJxL/wHvlrNkQtIjaldTrXg+0k83T2Y642WaaWrwh3fgWRp6VL4DdFHD2Zz9kR4mioikg5nQZuielfdixd6HGPCak/csWlltVJMgEictxwKariaQZE/BPElhR5dJLwuomFFx41m8dJX8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565998267; 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=wFeuuCXPAecWVye4Me3evEFEQ/aszTejV5slm90lmEw=; b=Zl/M+RiaapUnqlpZybeRUiVeO3yuQAH9dvAmNlYcyqD2e0QDbZ/fMnskkQlLMxbwUh1jFkT6cZtR7WMV8NQSLua3UuhV25EDlJDLGPHU3grgUXLRD/DRISkVwEYhu4bIGAM9mka2V8SnpArsxseJskdZ1HjSAs1QkvbWmmfX0kg= 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 1565998267752195.56132535929976; Fri, 16 Aug 2019 16:31:07 -0700 (PDT) Received: from localhost ([::1]:33272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hylgY-0003db-J8 for importer@patchew.org; Fri, 16 Aug 2019 19:31:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hylPk-0006V5-4N for qemu-devel@nongnu.org; Fri, 16 Aug 2019 19:13:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hylPi-0005w6-B3 for qemu-devel@nongnu.org; Fri, 16 Aug 2019 19:13:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51230) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hylPc-0005ps-Ur; Fri, 16 Aug 2019 19:13:37 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28926308427C; Fri, 16 Aug 2019 23:13:36 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-187.bos.redhat.com [10.18.17.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74B65165D8; Fri, 16 Aug 2019 23:13:35 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Date: Fri, 16 Aug 2019 19:12:58 -0400 Message-Id: <20190816231318.8650-17-jsnow@redhat.com> In-Reply-To: <20190816231318.8650-1-jsnow@redhat.com> References: <20190816231318.8650-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 16 Aug 2019 23:13:36 +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] [PULL 16/36] 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: peter.maydell@linaro.org, jsnow@redhat.com, qemu-stable@nongnu.org, qemu-block@nongnu.org, 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. Signed-off-by: John Snow Reviewed-by: Max Reitz Message-id: 20190709232550.10724-17-jsnow@redhat.com 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 aa0b1847e30..6db9abf8e6e 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() self.has_quit =3D False diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 4b2cac1d0c6..3c4f5173cea 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -367,10 +367,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 933b45121a9..2176ea51ba8 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 08bc7e6b4be..e5ac2b2ff84 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 385dbad16ac..84438e837cb 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