From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517579; cv=none; d=zohomail.com; s=zohoarc; b=Mq16Q6lOWgTnJp6nBhuKyAjKuVVSSBqzOMpos6t1RSHCC8SRJQmRgR5JoLTlQeYA2xce41XGyVhnzUg7jB6l22uFFqA70ZHvSDE+xJJng1e947gPaRfQXsEpQP6saO+xvjdV77dqBMwQDRUEk58No06EBUy4G9C7pbpls1lWmU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517579; 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=3On4XWfVcj5B+no5b4p44Jfdeq4GsAjz4vRXBd1i3iM=; b=ZIKFNIKNbm2J2uxby/87nI/PZ7Sp2BSasStXneEbyPKo3tBmzv3f5c3GHyAkyvhG/5GHqDckYjVNWsG5A1a7SgtRjZ9OfogUTRFDgov5gqVi3FT6lQwgsFU91xts50xibK9jNmijB8b9ResSHIxU9/vizo6VZ4ED3OuytQM7Zag= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517579087725.5902827073239; Mon, 16 Dec 2019 09:32:59 -0800 (PST) Received: from localhost ([::1]:57718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguEr-0002VL-0T for importer@patchew.org; Mon, 16 Dec 2019 12:32:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49649) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrp-000531-Hc for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtro-0004Op-DH for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:09 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:47237 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtro-0004OC-8z for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:08 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-122-ZWR0TYuIO22l0utsbNBxbg-1; Mon, 16 Dec 2019 12:09:04 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 255BE1005514; Mon, 16 Dec 2019 17:09:03 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0287E6FEE8; Mon, 16 Dec 2019 17:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516147; 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=3On4XWfVcj5B+no5b4p44Jfdeq4GsAjz4vRXBd1i3iM=; b=VPtmUsor3lZmpNKF8TTmdJPlJ13bkO72gaDVRdd7O8afIasgrYG31uDGXDsDtqrjj2Lox1 THiO9rUtGKGZZXsIUgCwZKaBkgaF1hpL0ci9ugUceYRlwisg6pYPrfwsPQdwAuxsySdCRj WvQQaKbrLc3IEaWO/+x47cRkfI8ZChk= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 01/10] iotests: Create VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:48 +0100 Message-Id: <20191216170857.11880-2-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: ZWR0TYuIO22l0utsbNBxbg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We have several almost identical copies of a blockdev_create() function in different test cases. Time to create one unified function in iotests.py. To keep the diff managable, this patch only creates the function and follow-up patches will convert the individual test cases. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b46d298766..8739ec6613 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -643,6 +643,22 @@ class VM(qtest.QEMUQtestMachine): elif status =3D=3D 'null': return error =20 + # Returns None on success, and an error string on failure + def blockdev_create(self, options, job_id=3D'job0', filters=3DNone): + if filters is None: + filters =3D [filter_qmp_testfiles] + result =3D self.qmp_log('blockdev-create', filters=3Dfilters, + job_id=3Djob_id, options=3Doptions) + + if 'return' in result: + assert result['return'] =3D=3D {} + job_result =3D self.run_job(job_id) + else: + job_result =3D result['error'] + + log("") + return job_result + def enable_migration_events(self, name): log('Enabling migration QMP events on %s...' % name) log(self.qmp('migrate-set-capabilities', capabilities=3D[ --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517734; cv=none; d=zohomail.com; s=zohoarc; b=Sy292XkMCN9sh2ojIpu2Az7gjtayoHewCPCF45ZM+wj9BFTNl5AYJGoHjx+JzcqpKHgBfBdbs7KOqh3yrRf3iL35YUH7WbhKuhjRj+NyCfRMN5oZLce/TsWzEkixmtrnCHtFzo5Jdr5nNa5v8KO2r2LkYmRoL94dHEKsSyUuv+I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517734; 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=3YS1dY+lpd5KH2FgvI5OuVMODij5wmEAcrLZPNNxw8o=; b=H2lji9Cw2OHavyDqadDnYLCT8cE5TTDP2TSuw/OT5hK97A4iMU8ZudKA1kBnEYa0O7BboJa104zO2dnlwOX0OMRt1Pwx953Ciu1kX2HGF+YSXttXVpIXEFe8zuN8uCCVYQQuRUCA5PEeLyUBE8HvpoHL/pRaEyVUQVQSUjM/U7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517734398948.2677784721927; Mon, 16 Dec 2019 09:35:34 -0800 (PST) Received: from localhost ([::1]:57752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguHM-0006Am-Jk for importer@patchew.org; Mon, 16 Dec 2019 12:35:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49675) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrq-00054v-OB for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtrp-0004QE-Nl for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:10 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:22903 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrp-0004Pe-Ko for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-72-lt6hyDsfPgm6tY2WQf24Bg-1; Mon, 16 Dec 2019 12:09:05 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F10C1005510; Mon, 16 Dec 2019 17:09:04 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AC5D7C835; Mon, 16 Dec 2019 17:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516149; 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=3YS1dY+lpd5KH2FgvI5OuVMODij5wmEAcrLZPNNxw8o=; b=DQfrnsECOYld6mtM0EeLQZMyVmIOtk/Th+kU2MxPghdjCSi7CdVrJLhk3kRkKutKSqsn9r Kaf0z+vZu3B/Tqb8keV0mfP9IneCOeAaO5w3VN8QFP5pcvYfAfOtsvUlnXq062UUohW19V krR5hncay67qMUiOKtzMtGeMvOaQC1o= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 02/10] iotests: 255: Drop blockdev_create() Date: Mon, 16 Dec 2019 18:08:49 +0100 Message-Id: <20191216170857.11880-3-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: lt6hyDsfPgm6tY2WQf24Bg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" blockdev_create() is completely unused in this test case, so we can just drop it. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/255 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255 index 3632d507d0..0ba03d9e61 100755 --- a/tests/qemu-iotests/255 +++ b/tests/qemu-iotests/255 @@ -25,16 +25,6 @@ from iotests import imgfmt =20 iotests.verify_image_format(supported_fmts=3D['qcow2']) =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', - filters=3D[iotests.filter_qmp_testfiles], - job_id=3D'job0', options=3Doptions) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") - iotests.log('Finishing a commit job with background reads') iotests.log('=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D') iotests.log('') --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517872; cv=none; d=zohomail.com; s=zohoarc; b=O/83CjmsFexzC66nrg2IRRyYJjsD9s7KuPqRSwedCQbBSXIq0zXP1880gRuGAyX2P7ViwEzayXte91f3mSFZKHBbUwNIhE1xI/B++z0XKdwejdJIwSRDpV6q8Dd4jPGiE7of3Ky8uVoCqipEMTGoDdW0YNKuE64yiICevwtEGxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517872; 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=9w/18jZyLV30S83YZql6CNRQOdsnRN+w62k/NbVivo4=; b=ACucp/ddnqQYwdGNvKbIgJ5+4GV1lPKQEHF4NWCaGScUHot/zTkCbxDtp4BY3nH7C3RKKAKxYvIQLjEJJaJ1lfZs8DH40EaEXJh5CV8PhPbhChd6xjiChoSjFkzbwsukqGSJmxhc9TShzNCaBZypUcIn0/cMqvkOY6u7kPAXEjw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517872902778.6560732570476; Mon, 16 Dec 2019 09:37:52 -0800 (PST) Received: from localhost ([::1]:57832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguJb-000188-CY for importer@patchew.org; Mon, 16 Dec 2019 12:37:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49700) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrs-00057p-JK for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtrr-0004Rp-0X for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:12 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:43809 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrq-0004R5-SK for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-200-E5vhkJDnPJKeK0y3-wuteA-1; Mon, 16 Dec 2019 12:09:07 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29902800D4C; Mon, 16 Dec 2019 17:09:06 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id D38467C81E; Mon, 16 Dec 2019 17:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516150; 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=9w/18jZyLV30S83YZql6CNRQOdsnRN+w62k/NbVivo4=; b=Ff65bxzEFoxcHMs0jci3bJh8D/x3l12zJ3PqG/Gp9ZDo4yUOtgCFixoiQxrMRD4wXZfOGu PSg60j2PgMml+9qiqNgAqvsc33qSl4RMi2USpXEJWrwZkGdx5Zm2CxfZa+8FuTWzdie+Lc ZaTIO8VeowCUu0Ului2XQmDnntbvDjE= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 03/10] iotests: 206: Convert to VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:50 +0100 Message-Id: <20191216170857.11880-4-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: E5vhkJDnPJKeK0y3-wuteA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/206 | 232 ++++++++++++++++++++--------------------- 1 file changed, 111 insertions(+), 121 deletions(-) diff --git a/tests/qemu-iotests/206 b/tests/qemu-iotests/206 index 5bb738bf23..9f16a7df8d 100755 --- a/tests/qemu-iotests/206 +++ b/tests/qemu-iotests/206 @@ -25,16 +25,6 @@ from iotests import imgfmt =20 iotests.verify_image_format(supported_fmts=3D['qcow2']) =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', - filters=3D[iotests.filter_qmp_testfiles], - job_id=3D'job0', options=3Doptions) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") - with iotests.FilePath('t.qcow2') as disk_path, \ iotests.FilePath('t.qcow2.base') as backing_path, \ iotests.VM() as vm: @@ -50,18 +40,18 @@ with iotests.FilePath('t.qcow2') as disk_path, \ size =3D 128 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) =20 vm.qmp_log('blockdev-add', filters=3D[iotests.filter_qmp_testfiles], driver=3D'file', filename=3Ddisk_path, node_name=3D'imgfile') =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'imgfile', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'imgfile', + 'size': size }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -76,23 +66,23 @@ with iotests.FilePath('t.qcow2') as disk_path, \ size =3D 64 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0, - 'preallocation': 'off', - 'nocow': False }) - - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'version': 'v3', - 'cluster-size': 65536, - 'preallocation': 'off', - 'lazy-refcounts': False, - 'refcount-bits': 16 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0, + 'preallocation': 'off', + 'nocow': False }) + + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'version': 'v3', + 'cluster-size': 65536, + 'preallocation': 'off', + 'lazy-refcounts': False, + 'refcount-bits': 16 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -107,23 +97,23 @@ with iotests.FilePath('t.qcow2') as disk_path, \ size =3D 32 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0, - 'preallocation': 'falloc', - 'nocow': True }) - - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'version': 'v3', - 'cluster-size': 2097152, - 'preallocation': 'metadata', - 'lazy-refcounts': True, - 'refcount-bits': 1 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0, + 'preallocation': 'falloc', + 'nocow': True }) + + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'version': 'v3', + 'cluster-size': 2097152, + 'preallocation': 'metadata', + 'lazy-refcounts': True, + 'refcount-bits': 1 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -135,20 +125,20 @@ with iotests.FilePath('t.qcow2') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'backing-file': backing_path, - 'backing-fmt': 'qcow2', - 'version': 'v2', - 'cluster-size': 512 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'backing-file': backing_path, + 'backing-fmt': 'qcow2', + 'version': 'v2', + 'cluster-size': 512 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -160,22 +150,22 @@ with iotests.FilePath('t.qcow2') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'encrypt': { - 'format': 'luks', - 'key-secret': 'keysec0', - 'cipher-alg': 'twofish-128', - 'cipher-mode': 'ctr', - 'ivgen-alg': 'plain64', - 'ivgen-hash-alg': 'md5', - 'hash-alg': 'sha1', - 'iter-time': 10, - }}) + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'encrypt': { + 'format': 'luks', + 'key-secret': 'keysec0', + 'cipher-alg': 'twofish-128', + 'cipher-mode': 'ctr', + 'ivgen-alg': 'plain64', + 'ivgen-hash-alg': 'md5', + 'hash-alg': 'sha1', + 'iter-time': 10, + }}) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -187,9 +177,9 @@ with iotests.FilePath('t.qcow2') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': "this doesn't exist", - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': "this doesn't exist", + 'size': size }) vm.shutdown() =20 # @@ -211,9 +201,9 @@ with iotests.FilePath('t.qcow2') as disk_path, \ vm.launch() for size in [ 1234, 18446744073709551104, 9223372036854775808, 9223372036854775296 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size }) vm.shutdown() =20 # @@ -222,20 +212,20 @@ with iotests.FilePath('t.qcow2') as disk_path, \ iotests.log("=3D=3D=3D Invalid version =3D=3D=3D") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'version': 'v1' }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'version': 'v2', - 'lazy-refcounts': True }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'version': 'v2', - 'refcount-bits': 8 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'version': 'v1' }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'version': 'v2', + 'lazy-refcounts': True }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'version': 'v2', + 'refcount-bits': 8 }) vm.shutdown() =20 # @@ -244,15 +234,15 @@ with iotests.FilePath('t.qcow2') as disk_path, \ iotests.log("=3D=3D=3D Invalid backing file options =3D=3D=3D") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'backing-file': '/dev/null', - 'preallocation': 'full' }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'backing-fmt': imgfmt }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'backing-file': '/dev/null', + 'preallocation': 'full' }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'backing-fmt': imgfmt }) vm.shutdown() =20 # @@ -262,14 +252,14 @@ with iotests.FilePath('t.qcow2') as disk_path, \ =20 vm.launch() for csize in [ 1234, 128, 4194304, 0 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'cluster-size': csize }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 281474976710656, - 'cluster-size': 512 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'cluster-size': csize }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 281474976710656, + 'cluster-size': 512 }) vm.shutdown() =20 # @@ -279,8 +269,8 @@ with iotests.FilePath('t.qcow2') as disk_path, \ =20 vm.launch() for refcount_bits in [ 128, 0, 7 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'refcount-bits': refcount_bits }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'refcount-bits': refcount_bits }) vm.shutdown() --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517821; cv=none; d=zohomail.com; s=zohoarc; b=GG0nqJil8J31RacS4HMnchxqmA5iQs38OTyyrAQHNAeg+gZSAjsztPFsutr8Rz/CL+ZMwI/+xcBezwrL0hLELvoXXJ0XDPv/nKAZUN666XBFVKlFFTQXkDZouzDqBitydSWfwsO2mbfOd/7bjGb9EBSA18PlElScQ8xLQOVhIjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517821; 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=U04431BIeN0FzPjbcC98pWRFVUrdHv07OhSxu9XIOqY=; b=laAnn4Q+81FPdRDvy9XZa1WcW+gZLsjiEsLERwqtIpwvB9RC2as5yxJWFRz6SLxXFZ7EamA40/k4BaZiSlL2G64bucg4mGw6tX+AC7v2tuaFETCPJbgDAnGLA1+KQEpEsYLpAIebOId0PFC9kp1hwrj89jvq+rhPravFGeP5I+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517821721426.7650465407762; Mon, 16 Dec 2019 09:37:01 -0800 (PST) Received: from localhost ([::1]:57830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguIm-0000Rb-Af for importer@patchew.org; Mon, 16 Dec 2019 12:37:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49731) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtru-0005AQ-5D for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtrs-0004To-Ue for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:14 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:28839 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrs-0004TK-RX for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-FRHD0SwZOiO0hvMtbqO2DA-1; Mon, 16 Dec 2019 12:09:08 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F41D1800D63; Mon, 16 Dec 2019 17:09:07 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DA706FEE8; Mon, 16 Dec 2019 17:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516152; 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=U04431BIeN0FzPjbcC98pWRFVUrdHv07OhSxu9XIOqY=; b=BSAqgMZZS/vohnt+j84tNdB5Wjz177FhKTU5GC55mj3WRooT78IzlPd46C6woJDOjqDx1h gyyA9q23I9mbUCNujp1L+HSl8GsqeXRu+hI5SehDO2pvbv8WsXD61eiByzFy15TgdQvAz5 79ttpPPz0LCoqsgZ/jXcJETnYzMrtbY= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 04/10] iotests: 210: Convert to VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:51 +0100 Message-Id: <20191216170857.11880-5-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: FRHD0SwZOiO0hvMtbqO2DA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/210 | 81 +++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 45 deletions(-) diff --git a/tests/qemu-iotests/210 b/tests/qemu-iotests/210 index 565e3b7b9b..4ca0fe26ef 100755 --- a/tests/qemu-iotests/210 +++ b/tests/qemu-iotests/210 @@ -26,15 +26,6 @@ from iotests import imgfmt iotests.verify_image_format(supported_fmts=3D['luks']) iotests.verify_protocol(supported=3D['file']) =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles]) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") - with iotests.FilePath('t.luks') as disk_path, \ iotests.VM() as vm: =20 @@ -49,18 +40,18 @@ with iotests.FilePath('t.luks') as disk_path, \ size =3D 128 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) =20 vm.qmp_log('blockdev-add', driver=3D'file', filename=3Ddisk_path, node_name=3D'imgfile', filters=3D[iotests.filter_qmp_testfi= les]) =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'imgfile', - 'key-secret': 'keysec0', - 'size': size, - 'iter-time': 10 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'imgfile', + 'key-secret': 'keysec0', + 'size': size, + 'iter-time': 10 }) vm.shutdown() =20 # TODO Proper support for images to be used with imgopts and/or protoc= ols @@ -79,22 +70,22 @@ with iotests.FilePath('t.luks') as disk_path, \ size =3D 64 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'key-secret': 'keysec0', - 'cipher-alg': 'twofish-128', - 'cipher-mode': 'ctr', - 'ivgen-alg': 'plain64', - 'ivgen-hash-alg': 'md5', - 'hash-alg': 'sha1', - 'iter-time': 10 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'key-secret': 'keysec0', + 'cipher-alg': 'twofish-128', + 'cipher-mode': 'ctr', + 'ivgen-alg': 'plain64', + 'ivgen-hash-alg': 'md5', + 'hash-alg': 'sha1', + 'iter-time': 10 }) vm.shutdown() =20 # TODO Proper support for images to be used with imgopts and/or protoc= ols @@ -113,9 +104,9 @@ with iotests.FilePath('t.luks') as disk_path, \ size =3D 64 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': "this doesn't exist", - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': "this doesn't exist", + 'size': size }) vm.shutdown() =20 # @@ -126,11 +117,11 @@ with iotests.FilePath('t.luks') as disk_path, \ =20 vm.add_blockdev('driver=3Dfile,filename=3D%s,node-name=3Dnode0' % (dis= k_path)) vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'key-secret': 'keysec0', - 'size': 0, - 'iter-time': 10 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'key-secret': 'keysec0', + 'size': 0, + 'iter-time': 10 }) vm.shutdown() =20 # TODO Proper support for images to be used with imgopts and/or protoc= ols @@ -157,10 +148,10 @@ with iotests.FilePath('t.luks') as disk_path, \ =20 vm.launch() for size in [ 18446744073709551104, 9223372036854775808, 9223372036854= 775296 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'key-secret': 'keysec0', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'key-secret': 'keysec0', + 'size': size }) vm.shutdown() =20 # --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517978; cv=none; d=zohomail.com; s=zohoarc; b=kkZdIaNxwrNOuzaXm4Duj5WF2/qikBYT7v7yzq/Uh54AQdqIQlxocRv2k3apsuLM5gEbDZh2QctpTrVMtkU5R3FPmp0SFvqN5ANMZ6HjFfGE88GOwnNt/wPPImO0hZG/WwQGfZ32evIFccFgklzBCii+lMlx6mzNYr/pl5h0ImA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517978; 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=FEhUuCcQRA4LeWBGXMjUbkFOU0DMtH4AppbK9cHRxWA=; b=YuB3+PHpz1XqDHR4V9hPzjMtQJQZO+mbVlq0qsVjys/7wzHBdWuaoeQ3zh8P1CzqZu+hoH7muGMpqnVOm7ZBH2t//TanlXYbGXKMtrmrmZNxUDT8re6km0qCvang+K1BpOi7znG9CRul1x+0lG5IzcE81D7c1VUYPiI+vi2c7PM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517978059916.1376521404399; Mon, 16 Dec 2019 09:39:38 -0800 (PST) Received: from localhost ([::1]:57886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguLI-0003Rz-UV for importer@patchew.org; Mon, 16 Dec 2019 12:39:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49720) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrt-00059c-Ji for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtrs-0004T3-9p for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:13 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:45355 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrs-0004SU-5r for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-346-MrEnjDcoNTerlgjAjRXDHQ-1; Mon, 16 Dec 2019 12:09:10 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A9B018FF66A; Mon, 16 Dec 2019 17:09:09 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6D1C6FEE8; Mon, 16 Dec 2019 17:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516151; 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=FEhUuCcQRA4LeWBGXMjUbkFOU0DMtH4AppbK9cHRxWA=; b=ZiyOTXu9p9RLWBekgmBSUSQl3HvRheQRDIoRhnHHkMb3f5rAGX8y170O+grnur598OS5fu eAPMByg4y+g97dC7lQI14h1MuEUYnOxwq+J2khk2K04A0MJ+1Ya5aOvYpPRMyR2gapivp9 2+cS2uYERQyMUZx2HN5kTUdgNu2WkZs= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 05/10] iotests: 212: Convert to VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:52 +0100 Message-Id: <20191216170857.11880-6-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: MrEnjDcoNTerlgjAjRXDHQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/212 | 101 +++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 55 deletions(-) diff --git a/tests/qemu-iotests/212 b/tests/qemu-iotests/212 index 42b74f208b..8f3ccc7b15 100755 --- a/tests/qemu-iotests/212 +++ b/tests/qemu-iotests/212 @@ -26,15 +26,6 @@ from iotests import imgfmt iotests.verify_image_format(supported_fmts=3D['parallels']) iotests.verify_protocol(supported=3D['file']) =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles]) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") - with iotests.FilePath('t.parallels') as disk_path, \ iotests.VM() as vm: =20 @@ -47,16 +38,16 @@ with iotests.FilePath('t.parallels') as disk_path, \ size =3D 128 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) =20 vm.qmp_log('blockdev-add', driver=3D'file', filename=3Ddisk_path, node_name=3D'imgfile', filters=3D[iotests.filter_qmp_testfi= les]) =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'imgfile', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'imgfile', + 'size': size }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -71,16 +62,16 @@ with iotests.FilePath('t.parallels') as disk_path, \ size =3D 64 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'cluster-size': 1048576 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'cluster-size': 1048576 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -95,16 +86,16 @@ with iotests.FilePath('t.parallels') as disk_path, \ size =3D 32 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'cluster-size': 65536 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'cluster-size': 65536 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -116,9 +107,9 @@ with iotests.FilePath('t.parallels') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': "this doesn't exist", - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': "this doesn't exist", + 'size': size }) vm.shutdown() =20 # @@ -129,9 +120,9 @@ with iotests.FilePath('t.parallels') as disk_path, \ =20 vm.add_blockdev('driver=3Dfile,filename=3D%s,node-name=3Dnode0' % (dis= k_path)) vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 0 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -143,9 +134,9 @@ with iotests.FilePath('t.parallels') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 4503599627369984}) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 4503599627369984}) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -171,9 +162,9 @@ with iotests.FilePath('t.parallels') as disk_path, \ vm.launch() for size in [ 1234, 18446744073709551104, 9223372036854775808, 9223372036854775296, 4503599627370497 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size }) vm.shutdown() =20 # @@ -185,12 +176,12 @@ with iotests.FilePath('t.parallels') as disk_path, \ vm.launch() for csize in [ 1234, 128, 4294967296, 9223372036854775808, 18446744073709551104, 0 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'cluster-size': csize }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 281474976710656, - 'cluster-size': 512 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'cluster-size': csize }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 281474976710656, + 'cluster-size': 512 }) vm.shutdown() --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576518190; cv=none; d=zohomail.com; s=zohoarc; b=BYfRntDAD+PI7wEXIvdLyDpjPDmtKVEo5f0Rs6NLvpERSnQFDzSw0L4FjFmmS+ReZ5rtdpfRQc7SfziZrZzSEpfgAokFBmeGOqxhPujedDjIf13xUUTg/M+sR/YZCcen9HnabONMwncK0uHqlb9iESRcV2ZREIV3PzxsQ/CEfBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576518190; 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=Q/b2AIr/cOuzJSHtHnyYDwN6KgFug4kXWEVCI5FWvKU=; b=R69t6Hcra8xG+xiyJLhQj2otM4Mp5409kgaggws+ut3U/dWVvq9Ucgs+/CTcF7PtkCqPS7kY2p3+FOrlBayF7ZqHctu2dPjDyMz3he8HQI4962/XezZm45R4DpY/o0e4OvzFJvsfoXHuyS2odxL6DiN+8LsGMz9Y75dPzFONZUI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576518190850969.4694864561592; Mon, 16 Dec 2019 09:43:10 -0800 (PST) Received: from localhost ([::1]:57944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguOj-0008Kz-FB for importer@patchew.org; Mon, 16 Dec 2019 12:43:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49785) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrx-0005FH-SI for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtrv-0004WS-Bq for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:17 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:40269 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrv-0004W1-7r for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-366-rDdIUXu1PTy2UlqCr36zHw-1; Mon, 16 Dec 2019 12:09:11 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B34C900B40; Mon, 16 Dec 2019 17:09:10 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 517107C81C; Mon, 16 Dec 2019 17:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516154; 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=Q/b2AIr/cOuzJSHtHnyYDwN6KgFug4kXWEVCI5FWvKU=; b=g7Ow0Rqtv3R71/k6ZVucPPeF6NYKIj3NLYdiJcken47cvpsyaLFoHrpttFkAXBM3TfaNEs PHujX/u/zUKacz4mh5fn3qtFoforMW42rP8x+lOfmQ30z0likgnLr05evk+xHWgBgoufV1 EmnunH6ylZvenqpMz9C5+FZohvaUTyA= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 06/10] iotests: 213: Convert to VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:53 +0100 Message-Id: <20191216170857.11880-7-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: rDdIUXu1PTy2UlqCr36zHw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/213 | 113 +++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 61 deletions(-) diff --git a/tests/qemu-iotests/213 b/tests/qemu-iotests/213 index 5604f3cebb..3fc8dc6eaa 100755 --- a/tests/qemu-iotests/213 +++ b/tests/qemu-iotests/213 @@ -26,15 +26,6 @@ from iotests import imgfmt iotests.verify_image_format(supported_fmts=3D['vhdx']) iotests.verify_protocol(supported=3D['file']) =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles]) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") - with iotests.FilePath('t.vhdx') as disk_path, \ iotests.VM() as vm: =20 @@ -47,16 +38,16 @@ with iotests.FilePath('t.vhdx') as disk_path, \ size =3D 128 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) =20 vm.qmp_log('blockdev-add', driver=3D'file', filename=3Ddisk_path, node_name=3D'imgfile', filters=3D[iotests.filter_qmp_testfi= les]) =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'imgfile', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'imgfile', + 'size': size }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -71,19 +62,19 @@ with iotests.FilePath('t.vhdx') as disk_path, \ size =3D 64 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'log-size': 1048576, - 'block-size': 8388608, - 'subformat': 'dynamic', - 'block-state-zero': True }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'log-size': 1048576, + 'block-size': 8388608, + 'subformat': 'dynamic', + 'block-state-zero': True }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -98,19 +89,19 @@ with iotests.FilePath('t.vhdx') as disk_path, \ size =3D 32 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'log-size': 8388608, - 'block-size': 268435456, - 'subformat': 'fixed', - 'block-state-zero': False }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'log-size': 8388608, + 'block-size': 268435456, + 'subformat': 'fixed', + 'block-state-zero': False }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -122,9 +113,9 @@ with iotests.FilePath('t.vhdx') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': "this doesn't exist", - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': "this doesn't exist", + 'size': size }) vm.shutdown() =20 # @@ -135,9 +126,9 @@ with iotests.FilePath('t.vhdx') as disk_path, \ =20 vm.add_blockdev('driver=3Dfile,filename=3D%s,node-name=3Dnode0' % (dis= k_path)) vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 0 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -149,9 +140,9 @@ with iotests.FilePath('t.vhdx') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 70368744177664 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 70368744177664 }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -176,9 +167,9 @@ with iotests.FilePath('t.vhdx') as disk_path, \ vm.launch() for size in [ 18446744073709551104, 9223372036854775808, 9223372036854775296, 70368744177665 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size }) vm.shutdown() =20 # @@ -189,10 +180,10 @@ with iotests.FilePath('t.vhdx') as disk_path, \ =20 vm.launch() for bsize in [ 1234567, 128, 3145728, 536870912, 0 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'block-size': bsize }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'block-size': bsize }) vm.shutdown() =20 # @@ -203,8 +194,8 @@ with iotests.FilePath('t.vhdx') as disk_path, \ =20 vm.launch() for lsize in [ 1234567, 128, 4294967296, 0 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 67108864, - 'log-size': lsize }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 67108864, + 'log-size': lsize }) vm.shutdown() --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576518081; cv=none; d=zohomail.com; s=zohoarc; b=C1HH8HZuu1Fc93h0eTDkoqhPLXGYjdixvMBZ99y/OfsgVAEubJmyDHHVPZCTS01BEmpIo5J+8tIiGBxzbNS074W+cmi2IA4kinlBs6j7GLV59SxipfEsm2/OD91/fAzP4XaOmn1OlfNA/mIWcBZeppyFKaBaKM5eBgFxZpPI9es= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576518081; 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=UhavTerdPTQoYgu7CvuljzUleQArQqWB5x+i4QENFd4=; b=XdY1uLA39fBTzQIEEsyZiDco8QbsakuX4bgtL1yOjKso68eP2UGR5TjNft/MZbexwv94ie0WXUy2QIzgkfWkN56LiHhMeG0fCJcgmJDvRUIAviLvOAWSikd2mYeKwDJol7F3lUe+RHqHNTjCaulpBp0WUcAhF5bBlB5DwTDn0CE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576518081095990.758558579738; Mon, 16 Dec 2019 09:41:21 -0800 (PST) Received: from localhost ([::1]:57920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguMx-0005Uk-Ol for importer@patchew.org; Mon, 16 Dec 2019 12:41:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49772) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrw-0005Dj-53 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtru-0004Vg-Kp for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:15 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52144 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtru-0004VD-Gv for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-C20Yk-AGNzy7fxPf2NSzOg-1; Mon, 16 Dec 2019 12:09:12 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4C621005502; Mon, 16 Dec 2019 17:09:11 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id C20757C81C; Mon, 16 Dec 2019 17:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516154; 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=UhavTerdPTQoYgu7CvuljzUleQArQqWB5x+i4QENFd4=; b=dC3BZ063Deg40dWvQqNKQx+vCijlsiXoTMj0J9Wy9f0EcMOYdL4EQPeWUVWZdWFQlNuZ27 jVruHwaje4p1fjmxC2jjKJ6Y4k4lppLDqtiOzrjS8aID79J6cvgoTI2GYkWq7K3Ns26JPY SK/KhedS7+MPmDu4t+3UtQ/R0EbwJ4k= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 07/10] iotests: 237: Convert to VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:54 +0100 Message-Id: <20191216170857.11880-8-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: C20Yk-AGNzy7fxPf2NSzOg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/237 | 139 +++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 74 deletions(-) diff --git a/tests/qemu-iotests/237 b/tests/qemu-iotests/237 index 06897f8c87..a2242a4736 100755 --- a/tests/qemu-iotests/237 +++ b/tests/qemu-iotests/237 @@ -26,15 +26,6 @@ from iotests import imgfmt =20 iotests.verify_image_format(supported_fmts=3D['vmdk']) =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles]) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") - with iotests.FilePath('t.vmdk') as disk_path, \ iotests.FilePath('t.vmdk.1') as extent1_path, \ iotests.FilePath('t.vmdk.2') as extent2_path, \ @@ -50,16 +41,16 @@ with iotests.FilePath('t.vmdk') as disk_path, \ size =3D 5 * 1024 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) =20 vm.qmp_log('blockdev-add', driver=3D'file', filename=3Ddisk_path, node_name=3D'imgfile', filters=3D[iotests.filter_qmp_testfi= les]) =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'imgfile', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'imgfile', + 'size': size }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -74,21 +65,21 @@ with iotests.FilePath('t.vmdk') as disk_path, \ size =3D 64 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'extents': [], - 'subformat': 'monolithicSparse', - 'adapter-type': 'ide', - 'hwversion': '4', - 'zeroed-grain': False }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'extents': [], + 'subformat': 'monolithicSparse', + 'adapter-type': 'ide', + 'hwversion': '4', + 'zeroed-grain': False }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -103,20 +94,20 @@ with iotests.FilePath('t.vmdk') as disk_path, \ size =3D 32 * 1024 * 1024 =20 vm.launch() - blockdev_create(vm, { 'driver': 'file', - 'filename': disk_path, - 'size': 0 }) - - blockdev_create(vm, { 'driver': imgfmt, - 'file': { - 'driver': 'file', - 'filename': disk_path, - }, - 'size': size, - 'extents': [], - 'subformat': 'monolithicSparse', - 'adapter-type': 'buslogic', - 'zeroed-grain': True }) + vm.blockdev_create({ 'driver': 'file', + 'filename': disk_path, + 'size': 0 }) + + vm.blockdev_create({ 'driver': imgfmt, + 'file': { + 'driver': 'file', + 'filename': disk_path, + }, + 'size': size, + 'extents': [], + 'subformat': 'monolithicSparse', + 'adapter-type': 'buslogic', + 'zeroed-grain': True }) vm.shutdown() =20 iotests.img_info_log(disk_path) @@ -128,9 +119,9 @@ with iotests.FilePath('t.vmdk') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': "this doesn't exist", - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': "this doesn't exist", + 'size': size }) vm.shutdown() =20 # @@ -148,10 +139,10 @@ with iotests.FilePath('t.vmdk') as disk_path, \ =20 vm.launch() for adapter_type in [ 'ide', 'buslogic', 'lsilogic', 'legacyESX' ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size, - 'adapter-type': adapter_type }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size, + 'adapter-type': adapter_type }) vm.shutdown() =20 # Invalid @@ -160,10 +151,10 @@ with iotests.FilePath('t.vmdk') as disk_path, \ =20 vm.launch() for adapter_type in [ 'foo', 'IDE', 'legacyesx', 1 ]: - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size, - 'adapter-type': adapter_type }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size, + 'adapter-type': adapter_type }) vm.shutdown() =20 # @@ -185,10 +176,10 @@ with iotests.FilePath('t.vmdk') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size, - 'subformat': 'monolithicFlat' }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size, + 'subformat': 'monolithicFlat' }) vm.shutdown() =20 # Correct extent @@ -196,11 +187,11 @@ with iotests.FilePath('t.vmdk') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size, - 'subformat': 'monolithicFlat', - 'extents': ['ext1'] }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size, + 'subformat': 'monolithicFlat', + 'extents': ['ext1'] }) vm.shutdown() =20 # Extra extent @@ -208,11 +199,11 @@ with iotests.FilePath('t.vmdk') as disk_path, \ iotests.log("") =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': 512, - 'subformat': 'monolithicFlat', - 'extents': ['ext1', 'ext2', 'ext3'] }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': 512, + 'subformat': 'monolithicFlat', + 'extents': ['ext1', 'ext2', 'ext3'] }) vm.shutdown() =20 # Split formats @@ -228,11 +219,11 @@ with iotests.FilePath('t.vmdk') as disk_path, \ extents =3D [ "ext%d" % (i) for i in range(1, num_extents + 1)= ] =20 vm.launch() - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'node0', - 'size': size, - 'subformat': subfmt, - 'extents': extents }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'node0', + 'size': size, + 'subformat': subfmt, + 'extents': extents }) vm.shutdown() =20 iotests.img_info_log(disk_path) --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576518191; cv=none; d=zohomail.com; s=zohoarc; b=W5mSfII3mY+zfyzNKP33u3pJUcjr1+OsKcxpum3mRvDQYMCCgpsj6CNeQcX0d7dxDiteNSuOJJtfRk3QtA+0aqnoWra9lav1eGGw665hwCDMhDcK6+idrH8kMrPJfa7ZbP8xBasX///JKDV+j1eoHFXmNvP0BI2uXj6uAqiOYak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576518191; 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=ObAbxKBDFX6idCUxDvztgVsj5J3YsU4c76UbUkC6040=; b=lPDNcA2t3sqy+DUkg7QPvXKzn1BfcAtKgg/2t45qg1p5EYDQzjwjE5gRj3atyaS78fIMZ8MgibX6U0Z5jHZJn+WP5IKttx8fsWYwuzAfB8Uwt7fAgc94EsMkpDdu7YvLTzkFJhMPp5cfC4sA6JtwLdZkrhThyO+x7VCollBOV4E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576518191395328.10249976128944; Mon, 16 Dec 2019 09:43:11 -0800 (PST) Received: from localhost ([::1]:57946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguOk-0008Lf-4J for importer@patchew.org; Mon, 16 Dec 2019 12:43:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49803) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igtrz-0005H8-EP for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtrx-0004YY-Nn for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:19 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:40678 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrw-0004X0-9c for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-UGOQNtI_N9aoQ8EDf2HKXA-1; Mon, 16 Dec 2019 12:09:14 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 592E418FF662; Mon, 16 Dec 2019 17:09:13 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 375806FEE8; Mon, 16 Dec 2019 17:09:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516155; 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=ObAbxKBDFX6idCUxDvztgVsj5J3YsU4c76UbUkC6040=; b=Rj5TKsM4+fHHs17oUCVhjPAjjVaxPosfn9VgsX5i2HbcbTLVbZ7LeNQcGnm8HY8vic/yL9 ySaMeSvPEwc97YRKDECvurEsvc8yGjJiqYoEYdhhSM17+bJuFab53zomQ8BP3Lr5hQOGt9 GH/nK72dcTnjXdyzih8DHzFgA7lo8L0= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 08/10] iotests: 266: Convert to VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:55 +0100 Message-Id: <20191216170857.11880-9-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: UGOQNtI_N9aoQ8EDf2HKXA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of having a separate blockdev_create() function, make use of the VM.blockdev_create() offered by iotests.py. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/266 | 69 +++++++++++++++++--------------------- tests/qemu-iotests/266.out | 14 ++++++++ 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/tests/qemu-iotests/266 b/tests/qemu-iotests/266 index 5b35cd67e4..c353cf88ee 100755 --- a/tests/qemu-iotests/266 +++ b/tests/qemu-iotests/266 @@ -22,15 +22,6 @@ import iotests from iotests import imgfmt =20 =20 -def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles]) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - - # Successful image creation (defaults) def implicit_defaults(vm, file_path): iotests.log("=3D=3D=3D Successful image creation (defaults) =3D=3D=3D") @@ -40,9 +31,9 @@ def implicit_defaults(vm, file_path): # (Close to 64 MB) size =3D 8 * 964 * 17 * 512 =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': size }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size }) =20 =20 # Successful image creation (explicit defaults) @@ -54,11 +45,11 @@ def explicit_defaults(vm, file_path): # (Close to 128 MB) size =3D 16 * 964 * 17 * 512 =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': size, - 'subformat': 'dynamic', - 'force-size': False }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size, + 'subformat': 'dynamic', + 'force-size': False }) =20 =20 # Successful image creation (non-default options) @@ -69,11 +60,11 @@ def non_defaults(vm, file_path): # Not representable in CHS (fine with force-size=3DTrue) size =3D 1048576 =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': size, - 'subformat': 'fixed', - 'force-size': True }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size, + 'subformat': 'fixed', + 'force-size': True }) =20 =20 # Size not representable in CHS with force-size=3DFalse @@ -84,10 +75,10 @@ def non_chs_size_without_force(vm, file_path): # Not representable in CHS (will not work with force-size=3DFalse) size =3D 1048576 =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': size, - 'force-size': False }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size, + 'force-size': False }) =20 =20 # Zero size @@ -95,9 +86,9 @@ def zero_size(vm, file_path): iotests.log("=3D=3D=3D Zero size=3D=3D=3D") iotests.log("") =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': 0 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': 0 }) =20 =20 # Maximum CHS size @@ -105,9 +96,9 @@ def maximum_chs_size(vm, file_path): iotests.log("=3D=3D=3D Maximum CHS size=3D=3D=3D") iotests.log("") =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': 16 * 65535 * 255 * 512 }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': 16 * 65535 * 255 * 512 }) =20 =20 # Actual maximum size @@ -115,10 +106,10 @@ def maximum_size(vm, file_path): iotests.log("=3D=3D=3D Actual maximum size=3D=3D=3D") iotests.log("") =20 - blockdev_create(vm, { 'driver': imgfmt, - 'file': 'protocol-node', - 'size': 0xff000000 * 512, - 'force-size': True }) + vm.blockdev_create({ 'driver': imgfmt, + 'file': 'protocol-node', + 'size': 0xff000000 * 512, + 'force-size': True }) =20 =20 def main(): @@ -132,9 +123,9 @@ def main(): vm.launch() =20 iotests.log('--- Creating empty file ---') - blockdev_create(vm, { 'driver': 'file', - 'filename': file_path, - 'size': 0 }) + vm.blockdev_create({ 'driver': 'file', + 'filename': file_path, + 'size': 0 }) =20 vm.qmp_log('blockdev-add', driver=3D'file', filename=3Dfile_pa= th, node_name=3D'protocol-node', diff --git a/tests/qemu-iotests/266.out b/tests/qemu-iotests/266.out index b11953e81f..5a7d7d01aa 100644 --- a/tests/qemu-iotests/266.out +++ b/tests/qemu-iotests/266.out @@ -3,6 +3,7 @@ {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -13,6 +14,7 @@ {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + image: TEST_IMG file format: IMGFMT virtual size: 64 MiB (67125248 bytes) @@ -23,6 +25,7 @@ cluster_size: 2097152 {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -33,6 +36,7 @@ cluster_size: 2097152 {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + image: TEST_IMG file format: IMGFMT virtual size: 128 MiB (134250496 bytes) @@ -43,6 +47,7 @@ cluster_size: 2097152 {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -53,6 +58,7 @@ cluster_size: 2097152 {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + image: TEST_IMG file format: IMGFMT virtual size: 1 MiB (1048576 bytes) @@ -62,6 +68,7 @@ virtual size: 1 MiB (1048576 bytes) {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -73,6 +80,7 @@ Job failed: The requested image size cannot be represente= d in CHS geometry {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + qemu-img: Could not open 'TEST_IMG': File too small for a VHD header =20 --- Creating empty file --- @@ -80,6 +88,7 @@ qemu-img: Could not open 'TEST_IMG': File too small for a= VHD header {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -90,6 +99,7 @@ qemu-img: Could not open 'TEST_IMG': File too small for a= VHD header {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + image: TEST_IMG file format: IMGFMT virtual size: 0 B (0 bytes) @@ -100,6 +110,7 @@ cluster_size: 2097152 {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -110,6 +121,7 @@ cluster_size: 2097152 {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + image: TEST_IMG file format: IMGFMT virtual size: 127 GiB (136899993600 bytes) @@ -120,6 +132,7 @@ cluster_size: 2097152 {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} + {"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vpc", "node-name": "protocol-node"}} {"return": {}} =20 @@ -130,6 +143,7 @@ cluster_size: 2097152 {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 + image: TEST_IMG file format: IMGFMT virtual size: 1.99 TiB (2190433320960 bytes) --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517387; cv=none; d=zohomail.com; s=zohoarc; b=K/t3NABZ3TSr1LdLLQSsVwz0YyLTqVwFB4rbtcISeq9aWFWn5H9PLSJCJRimZ32AEvY7yk3f3dkzbihOKDAO/YaVkfKUqSHlXrcxnWQMkTNl7f8ShvzMJBBuWsPQwxlpf9MDO9qTCY0DalDAa8qw8WqyPuHA7p7FmabewtTg+C4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517387; 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=IDVqTpY3pjj42+37hfJNvN2IixURt4Ln1YS2ABghS38=; b=fWRd+EaMmPZckODCQLinR41eLjdCpmnPPmXvQJAvFeJLk5394fko+xI+nD/8ibtXxfIZj+PV5GpSjmDSt4X7bQpY1Kuw70lXoWDNER88d6ISUjoMZs886bINZXzyOHW2sBxPMU6qCnkChpHPoCGQNvsMdiz1+mFQO3YQV839WUE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517387832372.4620893272137; Mon, 16 Dec 2019 09:29:47 -0800 (PST) Received: from localhost ([::1]:57592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguBm-0006vE-4H for importer@patchew.org; Mon, 16 Dec 2019 12:29:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49819) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igts0-0005IE-Rj for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igtry-0004Zb-Pn for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:19 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34075 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igtrx-0004Xw-TS for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-cJCzuQnwMKCl_U_4FalFgw-1; Mon, 16 Dec 2019 12:09:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BFDA5102CE16; Mon, 16 Dec 2019 17:09:14 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E3736FEE8; Mon, 16 Dec 2019 17:09:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516156; 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=IDVqTpY3pjj42+37hfJNvN2IixURt4Ln1YS2ABghS38=; b=E18yVHlM9wRtsfV/T/NR08bTlPwZFHvGvjng1ERJ/i4UB1+b15teTX/qPl9groka5BCE2s 60JKxWRzZyx/KbVMVCOPxvJ96VjTUUV1IUt0HSEN6g2KVknS2BEBCITI2FKuPs2BlbmXqH /xnCE+Hze8wUCaYBXdeQoEfQ/so9Jac= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 09/10] iotests: 207: Remove duplication with VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:56 +0100 Message-Id: <20191216170857.11880-10-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: cJCzuQnwMKCl_U_4FalFgw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The blockdev_create() function in this test case adds another filter to the logging, but provides otherwise the same functionality as VM.blockdev_create() from iotests.py. Make it a thin wrapper around the iotests.py function. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/207 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/qemu-iotests/207 b/tests/qemu-iotests/207 index ec8c1d06f0..812ab34e47 100755 --- a/tests/qemu-iotests/207 +++ b/tests/qemu-iotests/207 @@ -35,13 +35,7 @@ def filter_hash(qmsg): return iotests.filter_qmp(qmsg, _filter) =20 def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles, filter_ha= sh]) - - if 'return' in result: - assert result['return'] =3D=3D {} - vm.run_job('job0') - iotests.log("") + vm.blockdev_create(options, filters=3D[iotests.filter_qmp_testfiles, f= ilter_hash]) =20 with iotests.FilePath('t.img') as disk_path, \ iotests.VM() as vm: --=20 2.20.1 From nobody Thu Nov 13 02:00:11 2025 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576517590; cv=none; d=zohomail.com; s=zohoarc; b=h2X9J+WKLMcMZmy4Y3p+f6qmFHPBHJpcI8e1426Kxau4GM/Pwm1FMf9Ze4RQcUVVngKJUpp3tpXs9ESdoKKCLn8f7t9v2i1pdNiEgLbU307v9kFn/MC43ITKqJt/p/xSJ0oWIuaApmF939zsjp8lZNPvFXghVhV/gNGnd+Zu6K0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576517590; 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=nbqnCUxN0zB+lXOmjXBKMWa4cpQ0zxpolifXhc8NANs=; b=TAdTqOP4h/YwtwSqu++E97loI/JxeG4A0qizSMF3Z+aNqRY+cBs4l3T1lcZDnun/kBJmiKRcTT/5e86MkULjKR7GdFc0Sn5IbCKBv9cBVzx9jBC9S75iC0b/aFbgAhV1AdcudtvzXOWAL4s4EF64TKEr8++0OGy67lF/bT9DcGc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=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 1576517590694826.4243672000887; Mon, 16 Dec 2019 09:33:10 -0800 (PST) Received: from localhost ([::1]:57722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iguF3-0002dE-GS for importer@patchew.org; Mon, 16 Dec 2019 12:33:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49861) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igts3-0005Lo-Iy for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igts1-0004cC-Es for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:23 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:52859 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igts1-0004b8-79 for qemu-devel@nongnu.org; Mon, 16 Dec 2019 12:09:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-202-DZqFIOgYOVCOhzrrAe0Rvw-1; Mon, 16 Dec 2019 12:09:17 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E7B81800D7B; Mon, 16 Dec 2019 17:09:16 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-54.ams2.redhat.com [10.36.117.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 129136FEE8; Mon, 16 Dec 2019 17:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576516160; 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=nbqnCUxN0zB+lXOmjXBKMWa4cpQ0zxpolifXhc8NANs=; b=L45ZEdfxYf/CxYk2sZGg8Gg+H8rRhcSuaeXlZINmlunqbv4hPYfjGAVvQ0snuGfLfjszZM v9wpySl1wG2bXL3PVAGLiF3BBwsan4Wzr21F3UYyY1QFeO30uOh4rbQd96A//ECbHukQLH n6fQfKRubWxXlepjGBtVEMRFdLYsQp4= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PATCH 10/10] iotests: 211: Remove duplication with VM.blockdev_create() Date: Mon, 16 Dec 2019 18:08:57 +0100 Message-Id: <20191216170857.11880-11-kwolf@redhat.com> In-Reply-To: <20191216170857.11880-1-kwolf@redhat.com> References: <20191216170857.11880-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: DZqFIOgYOVCOhzrrAe0Rvw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The blockdev_create() function in this test case adds an error check that skips the test in case of failure because of memory shortage, but provides otherwise the same functionality as VM.blockdev_create() from iotests.py. Make it a thin wrapper around the iotests.py function. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/211 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/211 b/tests/qemu-iotests/211 index 6afc894f76..8834ebfe85 100755 --- a/tests/qemu-iotests/211 +++ b/tests/qemu-iotests/211 @@ -27,15 +27,9 @@ iotests.verify_image_format(supported_fmts=3D['vdi']) iotests.verify_protocol(supported=3D['file']) =20 def blockdev_create(vm, options): - result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, - filters=3D[iotests.filter_qmp_testfiles]) - - if 'return' in result: - assert result['return'] =3D=3D {} - error =3D vm.run_job('job0') - if error and 'Could not allocate bmap' in error: - iotests.notrun('Insufficient memory') - iotests.log("") + error =3D vm.blockdev_create(options) + if error and 'Could not allocate bmap' in error: + iotests.notrun('Insufficient memory') =20 with iotests.FilePath('t.vdi') as disk_path, \ iotests.VM() as vm: --=20 2.20.1