From nobody Wed Nov 12 00:30:47 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=1567452978; cv=none; d=zoho.com; s=zohoarc; b=hMf+6R1e4G9e3aHGiAY5Dyn+9AIOrWw/e4w4Zj98ugejqO0uQIUNexgMdlNfRCGndS1L1WaG3Pc6PUIRF+EPCoYUUeORKYU3Paxq/ymVaIDtvIg5VmW/53TZITUieyAaXHTFHtNX4r9zttWRVV3v9VOybeBUzEveeclI7KSGst0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567452978; 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=LoOzOMWMKqi9o68Br/rzS8/bpgJeH56bjKXNV9j67jg=; b=F5PXbRhaG0+4RVXmOZOOjz0ryiDLcz/kZczScJPN1ypbiFkUOQ/ZEaVnVkCz4+grsvuCY8SG76hCEgFo1215qOZGQT8mxGzH9stdhLMkzttFph16+Yu6gPcE5MmOEC7RNOglz4kN20rwkyF/eIYnXaNl3lW+vXR+LTd8XoNjYkM= 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 1567452978174137.34439479402795; Mon, 2 Sep 2019 12:36:18 -0700 (PDT) Received: from localhost ([::1]:39518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s7b-00062K-O4 for importer@patchew.org; Mon, 02 Sep 2019 15:36:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51188) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s4z-00045K-5P for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4s4y-0006wP-7s for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54016) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4s4w-0006ua-4n; Mon, 02 Sep 2019 15:33:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A08E30001EB; Mon, 2 Sep 2019 19:33:29 +0000 (UTC) Received: from localhost (ovpn-204-221.brq.redhat.com [10.40.204.221]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7C3E10018F9; Mon, 2 Sep 2019 19:33:26 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 2 Sep 2019 21:33:16 +0200 Message-Id: <20190902193320.32233-2-mreitz@redhat.com> In-Reply-To: <20190902193320.32233-1-mreitz@redhat.com> References: <20190902193320.32233-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 02 Sep 2019 19:33:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 1/5] vpc: Return 0 from vpc_co_create() on success 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: Kevin Wolf , qemu-stable@nongnu.org, John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" blockdev_create_run() directly uses .bdrv_co_create()'s return value as the job's return value. Jobs must return 0 on success, not just any nonnegative value. Therefore, using blockdev-create for VPC images may currently fail as the vpc driver may return a positive integer. Because there is no point in returning a positive integer anywhere in the block layer (all non-negative integers are generally treated as complete success), we probably do not want to add more such cases. Therefore, fix this problem by making the vpc driver always return 0 in case of success. Suggested-by: Kevin Wolf Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz --- block/vpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/vpc.c b/block/vpc.c index b25aab0425..5cd3890780 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -885,6 +885,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, goto fail; } =20 + ret =3D 0; fail: return ret; } @@ -908,7 +909,7 @@ static int create_fixed_disk(BlockBackend *blk, uint8_t= *buf, return ret; } =20 - return ret; + return 0; } =20 static int calculate_rounded_image_size(BlockdevCreateOptionsVpc *vpc_opts, --=20 2.21.0 From nobody Wed Nov 12 00:30:47 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=1567453193; cv=none; d=zoho.com; s=zohoarc; b=ffVR1SCujWR8rPvJliH6jHV8ZHI2E+LEyA1AinyuNb/pxxtSeTjq/VWCHEM41jziSKWs0I23fEggdbbzXGiOJaIVQbh6EbTxDGXta5cAkRGLepi28V0iYHZsSyn9QGy05ZrfnGM88C6ByrIkFmCaayK3Wdon7qBPKCSbviPN5Y4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567453193; 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=pSpEIwNrcZ7au6gItTqP1hjwSqjMfCTu8WpKPhVYVQM=; b=ac6FD/WkIjikwimqEVqAAEi3t1q+8+I7kBwnmr2cV42/XsY6E+E11fpbh1/PLfGmzRN+kAqKo/a9yx1V7v2y4OwItyzScr0UL0UQzNBnEOKnm4IN11N3FFrjH8g1Ka8+X+8GiCKO8xF5o8rkASd/jZ3qjodN4Gtqfx1CV8dQxMI= 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 1567453193833219.91532979553642; Mon, 2 Sep 2019 12:39:53 -0700 (PDT) Received: from localhost ([::1]:39552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4sB3-0001JX-P9 for importer@patchew.org; Mon, 02 Sep 2019 15:39:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s51-0004BE-P9 for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4s50-0006yD-JZ for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59632) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4s4y-0006wM-KT; Mon, 02 Sep 2019 15:33:32 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D17044E927; Mon, 2 Sep 2019 19:33:31 +0000 (UTC) Received: from localhost (ovpn-204-221.brq.redhat.com [10.40.204.221]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6262F10018F9; Mon, 2 Sep 2019 19:33:31 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 2 Sep 2019 21:33:17 +0200 Message-Id: <20190902193320.32233-3-mreitz@redhat.com> In-Reply-To: <20190902193320.32233-1-mreitz@redhat.com> References: <20190902193320.32233-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 02 Sep 2019 19:33:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 2/5] iotests: Add supported protocols to execute_test() 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: Kevin Wolf , qemu-stable@nongnu.org, John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 84438e837c..b26271187c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -909,7 +909,8 @@ def execute_unittest(output, verbosity, debug): =20 def execute_test(test_function=3DNone, supported_fmts=3D[], supported_oses=3D['linux'], - supported_cache_modes=3D[], unsupported_fmts=3D[]): + supported_cache_modes=3D[], unsupported_fmts=3D[], + supported_protocols=3D[], unsupported_protocols=3D[]): """Run either unittest or script-style tests.""" =20 # We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to @@ -923,6 +924,7 @@ def execute_test(test_function=3DNone, debug =3D '-d' in sys.argv verbosity =3D 1 verify_image_format(supported_fmts, unsupported_fmts) + verify_protocol(supported_protocols, unsupported_protocols) verify_platform(supported_oses) verify_cache_mode(supported_cache_modes) =20 --=20 2.21.0 From nobody Wed Nov 12 00:30:47 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=1567453026; cv=none; d=zoho.com; s=zohoarc; b=YvlhCNKBhDqSxbO323PJkbVtzj5OpS/+HbGaOworrZpv/JNwlazfd1AZaQapKqzLqyc58mnmhBNB7PRKTSDyBcEyiTMuaQxVPvsHUP2Kaq5+LTTS1g4fyzhEB5sO/jsFVOhkKRwAFZarqiz8q7/9IQgLG0ZTMrbousyO9SwS1Co= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567453026; 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=bm+KxRjG1Q/3NhQ0MkOZGWp2Mh+xxov9JVBQ93k0fCY=; b=dVhfK+PJT+YhSoclbPdmMiGou6yIO0KLC8Oy50U/1PN/kkSAwsn8/A8hnSFjRfW8VPuy1Ere8JHfSb5Ymi+Vj+j2JVT/ej70pr+vMZKYybCxbj6VY8V86mylMddcRmNRARV4FA3wq+zYvZYLgl7aFLzR7oRfjs5EsgRy3lWIZoY= 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 1567453026713729.1431527306905; Mon, 2 Sep 2019 12:37:06 -0700 (PDT) Received: from localhost ([::1]:39526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s8P-0006rm-0U for importer@patchew.org; Mon, 02 Sep 2019 15:37:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51297) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s59-0004MR-C9 for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4s57-000743-Dl for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54146) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4s53-0006zn-AO; Mon, 02 Sep 2019 15:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A209D1027003; Mon, 2 Sep 2019 19:33:36 +0000 (UTC) Received: from localhost (ovpn-204-221.brq.redhat.com [10.40.204.221]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6BE360BF3; Mon, 2 Sep 2019 19:33:33 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 2 Sep 2019 21:33:18 +0200 Message-Id: <20190902193320.32233-4-mreitz@redhat.com> In-Reply-To: <20190902193320.32233-1-mreitz@redhat.com> References: <20190902193320.32233-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Mon, 02 Sep 2019 19:33: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] [PATCH v2 3/5] iotests: Restrict file Python tests to file 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: Kevin Wolf , qemu-stable@nongnu.org, John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Most of our Python unittest-style tests only support the file protocol. You can run them with any other protocol, but the test will simply ignore your choice and use file anyway. We should let them signal that they require the file protocol so they are skipped when you want to test some other protocol. Signed-off-by: Max Reitz --- tests/qemu-iotests/030 | 3 ++- tests/qemu-iotests/040 | 3 ++- tests/qemu-iotests/041 | 3 ++- tests/qemu-iotests/044 | 3 ++- tests/qemu-iotests/045 | 3 ++- tests/qemu-iotests/055 | 3 ++- tests/qemu-iotests/056 | 3 ++- tests/qemu-iotests/057 | 3 ++- tests/qemu-iotests/065 | 3 ++- tests/qemu-iotests/096 | 3 ++- tests/qemu-iotests/118 | 3 ++- tests/qemu-iotests/124 | 3 ++- tests/qemu-iotests/129 | 3 ++- tests/qemu-iotests/132 | 3 ++- tests/qemu-iotests/139 | 3 ++- tests/qemu-iotests/148 | 3 ++- tests/qemu-iotests/151 | 3 ++- tests/qemu-iotests/152 | 3 ++- tests/qemu-iotests/155 | 3 ++- tests/qemu-iotests/163 | 3 ++- tests/qemu-iotests/165 | 3 ++- tests/qemu-iotests/169 | 3 ++- tests/qemu-iotests/196 | 3 ++- tests/qemu-iotests/199 | 3 ++- tests/qemu-iotests/245 | 3 ++- tests/qemu-iotests/257 | 3 ++- 26 files changed, 52 insertions(+), 26 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 1b69f318c6..f3766f2a81 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -957,4 +957,5 @@ class TestSetSpeed(iotests.QMPTestCase): self.cancel_and_wait(resume=3DTrue) =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2', 'qed']) + iotests.main(supported_fmts=3D['qcow2', 'qed'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 6db9abf8e6..762ad1ebcb 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -429,4 +429,5 @@ class TestReopenOverlay(ImageCommitTestCase): self.run_commit_test(self.img1, self.img0) =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2', 'qed']) + iotests.main(supported_fmts=3D['qcow2', 'qed'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 8bc8f81db7..8568426311 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -1122,4 +1122,5 @@ class TestOrphanedSource(iotests.QMPTestCase): self.assert_qmp(result, 'error/class', 'GenericError') =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2', 'qed']) + iotests.main(supported_fmts=3D['qcow2', 'qed'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index 9ec3dba734..05ea1f49c5 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -118,4 +118,5 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): pass =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/045 b/tests/qemu-iotests/045 index d5484a0ee1..01cc038884 100755 --- a/tests/qemu-iotests/045 +++ b/tests/qemu-iotests/045 @@ -175,4 +175,5 @@ class TestSCMFd(iotests.QMPTestCase): "File descriptor named '%s' not found" % fdname) =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['raw']) + iotests.main(supported_fmts=3D['raw'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index 3437c11507..c732a112d6 100755 --- a/tests/qemu-iotests/055 +++ b/tests/qemu-iotests/055 @@ -563,4 +563,5 @@ class TestDriveCompression(iotests.QMPTestCase): target=3D'drive1') =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['raw', 'qcow2']) + iotests.main(supported_fmts=3D['raw', 'qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index e761e465ae..98c55d8e5a 100755 --- a/tests/qemu-iotests/056 +++ b/tests/qemu-iotests/056 @@ -335,4 +335,5 @@ class BackupTest(iotests.QMPTestCase): self.dismissal_failure(True) =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2', 'qed']) + iotests.main(supported_fmts=3D['qcow2', 'qed'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/057 b/tests/qemu-iotests/057 index 9f0a5a3057..9fbba759b6 100755 --- a/tests/qemu-iotests/057 +++ b/tests/qemu-iotests/057 @@ -256,4 +256,5 @@ class TestSnapshotDelete(ImageSnapshotTestCase): self.assert_qmp(result, 'error/class', 'GenericError') =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index 8bac383ea7..5b21eb96bd 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -129,4 +129,5 @@ TestQemuImgInfo =3D None TestQMP =3D None =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/096 b/tests/qemu-iotests/096 index a69439602d..ab9cb47822 100755 --- a/tests/qemu-iotests/096 +++ b/tests/qemu-iotests/096 @@ -67,4 +67,5 @@ class TestLiveSnapshot(iotests.QMPTestCase): self.checkConfig('target') =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118 index 6f45779ee9..ea0b326ae0 100755 --- a/tests/qemu-iotests/118 +++ b/tests/qemu-iotests/118 @@ -717,4 +717,5 @@ if __name__ =3D=3D '__main__': iotests.qemu_default_machine) # Need to support image creation iotests.main(supported_fmts=3D['vpc', 'parallels', 'qcow', 'vdi', 'qco= w2', - 'vmdk', 'raw', 'vhdx', 'qed']) + 'vmdk', 'raw', 'vhdx', 'qed'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 3440f54781..ca40ba3be2 100755 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -779,4 +779,5 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBack= upBase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/129 b/tests/qemu-iotests/129 index 9e87e1c8d9..cd6b9e9ce7 100755 --- a/tests/qemu-iotests/129 +++ b/tests/qemu-iotests/129 @@ -83,4 +83,5 @@ class TestStopWithBlockJob(iotests.QMPTestCase): self.do_test_stop("block-commit", device=3D"drive0") =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D["qcow2"]) + iotests.main(supported_fmts=3D["qcow2"], + supported_protocols=3D["file"]) diff --git a/tests/qemu-iotests/132 b/tests/qemu-iotests/132 index f53ef6e391..0f2a106c81 100755 --- a/tests/qemu-iotests/132 +++ b/tests/qemu-iotests/132 @@ -56,4 +56,5 @@ class TestSingleDrive(iotests.QMPTestCase): 'target image does not match source after mirrorin= g') =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['raw', 'qcow2']) + iotests.main(supported_fmts=3D['raw', 'qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index 2176ea51ba..cbb5a76530 100755 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -358,4 +358,5 @@ class TestBlockdevDel(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D["qcow2"]) + iotests.main(supported_fmts=3D["qcow2"], + supported_protocols=3D["file"]) diff --git a/tests/qemu-iotests/148 b/tests/qemu-iotests/148 index e01b061fe7..8c11c53cba 100755 --- a/tests/qemu-iotests/148 +++ b/tests/qemu-iotests/148 @@ -137,4 +137,5 @@ class TestFifoQuorumEvents(TestQuorumEvents): =20 if __name__ =3D=3D '__main__': iotests.verify_quorum() - iotests.main(supported_fmts=3D["raw"]) + iotests.main(supported_fmts=3D["raw"], + supported_protocols=3D["file"]) diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151 index ad7359fc8d..76ae265cc1 100755 --- a/tests/qemu-iotests/151 +++ b/tests/qemu-iotests/151 @@ -142,4 +142,5 @@ class TestActiveMirror(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2', 'raw']) + iotests.main(supported_fmts=3D['qcow2', 'raw'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/152 b/tests/qemu-iotests/152 index fec546d033..732bf5f062 100755 --- a/tests/qemu-iotests/152 +++ b/tests/qemu-iotests/152 @@ -59,4 +59,5 @@ class TestUnaligned(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['raw', 'qcow2']) + iotests.main(supported_fmts=3D['raw', 'qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/155 b/tests/qemu-iotests/155 index 63a5b5e2c0..e19485911c 100755 --- a/tests/qemu-iotests/155 +++ b/tests/qemu-iotests/155 @@ -258,4 +258,5 @@ BaseClass =3D None MirrorBaseClass =3D None =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163 index 158ba5d092..081ccc8ac1 100755 --- a/tests/qemu-iotests/163 +++ b/tests/qemu-iotests/163 @@ -170,4 +170,5 @@ class TestShrink1M(ShrinkBaseClass): ShrinkBaseClass =3D None =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['raw', 'qcow2']) + iotests.main(supported_fmts=3D['raw', 'qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165 index 88f62d3c6d..5650dc7c87 100755 --- a/tests/qemu-iotests/165 +++ b/tests/qemu-iotests/165 @@ -103,4 +103,5 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): self.vm.shutdown() =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169 index 7e06cc1145..8c204caf20 100755 --- a/tests/qemu-iotests/169 +++ b/tests/qemu-iotests/169 @@ -227,4 +227,5 @@ for cmb in list(itertools.product((True, False), repeat= =3D2)): 'do_test_migration_resume_source', *list(cmb)) =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/196 b/tests/qemu-iotests/196 index 4116ebc92b..92fe9244f8 100755 --- a/tests/qemu-iotests/196 +++ b/tests/qemu-iotests/196 @@ -63,4 +63,5 @@ class TestInvalidateAutoclear(iotests.QMPTestCase): self.assertEqual(f.read(1), b'\x00') =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/199 b/tests/qemu-iotests/199 index 651e8df5d9..a2c8ecab5a 100755 --- a/tests/qemu-iotests/199 +++ b/tests/qemu-iotests/199 @@ -115,4 +115,5 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): self.assert_qmp(result, 'return/sha256', sha256); =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2'], supported_cache_modes=3D['non= e']) + iotests.main(supported_fmts=3D['qcow2'], supported_cache_modes=3D['non= e'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index bc1ceb9792..41218d5f1d 100644 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -1000,4 +1000,5 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.reopen(opts, {'backing': 'hd2'}) =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D["qcow2"]) + iotests.main(supported_fmts=3D["qcow2"], + supported_protocols=3D["file"]) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index c2a72c577a..4a636d8ab2 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -557,4 +557,5 @@ def main(): test_backup_api() =20 if __name__ =3D=3D '__main__': - iotests.script_main(main, supported_fmts=3D['qcow2']) + iotests.script_main(main, supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) --=20 2.21.0 From nobody Wed Nov 12 00:30:47 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=1567453362; cv=none; d=zoho.com; s=zohoarc; b=ZoSmoIVYKgz5vqFGkVuCOIt+NQbwIAdal4cX6mO0ZzaX17CElipxLeS6TMcsIXDx6pqti8hHO3mvW4z7+h7Wh7KmMe9RSsyol+lAymFxaehTmlqJRQGAI4OeQs9zU67h2vj5qnKl3vH88YPnWgDbV/RRZLiRda93/SSfRxAd7KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567453362; 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=brGse0vlXzCg2VMCkiJ0IM1fAHK7gDUV+kwlT6DACJs=; b=BRKKW6OUk7KYU6dlY2l/AOjSuuzKL0P76fw/elLxJQZZuKnSyQrJAWCPAUdwbNU7eLForyV9ACKWy/LUq//mbMIvJ7LbtYN7lsaUPIo9WQjx0LZVVsh5MO24p7CjNUa+wB0WQzVIYs6ZzYoOLWROz6SDa+z3DmSTlZpa8AKFIdg= 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 1567453362624259.22868292645717; Mon, 2 Sep 2019 12:42:42 -0700 (PDT) Received: from localhost ([::1]:39584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4sDp-0004Em-7R for importer@patchew.org; Mon, 02 Sep 2019 15:42:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51315) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s5B-0004Op-39 for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4s5A-00077Y-0Y for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4s57-000741-TO; Mon, 02 Sep 2019 15:33:42 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 414B230917AC; Mon, 2 Sep 2019 19:33:41 +0000 (UTC) Received: from localhost (ovpn-204-221.brq.redhat.com [10.40.204.221]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8609F608AB; Mon, 2 Sep 2019 19:33:38 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 2 Sep 2019 21:33:19 +0200 Message-Id: <20190902193320.32233-5-mreitz@redhat.com> In-Reply-To: <20190902193320.32233-1-mreitz@redhat.com> References: <20190902193320.32233-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 02 Sep 2019 19:33:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 4/5] iotests: Restrict nbd Python tests to nbd 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: Kevin Wolf , qemu-stable@nongnu.org, John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We have two Python unittest-style tests that test NBD. As such, they should specify supported_protocols=3D['nbd'] so they are skipped when the user wants to test some other protocol. Furthermore, we should restrict their choice of formats to 'raw'. The idea of a protocol/format combination is to use some format over some protocol; but we always use the raw format over NBD. It does not really matter what the NBD server uses on its end, and it is not a useful test of the respective format driver anyway. Signed-off-by: Max Reitz --- tests/qemu-iotests/147 | 5 ++--- tests/qemu-iotests/205 | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index 2d84fddb01..ab8480b9a4 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -287,6 +287,5 @@ class BuiltinNBD(NBDBlockdevAddBase): =20 =20 if __name__ =3D=3D '__main__': - # Need to support image creation - iotests.main(supported_fmts=3D['vpc', 'parallels', 'qcow', 'vdi', 'qco= w2', - 'vmdk', 'raw', 'vhdx', 'qed']) + iotests.main(supported_fmts=3D['raw'], + supported_protocols=3D['nbd']) diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205 index b8a86c446e..76f6c5fa2b 100755 --- a/tests/qemu-iotests/205 +++ b/tests/qemu-iotests/205 @@ -153,4 +153,5 @@ class TestNbdServerRemove(iotests.QMPTestCase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['generic']) + iotests.main(supported_fmts=3D['raw'], + supported_protocols=3D['nbd']) --=20 2.21.0 From nobody Wed Nov 12 00:30:47 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=1567453097; cv=none; d=zoho.com; s=zohoarc; b=lAQuMbO0yCu+tMTGoMfxbg8B5LUXtVh5QG2q37GMCbPrvI9N+yOSC5m8tPzun6svQ71y+gza+eyxv7UeAaA9ghHhXM+NbuzHhSqFc5YCj4YTgMbRuBGgAx8nbMbV3htTpPFGx/G7t1EvwYv8vyCG0CNuWNk82U76QuGmQgeDGyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567453097; 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=CVo1+kUvRgO4Ej04soRkviNIUXx+AT29N0uxFHd33nY=; b=cpNWulNJycU6CAH6r40SCw3O3i9OdUBFkwjPR2u83XoiZAbwn3awTF1iQgo+jp1U4mZB7Thb4QlJHMEd+eqLx3JlvEHdOi0Tt7G1bnLaVGxw7BgrHKmFcFJrsPjj5lsABX48AquHE48oC6nuSXFU7tbjNGA7o2heAZuFUWHKa0Q= 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 1567453097486655.1702703469034; Mon, 2 Sep 2019 12:38:17 -0700 (PDT) Received: from localhost ([::1]:39540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s9Y-0008SM-7Z for importer@patchew.org; Mon, 02 Sep 2019 15:38:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51389) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4s5J-0004aR-1Z for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4s5H-0007GH-37 for qemu-devel@nongnu.org; Mon, 02 Sep 2019 15:33:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54174) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4s5C-00079z-NT; Mon, 02 Sep 2019 15:33:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1257A10F23E5; Mon, 2 Sep 2019 19:33:46 +0000 (UTC) Received: from localhost (ovpn-204-221.brq.redhat.com [10.40.204.221]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24B235C21A; Mon, 2 Sep 2019 19:33:42 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 2 Sep 2019 21:33:20 +0200 Message-Id: <20190902193320.32233-6-mreitz@redhat.com> In-Reply-To: <20190902193320.32233-1-mreitz@redhat.com> References: <20190902193320.32233-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Mon, 02 Sep 2019 19:33:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 5/5] iotests: Test blockdev-create for vpc 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: Kevin Wolf , qemu-stable@nongnu.org, John Snow , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz --- tests/qemu-iotests/266 | 153 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/266.out | 137 +++++++++++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 291 insertions(+) create mode 100755 tests/qemu-iotests/266 create mode 100644 tests/qemu-iotests/266.out diff --git a/tests/qemu-iotests/266 b/tests/qemu-iotests/266 new file mode 100755 index 0000000000..5b35cd67e4 --- /dev/null +++ b/tests/qemu-iotests/266 @@ -0,0 +1,153 @@ +#!/usr/bin/env python +# +# Test VPC and file image creation +# +# Copyright (C) 2019 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import iotests +from iotests import imgfmt + + +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") + iotests.log("") + + # 8 heads, 964 cyls/head, 17 secs/cyl + # (Close to 64 MB) + size =3D 8 * 964 * 17 * 512 + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size }) + + +# Successful image creation (explicit defaults) +def explicit_defaults(vm, file_path): + iotests.log("=3D=3D=3D Successful image creation (explicit defaults) = =3D=3D=3D") + iotests.log("") + + # 16 heads, 964 cyls/head, 17 secs/cyl + # (Close to 128 MB) + size =3D 16 * 964 * 17 * 512 + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size, + 'subformat': 'dynamic', + 'force-size': False }) + + +# Successful image creation (non-default options) +def non_defaults(vm, file_path): + iotests.log("=3D=3D=3D Successful image creation (non-default options)= =3D=3D=3D") + iotests.log("") + + # Not representable in CHS (fine with force-size=3DTrue) + size =3D 1048576 + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size, + 'subformat': 'fixed', + 'force-size': True }) + + +# Size not representable in CHS with force-size=3DFalse +def non_chs_size_without_force(vm, file_path): + iotests.log("=3D=3D=3D Size not representable in CHS =3D=3D=3D") + iotests.log("") + + # Not representable in CHS (will not work with force-size=3DFalse) + size =3D 1048576 + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': size, + 'force-size': False }) + + +# Zero size +def zero_size(vm, file_path): + iotests.log("=3D=3D=3D Zero size=3D=3D=3D") + iotests.log("") + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': 0 }) + + +# Maximum CHS size +def maximum_chs_size(vm, file_path): + iotests.log("=3D=3D=3D Maximum CHS size=3D=3D=3D") + iotests.log("") + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': 16 * 65535 * 255 * 512 }) + + +# Actual maximum size +def maximum_size(vm, file_path): + iotests.log("=3D=3D=3D Actual maximum size=3D=3D=3D") + iotests.log("") + + blockdev_create(vm, { 'driver': imgfmt, + 'file': 'protocol-node', + 'size': 0xff000000 * 512, + 'force-size': True }) + + +def main(): + for test_func in [implicit_defaults, explicit_defaults, non_defaults, + non_chs_size_without_force, zero_size, maximum_chs_s= ize, + maximum_size]: + + with iotests.FilePath('t.vpc') as file_path, \ + iotests.VM() as vm: + + vm.launch() + + iotests.log('--- Creating empty file ---') + blockdev_create(vm, { 'driver': 'file', + 'filename': file_path, + 'size': 0 }) + + vm.qmp_log('blockdev-add', driver=3D'file', filename=3Dfile_pa= th, + node_name=3D'protocol-node', + filters=3D[iotests.filter_qmp_testfiles]) + iotests.log('') + + print_info =3D test_func(vm, file_path) + iotests.log('') + + vm.shutdown() + iotests.img_info_log(file_path) + + +iotests.script_main(main, + supported_fmts=3D['vpc'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/266.out b/tests/qemu-iotests/266.out new file mode 100644 index 0000000000..b11953e81f --- /dev/null +++ b/tests/qemu-iotests/266.out @@ -0,0 +1,137 @@ +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Successful image creation (defaults) =3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "size": 67125248}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +image: TEST_IMG +file format: IMGFMT +virtual size: 64 MiB (67125248 bytes) +cluster_size: 2097152 + +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Successful image creation (explicit defaults) =3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "force-size": false, "size": 134= 250496, "subformat": "dynamic"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +image: TEST_IMG +file format: IMGFMT +virtual size: 128 MiB (134250496 bytes) +cluster_size: 2097152 + +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Successful image creation (non-default options) =3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "force-size": true, "size": 1048= 576, "subformat": "fixed"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +image: TEST_IMG +file format: IMGFMT +virtual size: 1 MiB (1048576 bytes) + +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Size not representable in CHS =3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "force-size": false, "size": 104= 8576}}} +{"return": {}} +Job failed: The requested image size cannot be represented in CHS geometry +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +qemu-img: Could not open 'TEST_IMG': File too small for a VHD header + +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Zero size=3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +image: TEST_IMG +file format: IMGFMT +virtual size: 0 B (0 bytes) +cluster_size: 2097152 + +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Maximum CHS size=3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "size": 136899993600}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +image: TEST_IMG +file format: IMGFMT +virtual size: 127 GiB (136899993600 bytes) +cluster_size: 2097152 + +--- Creating empty file --- +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vpc", "size": 0}}} +{"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": {}} + +=3D=3D=3D Actual maximum size=3D=3D=3D + +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vpc", "file": "protocol-node", "force-size": true, "size": 2190= 433320960}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +image: TEST_IMG +file format: IMGFMT +virtual size: 1.99 TiB (2190433320960 bytes) +cluster_size: 2097152 + diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index d95d556414..8b96456278 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -274,3 +274,4 @@ 257 rw 258 rw quick 262 rw quick migration +266 rw quick --=20 2.21.0