From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776434; cv=none; d=zohomail.com; s=zohoarc; b=MYTrTUai/kY//29Wxopv4CZntaVCISyKmDr4my5UfOnnRtBn6n3QyrsWUYhtDER10PeglHEMZEAjSIGsaERLl6bzhqFA5DekXLcRjb/bLYRlnfGzKO5JZgj869nXryhrBqXU6CCnkrW7r/xhVN4XwMKXnY3CUaCXNMH4DpEchY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776434; 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=FC+5ANwUnUTOhltzSZFm3ttJ4/0HCjiTAYrnNTZpJCE=; b=WwXWh+TMjlziSWtoKZzqoI5+75MYHq+pa+rNNOwwDOoFgVgQ2pynLEZojLATP5yJfO7yCxOSKJ1ZI7CiAVCjDSUd6xgUnwDiNgHGzalPIiVpqoTE9aviKuLNG/3Z7s0dhtOv9c36k0uaEgGkrbBi0wtHSF7R4ArjWOmOdCCY2TU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776434717453.0717018637655; Thu, 19 Dec 2019 09:27:14 -0800 (PST) Received: from localhost ([::1]:45306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzZx-0008Os-2N for importer@patchew.org; Thu, 19 Dec 2019 12:27:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42942) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXj-000671-EC for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXg-0005Pl-Oc for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31129 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 1ihzXg-0005Jo-IA for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:52 -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-68-aCypv3kqNf6YLYW5L-bihA-1; Thu, 19 Dec 2019 12:24:49 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D3B28DB64; Thu, 19 Dec 2019 17:24:48 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE39C620C0; Thu, 19 Dec 2019 17:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776291; 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=FC+5ANwUnUTOhltzSZFm3ttJ4/0HCjiTAYrnNTZpJCE=; b=LMvnBkQZ3AN36maydWI8THoNjys3cnhW1a/XphF3vdOSwK8h1r7auORE/CHrxrrc+DSWwi 4afCPYxDKp+lsss3+LtBIFOU4102oqtbln4qE5jysxQXJIoep9JDdeR0tBFXTyw8FI+gYl SJAaHVtGMXKn06BhHW7G2ER4RTdFCBk= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 01/30] iotests: Provide a function for checking the creation of huge files Date: Thu, 19 Dec 2019 18:24:12 +0100 Message-Id: <20191219172441.7289-2-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: aCypv3kqNf6YLYW5L-bihA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Thomas Huth Some tests create huge (but sparse) files, and to be able to run those tests in certain limited environments (like CI containers), we have to check for the possibility to create such files first. Thus let's introduce a common function to check for large files, and replace the already existing checks in the iotests 005 and 220 with this function. Signed-off-by: Thomas Huth Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Kevin Wolf --- tests/qemu-iotests/005 | 5 +---- tests/qemu-iotests/220 | 6 ++---- tests/qemu-iotests/common.rc | 10 ++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005 index 58442762fe..b6d03ac37d 100755 --- a/tests/qemu-iotests/005 +++ b/tests/qemu-iotests/005 @@ -59,10 +59,7 @@ fi # Sanity check: For raw, we require a file system that permits the creation # of a HUGE (but very sparse) file. Check we can create it before continui= ng. if [ "$IMGFMT" =3D "raw" ]; then - if ! truncate --size=3D5T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough fi= les" - fi - rm "$TEST_IMG" + _require_large_file 5T fi =20 echo diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220 index 2d62c5dcac..15159270d3 100755 --- a/tests/qemu-iotests/220 +++ b/tests/qemu-iotests/220 @@ -42,10 +42,8 @@ echo "=3D=3D Creating huge file =3D=3D" =20 # Sanity check: We require a file system that permits the creation # of a HUGE (but very sparse) file. tmpfs works, ext4 does not. -if ! truncate --size=3D513T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough files" -fi -rm "$TEST_IMG" +_require_large_file 513T + IMGOPTS=3D'cluster_size=3D2M,refcount_bits=3D1' _make_test_img 513T =20 echo "=3D=3D Populating refcounts =3D=3D" diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 0cc8acc9ed..6f0582c79a 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -643,5 +643,15 @@ _require_drivers() done } =20 +# Check that we have a file system that allows huge (but very sparse) files +# +_require_large_file() +{ + if ! truncate --size=3D"$1" "$TEST_IMG"; then + _notrun "file system on $TEST_DIR does not support large enough fi= les" + fi + rm "$TEST_IMG" +} + # make sure this script returns success true --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776615; cv=none; d=zohomail.com; s=zohoarc; b=HgJAOvcGrHqRJC7l1x/GLX/RPcu6aldg3o1sOeeqH79YJEYnWnNKvJDAdBFImGZjyJszGzKppbpNWdMDGY3oihVLrYaJ815Byhr9gHE9/1twdQf6kT4VmTo6NcEZLSerxWXIGpatSNdqJ8G0jqmNpfQ+CojTF5HtlQkEwbaI/9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776615; 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=Q40D87wpfXXBcX5JqBIMu2XiRxmI1n/8wqQbJGu/rFg=; b=Eup7iqnzmKAckIxlu/KXeQe7akBGoJk+SZ/LZUFlrU2465cuqQn1vqmC+sBl/Wdve73Ni6XbcW2DsGIVuLuJarphoZIWtnl3Tk2XwlG63TmQhLq5T/igSlhXszAu8m1Fi2n83hb+KjcD/aLOCYZmqKPHnZ+EqkjEMDk7y04ZmG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157677661504074.39430918683274; Thu, 19 Dec 2019 09:30:15 -0800 (PST) Received: from localhost ([::1]:45344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzcr-0003iR-Gg for importer@patchew.org; Thu, 19 Dec 2019 12:30:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43107) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXj-000674-FZ for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXh-0005U8-MC for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:55 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:22567 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 1ihzXh-0005RE-FW for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:53 -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-104-qCzthPRiO0O9dGWXM0Rvgw-1; Thu, 19 Dec 2019 12:24:51 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D844107ACE4; Thu, 19 Dec 2019 17:24:50 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25DAC63B8A; Thu, 19 Dec 2019 17:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776292; 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=Q40D87wpfXXBcX5JqBIMu2XiRxmI1n/8wqQbJGu/rFg=; b=RFb5x0wuGTItygEI9ey8GWdGPunqYWx7GR5Huh8NLWPXeHRYQjHK2w8JZtS4jYkdCn6aSz AhGdZyIJaKiK4h2/oC6v1XrXKYui+rEqcAEfiPFQipfdajvmEQWvjZxt+KE59JXBN1HnJQ H4IikTGSCe5Ux4BpDis8TqDOT0K7gzQ= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 02/30] iotests: Skip test 060 if it is not possible to create large files Date: Thu, 19 Dec 2019 18:24:13 +0100 Message-Id: <20191219172441.7289-3-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: qCzthPRiO0O9dGWXM0Rvgw-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Thomas Huth Test 060 fails in the arm64, s390x and ppc64le LXD containers on Travis (which we will hopefully enable in our CI soon). These containers apparently do not allow large files to be created. The repair process in test 060 creates a file of 64 GiB, so test first whether such large files are possible and skip the test if that's not the case. Signed-off-by: Thomas Huth Signed-off-by: Kevin Wolf --- tests/qemu-iotests/060 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index b91d8321bb..d96f17a484 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -49,6 +49,9 @@ _supported_fmt qcow2 _supported_proto file _supported_os Linux =20 +# The repair process will create a large file - so check for availability = first +_require_large_file 64G + rt_offset=3D65536 # 0x10000 (XXX: just an assumption) rb_offset=3D131072 # 0x20000 (XXX: just an assumption) l1_offset=3D196608 # 0x30000 (XXX: just an assumption) --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776434; cv=none; d=zohomail.com; s=zohoarc; b=IRAfT3zTbwpMiuLXF2371TAKxguUrGWstocA2FKoS8Rz49xnrGF3ezfMSLkQOQhSSmanQfquKGWzyu5IxVFcfdYCeLb2tuhcKtsScfMBuANuXuEXk/D5daEwbM2IN5ZJka8+EuEnMAUrLv13qV+llsMUQTP9JJVNODMN90yHAe4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776434; 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=LzbbgxIoL1hfzmiAQvdOupOmZIWsJahvvA0A3jOjjeU=; b=NQSYifmqki9BIjmv68IJ0xzUf6PWnnpgIB3eQwj7IlxJsrBP8NTOQ3uJRI2QpdaxYMINT7EllxOAxLqoEOm3Kz2o3AU1fNXRJtMvrsOEY9nRnkWaBKVe8QMy4fxt3BqbXep+s7NHbvmuhjPb6ZIuv3zmlcqnLHF0jJRBNnb+q5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776434369499.4779385974248; Thu, 19 Dec 2019 09:27:14 -0800 (PST) Received: from localhost ([::1]:45302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzZw-0008ML-MB for importer@patchew.org; Thu, 19 Dec 2019 12:27:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43267) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXk-000677-De for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXj-0005bz-44 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:56 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:39326 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 1ihzXi-0005Z7-SO for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:54 -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-323-hgS6ckNhPIigxS9syKAojA-1; Thu, 19 Dec 2019 12:24:52 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C045107ACC4; Thu, 19 Dec 2019 17:24:51 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92F315C7DD; Thu, 19 Dec 2019 17:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776294; 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=LzbbgxIoL1hfzmiAQvdOupOmZIWsJahvvA0A3jOjjeU=; b=BOd5nQFpswhbuIzoeqd37MBFFLT+SVPX1mvg4qvJpXQ9jdnTVSnkbx+6LaowEPCT0og2f+ bE/JrjPeAI2ehC36gc89n8jDARGCVA7aJaWLfcE4y+Ila3Cbwd5lq2qQPV3B61m+0m9MSe fcVjK5VC65/knYen/jU9J9PqHCTheKg= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 03/30] iotests: Skip test 079 if it is not possible to create large files Date: Thu, 19 Dec 2019 18:24:14 +0100 Message-Id: <20191219172441.7289-4-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: hgS6ckNhPIigxS9syKAojA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Thomas Huth Test 079 fails in the arm64, s390x and ppc64le LXD containers on Travis (which we will hopefully enable in our CI soon). These containers apparently do not allow large files to be created. Test 079 tries to create a 4G sparse file, which is apparently already too big for these containers, so check first whether we can really create such files before executing the test. Signed-off-by: Thomas Huth Signed-off-by: Kevin Wolf --- tests/qemu-iotests/079 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079 index 81f0c21f53..78536d3bbf 100755 --- a/tests/qemu-iotests/079 +++ b/tests/qemu-iotests/079 @@ -39,6 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file nfs =20 +# Some containers (e.g. non-x86 on Travis) do not allow large files +_require_large_file 4G + echo "=3D=3D=3D Check option preallocation and cluster_size =3D=3D=3D" echo cluster_sizes=3D"16384 32768 65536 131072 262144 524288 1048576 2097152 41= 94304" --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776923; cv=none; d=zohomail.com; s=zohoarc; b=e61s+nA7GSFiY9DpmNRT4b1EsbleDQtQQLWJX+38SiqL2FZwBHk922+p3VT0/XUg7pNQ4IeFppFQr2TiEPkBpD1KdkQJz6mhTP3N1FIZHNo40PD+D++4lD8a+SzI6s5/qcKCvY8krDouti0g1wHIKDagWbUgkZdi7OCxVs/CyNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776923; 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=3eY7agRu1Bt1uazChG+gikshqr3IfI6j+Fl6tLEcA3Y=; b=Lxxf7wi5dzrhgq2BptUY5BNVP6j2/fftXhLvFPNDLTL4a+2vR9GnARrOq0Q7rUeB7jIBbffcQcSHckQEf1sttF/IljLXvpdxySPHK0rc4gzZL9u8HNi9wd6Yp3ozbFOUPkmujbLcMFqxDX0hXm4g7iZ7v2G2M6gLnPPAq6iC2WQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157677692338247.62036718317859; Thu, 19 Dec 2019 09:35:23 -0800 (PST) Received: from localhost ([::1]:45402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzhp-00005D-Tr for importer@patchew.org; Thu, 19 Dec 2019 12:35:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43526) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXm-00067j-C5 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXl-0005l9-98 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:58 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:59578 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 1ihzXk-0005hf-VF for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:24:57 -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-235-KALX4k9CMPqgG4tdcjjroQ-1; Thu, 19 Dec 2019 12:24:54 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB76C1005502; Thu, 19 Dec 2019 17:24:53 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF98963B8A; Thu, 19 Dec 2019 17:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776296; 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=3eY7agRu1Bt1uazChG+gikshqr3IfI6j+Fl6tLEcA3Y=; b=H36HjDYk5K2Tdfq/YeWyDHT+giROQPmhURy5yD7XHf+nAhANShFT1cVOAgjyzwhVNe/eFv EZxGbIDGADWnCgrOoBHToojKlo899Wmz47/hpWLFc4X3bMFR/Dde8lag8TxA/25Okkpcks /HJE0fQ0Go4MrJe/TCost7u7FbPSNCE= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 04/30] qapi: better document NVMe blockdev @device parameter Date: Thu, 19 Dec 2019 18:24:15 +0100 Message-Id: <20191219172441.7289-5-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: KALX4k9CMPqgG4tdcjjroQ-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.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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Daniel P. Berrang=C3=A9 Mention that this is a PCI device address & give the format it is expected in. Also mention that it must be first unbound from any host kernel driver. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- qapi/block-core.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 0cf68fea14..fcb52ec24f 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2963,9 +2963,13 @@ # # Driver specific block device options for the NVMe backend. # -# @device: controller address of the NVMe device. +# @device: PCI controller address of the NVMe device in +# format hhhh:bb:ss.f (host:bus:slot.function) # @namespace: namespace number of the device, starting from 1. # +# Note that the PCI @device must have been unbound from any host +# kernel driver before instructing QEMU to add the blockdev. +# # Since: 2.12 ## { 'struct': 'BlockdevOptionsNVMe', --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776468; cv=none; d=zohomail.com; s=zohoarc; b=VUeYQQuLcp4NHQI5Bz3Tmsu6wHtM7t6MG9JyDwGSir0rlTYUZsn+nRoZHTUPzdL2S6D1jBpxZhrl9gFyyoA1rtv7V+6UhVVUpYio01DjaRnJVK9M7tqCImfNpXCajo84M+8wL53M8F3saeGaJ0zYATffw2IbRU8m1aupsrNo4zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776468; 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=CN28InvE40S6icR90JvYy808t2h2ocVy/jxeJ0DcvKc=; b=TJ1nLo5RNoEzdayzVZ7VljLJvtaO7ZNk7PfHoCNruFl1Rx90PLQ8G17aQfyS7HdBy3+pdSHVlpldLKRZ13ARWhTNiVjyerfBCQg0FgGoerY6LR9MmAg7/WxZwlz5sfbV0NfICBZ0usur+tTyrpsUozHpOSEbhJgLgi0WknUuf8E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776468773927.1646987937015; Thu, 19 Dec 2019 09:27:48 -0800 (PST) Received: from localhost ([::1]:45308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzaV-0000VE-H9 for importer@patchew.org; Thu, 19 Dec 2019 12:27:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44053) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXr-0006G8-1V for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXp-00063H-26 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:02 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24116 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 1ihzXo-00060U-SO for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:00 -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-338-4LeXxaG4PQmVFyal_wRBLw-1; Thu, 19 Dec 2019 12:24:56 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 19F57800EB8; Thu, 19 Dec 2019 17:24:55 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23308620C0; Thu, 19 Dec 2019 17:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776300; 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=CN28InvE40S6icR90JvYy808t2h2ocVy/jxeJ0DcvKc=; b=gbL46uJ4XOCYGyHWtwa5u22bZ2jR/sjPG9Gt5/9jApLgKP/j8t2LDD3tJ3DK1k/rBb4K+t lf1xhzyLSTUT8I2C7OPliRdDlNxaHQebhf0Hl5oNVTEkVFvcrX++oFvKppjrrAXqQ/dhPx VPyLw+xkPBUupXAuSomROAElWRLRgq4= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 05/30] qemu-img: fix info --backing-chain --image-opts Date: Thu, 19 Dec 2019 18:24:16 +0100 Message-Id: <20191219172441.7289-6-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 4LeXxaG4PQmVFyal_wRBLw-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Only apply --image-opts to the topmost image when listing an entire backing chain. It is incorrect to treat backing filenames as image options. Assuming we have the backing chain t.IMGFMT.base <- t.IMGFMT.mid <- t.IMGFMT, qemu-img info fails as follows: $ qemu-img info --backing-chain --image-opts \ driver=3Dqcow2,file.driver=3Dfile,file.filename=3Dt.IMGFMT qemu-img: Could not open 'TEST_DIR/t.IMGFMT.mid': Cannot find device=3DTE= ST_DIR/t.IMGFMT.mid nor node_name=3DTEST_DIR/t.IMGFMT.mid Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia Signed-off-by: Kevin Wolf --- qemu-img.c | 3 ++ tests/qemu-iotests/279 | 57 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/279.out | 35 +++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 4 files changed, 96 insertions(+) create mode 100755 tests/qemu-iotests/279 create mode 100644 tests/qemu-iotests/279.out diff --git a/qemu-img.c b/qemu-img.c index 95a24b9762..6233b8ca56 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2680,7 +2680,10 @@ static ImageInfoList *collect_image_info_list(bool i= mage_opts, =20 blk_unref(blk); =20 + /* Clear parameters that only apply to the topmost image */ filename =3D fmt =3D NULL; + image_opts =3D false; + if (chain) { if (info->has_full_backing_filename) { filename =3D info->full_backing_filename; diff --git a/tests/qemu-iotests/279 b/tests/qemu-iotests/279 new file mode 100755 index 0000000000..6682376808 --- /dev/null +++ b/tests/qemu-iotests/279 @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# +# Test qemu-img --backing-chain --image-opts +# +# 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 . +# + +seq=3D$(basename "$0") +echo "QA output created by $seq" + +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + rm -f "$TEST_IMG.mid" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +# Backing files are required... +_supported_fmt qcow qcow2 vmdk qed +_supported_proto file +_supported_os Linux + +TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M +TEST_IMG=3D"$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base" +_make_test_img -b "$TEST_IMG.mid" + +echo +echo '=3D=3D qemu-img info --backing-chain =3D=3D' +_img_info --backing-chain | _filter_img_info + +echo +echo '=3D=3D qemu-img info --backing-chain --image-opts =3D=3D' +TEST_IMG=3D"driver=3Dqcow2,file.driver=3Dfile,file.filename=3D$TEST_IMG" _= img_info --backing-chain --image-opts | _filter_img_info + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/279.out b/tests/qemu-iotests/279.out new file mode 100644 index 0000000000..f4dc6c69cb --- /dev/null +++ b/tests/qemu-iotests/279.out @@ -0,0 +1,35 @@ +QA output created by 279 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D67108864 +Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=3DIMGFMT size=3D67108864 backing_f= ile=3DTEST_DIR/t.IMGFMT.base +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.mid + +=3D=3D qemu-img info --backing-chain =3D=3D +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +backing file: TEST_DIR/t.IMGFMT.mid + +image: TEST_DIR/t.IMGFMT.mid +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +backing file: TEST_DIR/t.IMGFMT.base + +image: TEST_DIR/t.IMGFMT.base +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) + +=3D=3D qemu-img info --backing-chain --image-opts =3D=3D +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +backing file: TEST_DIR/t.IMGFMT.mid + +image: TEST_DIR/t.IMGFMT.mid +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +backing file: TEST_DIR/t.IMGFMT.base + +image: TEST_DIR/t.IMGFMT.base +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 6b10a6a762..eb57ddc72c 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -286,3 +286,4 @@ 272 rw 273 backing quick 277 rw quick +279 rw backing quick --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776697; cv=none; d=zohomail.com; s=zohoarc; b=AWOpyHMWaw9q2843qFo9s/M/bP6eUx4DULXUqUSSn4ufnu38Rnn76NNuZ+r7VBOTYh7xK3Fppwxjb2HWv7awNIbQXmM5DPuz+iY/B/qjsBJYDC20IHUMMk89jpIV5Ma1Yhy9gUc4ZV2fOw7W9tBNUnpvIbzCSpDcNOvR1ivqI7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776697; 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=0DpfEMkeVoxAUi4VCciCaV9lm9Ejo8S0Ej9ZdoEnI1s=; b=Nho34fGbNeWD74yyhtkO5SJ1JoRqTEVDyaDJV7ZSYgbUm7mN1vhsn7dZ5/PLxPiG0YXOJXcbusnCD0sDN4Ex/IUVLlwrvYQBUWU3XyCs9/BeaqZHg6F2f5c1FrFlc7o/tpdg/H5/W02GeK0vVUn3fw8nrDv9AkOa6msO8dbBWEw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15767766971041012.2485720582546; Thu, 19 Dec 2019 09:31:37 -0800 (PST) Received: from localhost ([::1]:45354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzeB-0004mu-D2 for importer@patchew.org; Thu, 19 Dec 2019 12:31:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44215) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXs-0006Ja-GW for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXq-00069O-Gz for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:03 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56670 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 1ihzXq-00066M-4b for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:02 -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-325-W1iOC1-aML2lesrhHS6KGA-1; Thu, 19 Dec 2019 12:24:58 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F650DB60; Thu, 19 Dec 2019 17:24:56 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FB2A620C0; Thu, 19 Dec 2019 17:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776301; 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=0DpfEMkeVoxAUi4VCciCaV9lm9Ejo8S0Ej9ZdoEnI1s=; b=DPMu/mZN++ImI0YX/FEPBYMwTz6hzSDJ1pz4aD0sBj9nOjcEq9CpGgXSFuh+BgbSvIVdNh waEarPFzhGdOLSEd6Af8T4h3oH8So5/MP09+dh7nTBRPkgTPDWd1QrWgWkBe3UyqDyInbX uzPIRb/KRxb1VIuqbL8qVUPI1u+HooA= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 06/30] block: Error out on image creation with conflicting size options Date: Thu, 19 Dec 2019 18:24:17 +0100 Message-Id: <20191219172441.7289-7-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: W1iOC1-aML2lesrhHS6KGA-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.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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If both the create options (qemu-img create -o ...) and the size parameter were given, the size parameter was silently ignored. Instead, make specifying two sizes an error. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block.c | 10 ++++++++-- tests/qemu-iotests/049 | 5 +++++ tests/qemu-iotests/049.out | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 473eb6eeaa..73029fad64 100644 --- a/block.c +++ b/block.c @@ -5751,12 +5751,11 @@ void bdrv_img_create(const char *filename, const ch= ar *fmt, return; } =20 + /* Create parameter list */ create_opts =3D qemu_opts_append(create_opts, drv->create_opts); create_opts =3D qemu_opts_append(create_opts, proto_drv->create_opts); =20 - /* Create parameter list with default values */ opts =3D qemu_opts_create(create_opts, NULL, 0, &error_abort); - qemu_opt_set_number(opts, BLOCK_OPT_SIZE, img_size, &error_abort); =20 /* Parse -o options */ if (options) { @@ -5766,6 +5765,13 @@ void bdrv_img_create(const char *filename, const cha= r *fmt, } } =20 + if (!qemu_opt_get(opts, BLOCK_OPT_SIZE)) { + qemu_opt_set_number(opts, BLOCK_OPT_SIZE, img_size, &error_abort); + } else if (img_size !=3D UINT64_C(-1)) { + error_setg(errp, "The image size must be specified only once"); + goto out; + } + if (base_filename) { qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &local_e= rr); if (local_err) { diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049 index c100d30ed0..051a1c79e0 100755 --- a/tests/qemu-iotests/049 +++ b/tests/qemu-iotests/049 @@ -78,6 +78,11 @@ for s in $sizes; do test_qemu_img create -f $IMGFMT -o size=3D$s "$TEST_IMG" done =20 +echo "=3D=3D 4. Specify size twice (-o and traditional parameter) =3D=3D" +echo + +test_qemu_img create -f $IMGFMT -o size=3D10M "$TEST_IMG" 20M + echo "=3D=3D Check correct interpretation of suffixes for cluster size =3D= =3D" echo sizes=3D"1024 1024b 1k 1K 1M " diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out index 6b505408dd..affa55b341 100644 --- a/tests/qemu-iotests/049.out +++ b/tests/qemu-iotests/049.out @@ -121,6 +121,11 @@ qemu-img: TEST_DIR/t.qcow2: Parameter 'size' expects a= non-negative number below Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta- and exabytes, respectively. =20 +=3D=3D 4. Specify size twice (-o and traditional parameter) =3D=3D + +qemu-img create -f qcow2 -o size=3D10M TEST_DIR/t.qcow2 20M +qemu-img: TEST_DIR/t.qcow2: The image size must be specified only once + =3D=3D Check correct interpretation of suffixes for cluster size =3D=3D =20 qemu-img create -f qcow2 -o cluster_size=3D1024 TEST_DIR/t.qcow2 64M --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776965; cv=none; d=zohomail.com; s=zohoarc; b=fK7UD/bV5pm899IxORIpVtENPkKmutMakudem1NGHC81y/zUhDFrS49XVGa9yB2l573Kf3cDM3IY3QYG00E6Y/sCVnxMdV7xqHPLJnYNcJRsxRm9OG2SQgVjvPtWkK9oBrkNEHbC5VfK7h7dqWnb8Zsk9s3e909YsfAbStJM9sg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776965; 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=fymX9kSg5/0X6TAVJP9vYJzlujDjgvG32GfWpTGgFls=; b=bKr5G64qbhVjTrZc8UujJwJsYve2njROv+TesXhF1w/lhziw5V2LXNf6DNmHxyH7nadypWzSI798RWb1YMlBVUV8WR1e38El/SeFj6ru73cMonr0tCmSBMKY/NHif2XHY3UZGFA+oYA0GM7gIF19aW5bovKdELitxhbfemBEbR4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776965266156.16329214368272; Thu, 19 Dec 2019 09:36:05 -0800 (PST) Received: from localhost ([::1]:45406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihziV-0001Zu-IY for importer@patchew.org; Thu, 19 Dec 2019 12:36:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44249) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXs-0006Jp-Kr for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXr-0006Bh-1y for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:04 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46298 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 1ihzXq-00067h-Jl for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:02 -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-379-YZ2_mGasOaiDjhmSmMJizA-1; Thu, 19 Dec 2019 12:24:58 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2EB7801E6C; Thu, 19 Dec 2019 17:24:57 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id BDBCE620C0; Thu, 19 Dec 2019 17:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776302; 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=fymX9kSg5/0X6TAVJP9vYJzlujDjgvG32GfWpTGgFls=; b=Ike3GOkayGxZJqpZh8Da1pB6d16c78AO0IMpJTqrSFzMdtiapuQX4CFyMcI54ohBDyqH97 DUN759ObKIRRujQMYFWzyKoHnjmWgVmU7V1iBops1aLN3AqJtPHWMk4nGmkk9ft9U1adj/ fvIMGlEOCUoleqUk2xl4HqSKBLxCIoI= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 07/30] blockjob: Fix error message for negative speed Date: Thu, 19 Dec 2019 18:24:18 +0100 Message-Id: <20191219172441.7289-8-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: YZ2_mGasOaiDjhmSmMJizA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The error message for a negative speed uses QERR_INVALID_PARAMETER, which implies that the 'speed' option doesn't even exist: {"error": {"class": "GenericError", "desc": "Invalid parameter 'speed'"= }} Make it use QERR_INVALID_PARAMETER_VALUE instead: {"error": {"class": "GenericError", "desc": "Parameter 'speed' expects = a non-negative value"}} Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Reviewed-by: Max Reitz --- blockjob.c | 3 ++- tests/qemu-iotests/030 | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/blockjob.c b/blockjob.c index c6e20e2fcd..5d63b1e89d 100644 --- a/blockjob.c +++ b/blockjob.c @@ -261,7 +261,8 @@ void block_job_set_speed(BlockJob *job, int64_t speed, = Error **errp) return; } if (speed < 0) { - error_setg(errp, QERR_INVALID_PARAMETER, "speed"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "speed", + "a non-negative value"); return; } =20 diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index f3766f2a81..be35bde06f 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -943,7 +943,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_no_active_block_jobs() =20 result =3D self.vm.qmp('block-stream', device=3D'drive0', speed=3D= -1) - self.assert_qmp(result, 'error/desc', "Invalid parameter 'speed'") + self.assert_qmp(result, 'error/desc', "Parameter 'speed' expects a= non-negative value") =20 self.assert_no_active_block_jobs() =20 @@ -952,7 +952,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', s= peed=3D-1) - self.assert_qmp(result, 'error/desc', "Invalid parameter 'speed'") + self.assert_qmp(result, 'error/desc', "Parameter 'speed' expects a= non-negative value") =20 self.cancel_and_wait(resume=3DTrue) =20 --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777149; cv=none; d=zohomail.com; s=zohoarc; b=ktBZz4NhXU9If8dJ8CVZUr7G9KmLfEnxyTaNvlCa0e6ovixPeBSTnFGuKtn421JXnaorRWPoTG+CaZxNIDqn49Ivo54t7Zi1VK7NxPil4AkI5c5oibRUu7VVBvkIp+iLElZMoq6VAx/nycpkWKPDa7Ae34JLZD0MZpnbTzNjd4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777149; 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=sG0XuUChJEQSJU/a3p0A//zbruXfiZigtw/szYBi2gI=; b=GU70Pg+zeNYwPd07VXXIsWVGdcb+rt3tqD5pA21JS4AEZg1oetoXU8fNhdNdFYAOZVGIfEWA2LSB8N7wD7sslORN60JLb309LFu6ZuRRhehoqXcYj9wfYzPWQG5CWGPO5bEAlSoHofVL1jl/Kpz7GpeqBCs4QI002mGvWIJJxdw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777149688226.22926781049148; Thu, 19 Dec 2019 09:39:09 -0800 (PST) Received: from localhost ([::1]:45444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzlT-00056v-K9 for importer@patchew.org; Thu, 19 Dec 2019 12:39:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44373) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXt-0006LJ-FQ for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXs-0006GX-9N for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:05 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38533 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 1ihzXr-0006Cr-Me for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:03 -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-274-8hRECqWvN72RhYraW81ing-1; Thu, 19 Dec 2019 12:24:59 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECC10800D41; Thu, 19 Dec 2019 17:24:58 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 055AD620C0; Thu, 19 Dec 2019 17:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776303; 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=sG0XuUChJEQSJU/a3p0A//zbruXfiZigtw/szYBi2gI=; b=Rr8mjyvcns1OUyXCkamYyMULAiHQJ6PsrqwlMP4ytteyMtTQX+vkRVhBhapgh2kqVfs3G3 2q/8Mz2vq+Www7uiRmLER1qsKuPL0iUs6owt8FZTEOeNCZ7FhzlyGQNiz/E8AOoImrdVBY NtHUWjAziN0U8DEuSbvkv+CmqoNOQac= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 08/30] qcow2: Declare BDRV_REQ_NO_FALLBACK supported Date: Thu, 19 Dec 2019 18:24:19 +0100 Message-Id: <20191219172441.7289-9-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 8hRECqWvN72RhYraW81ing-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the common case, qcow2_co_pwrite_zeroes() already only modifies metadata case, so we're fine with or without BDRV_REQ_NO_FALLBACK set. The only exception is when using an external data file, where the request is passed down to the block driver of the external data file. We are forwarding the BDRV_REQ_NO_FALLBACK flag there, though, so this is fine, too. Declare the flag supported therefore. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- block/qcow2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7c18721741..de0e89cf25 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1722,7 +1722,8 @@ static int coroutine_fn qcow2_do_open(BlockDriverStat= e *bs, QDict *options, } } =20 - bs->supported_zero_flags =3D header.version >=3D 3 ? BDRV_REQ_MAY_UNMA= P : 0; + bs->supported_zero_flags =3D header.version >=3D 3 ? + BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK := 0; =20 /* Repair image if dirty */ if (!(flags & (BDRV_O_CHECK | BDRV_O_INACTIVE)) && !bs->read_only && --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776648; cv=none; d=zohomail.com; s=zohoarc; b=MW1AT1Ig9s7a4MfJqhu1sWIu64syZzzFpKUx4N798IW5G82FBhGFZ4iFTz3ChIf1TocOZ9Eqw1O5gafAOqrsucshUdMAcihqjzYSDqG+dbn7dbYppGFtSUr0tG6AZks8BLmbXoC965sxSsOJnfmyzACH8pDxX5y43hFpi5wuuW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776648; 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=XrtsKI6UtYWJu+YSlWZgfDftptplBLsPijshH5RaEuE=; b=EwS3qBExg1kzk/xlPfElt4di6B6r7aONWlHJcA29ReTTelhXc/7qWwZ33rmRsG2FhGEq1fleDAFnxpJgygVRtk/LmQ6yq902V0qYL6JuwNVdSG2U37Y+/17WY9Pucd6XuSvTjPFpgeBbonknIhQ60dnvnMZJllYn42zFGLJfwd4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776648626277.009668631552; Thu, 19 Dec 2019 09:30:48 -0800 (PST) Received: from localhost ([::1]:45346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzdO-0004CW-Fs for importer@patchew.org; Thu, 19 Dec 2019 12:30:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXs-0006KB-Tx for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXr-0006EM-Id for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:04 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:45715 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 1ihzXr-0006BQ-At for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:03 -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-135-_DSVXa3wOuqNERBiAClNZg-1; Thu, 19 Dec 2019 12:25:01 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 485E718B9F54; Thu, 19 Dec 2019 17:25:00 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 519EA620C0; Thu, 19 Dec 2019 17:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776302; 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=XrtsKI6UtYWJu+YSlWZgfDftptplBLsPijshH5RaEuE=; b=SyXUTh3HwJlWGpYi+PhYaf7KJpiESVZAm0MFWHHnMwNZuEZW3pCEJi3T0WwyvmjjSNHjrM 97J+SJEUqsF/1V9R2uaApLX25gLLJoiABaaThRBBxo9Cu3vDVnNFIOAWvTop1KpoJ910Ks GYdAz+EiC4OpacF70f9W0Nuc2jAtQPQ= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 09/30] iotests: Add qemu_io_log() Date: Thu, 19 Dec 2019 18:24:20 +0100 Message-Id: <20191219172441.7289-10-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: _DSVXa3wOuqNERBiAClNZg-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.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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add a function that runs qemu-io and logs the output with the appropriate filters applied. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index df0708923d..fc78852ae5 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -162,6 +162,11 @@ def qemu_io(*args): sys.stderr.write('qemu-io received signal %i: %s\n' % (-exitcode, = ' '.join(args))) return subp.communicate()[0] =20 +def qemu_io_log(*args): + result =3D qemu_io(*args) + log(result, filters=3D[filter_testfiles, filter_qemu_io]) + return result + def qemu_io_silent(*args): '''Run qemu-io and return the exit code, suppressing stdout''' args =3D qemu_io_args + list(args) --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777166; cv=none; d=zohomail.com; s=zohoarc; b=jPKdxFpI146bt49uD3GQkeTAC8s8qvGcFSyW3Md0d3IZ1DzN2W1ON9HdQ+/IJZ/viaN3dIEG5W8rtRp/4+4rgAo3a6WH04TgZy5DYFeMB3oaIOihebY9KZHTNpaucnbAaCcwny7Qh0lXXoiIG2Z/hE31LjqBv8Z/qYFmkdYv09E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777166; 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=qzOCGyGUkB6MqvpabN7+rCH0SE/ivBCj0/o+iivJo0c=; b=hkAj3b4RbdsZ3ZzWoD4qwRfZ0eMEPcl5QBq41VSFV0KbNPuzjfaFFTmiijzJdbiZNoC1YGVSMxwGD0S4gBfsK0/fERRqqQRQhb/Exvhlw96aJH6elY4dXoxsPk7gF9u8UouOIiZDRMScDrqK0okTMWBFoos6tnp1S3YeuRf0h80= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777166071369.43759802149236; Thu, 19 Dec 2019 09:39:26 -0800 (PST) Received: from localhost ([::1]:45448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzlk-0005fw-H0 for importer@patchew.org; Thu, 19 Dec 2019 12:39:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44536) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXu-0006NT-SO for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXt-0006Mj-Hz for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:06 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:24191 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 1ihzXt-0006Jo-94 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:05 -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-295-ChaZSP5aOgywtsXr0h7UmA-1; Thu, 19 Dec 2019 12:25:03 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5603801E6C; Thu, 19 Dec 2019 17:25:01 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 906EB620C0; Thu, 19 Dec 2019 17:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776304; 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=qzOCGyGUkB6MqvpabN7+rCH0SE/ivBCj0/o+iivJo0c=; b=XDtV5f24yksCgIQ1P5wdBm5ySNVdqsTZZk5iKcquRx2/THjEJtDR3+ozE9HHx5M5CDrQwe IWXnBGWwI2YTd7WXhTXzt9xSKFJ4o1YQtINlEgKnHE4+V/8xlQbhcclM4NhiLDI4oRdY3J rDXTcvSo7sYcqggKMnSPxZnPXIya1pA= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 10/30] iotests: Fix timeout in run_job() Date: Thu, 19 Dec 2019 18:24:21 +0100 Message-Id: <20191219172441.7289-11-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: ChaZSP5aOgywtsXr0h7UmA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" run_job() accepts a wait parameter for a timeout, but it doesn't actually use it. The only thing that is missing is passing it to events_wait(), so do that now. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index fc78852ae5..0ac3ad4b04 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -609,7 +609,7 @@ class VM(qtest.QEMUQtestMachine): ] error =3D None while True: - ev =3D filter_qmp_event(self.events_wait(events)) + ev =3D filter_qmp_event(self.events_wait(events, timeout=3Dwai= t)) if ev['event'] !=3D 'JOB_STATUS_CHANGE': if use_log: log(ev) --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777369; cv=none; d=zohomail.com; s=zohoarc; b=mGG0pgOLlqs5Qbd9TFhUH0W5FCkVpn93mUFsJdda6xFdpLudRqM2/e5dDw5PqrU9w+cgr0FHc50NYYXCOZP9izdig3gLQbXdYJWGaicqVfQdoqJ+UCln02t4DBrLK/XFxAcfAvGjlbP5WgvVl+gZJ1kvwP6cSehVe1vpGYt3XeA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777369; 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=csk/bOJL8RWRBNiVg8ETj1cbdqwbCfGTJZj0fyj26G4=; b=d6A9ZnJOZluNdIsMqCVlkGKG/KlepPppsQ9GcRReBnA+Rr0VE6A6KNky5MsZzNPLhYtKvX9QQV1MnSNWoL2N5UYEriSixc44OjVBjKNJr0iKq6i08vQpBK3eYG4fksM1RMK8qqKtle+QFjPeM6OZY0DoUkVKd55j8kY48ZLg4nY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777369746554.6089360531208; Thu, 19 Dec 2019 09:42:49 -0800 (PST) Received: from localhost ([::1]:45520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzp1-0001eS-LH for importer@patchew.org; Thu, 19 Dec 2019 12:42:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44663) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzXv-0006P0-OM for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzXu-0006R9-KN for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:07 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:30970 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 1ihzXu-0006OX-DM for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:06 -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-353-U2otkwviNyCUS5hOSMcQpg-1; Thu, 19 Dec 2019 12:25:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF50E107ACC7; Thu, 19 Dec 2019 17:25:03 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 190AE63B8A; Thu, 19 Dec 2019 17:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776305; 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=csk/bOJL8RWRBNiVg8ETj1cbdqwbCfGTJZj0fyj26G4=; b=YaoO27+x7nfDb3Zl27I3TIIRTP22nxSPku1v2YSbDiCf8nPA74cLjrsqlxZciTxZTl2eg0 cBIV9WiqoAIAEA+OE6Ru2FEPKgNo34+GozXxZ5gig308GYmU7DzYHiLIAut+W0PGYWHzwc kb2QIGTlAQvW6llxI/PpHvpy+YLJ04M= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 11/30] iotests: Support job-complete in run_job() Date: Thu, 19 Dec 2019 18:24:22 +0100 Message-Id: <20191219172441.7289-12-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: U2otkwviNyCUS5hOSMcQpg-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Automatically complete jobs that have a 'ready' state and need an explicit job-complete. Without this, run_job() would hang for such jobs. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 0ac3ad4b04..b46d298766 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -622,6 +622,8 @@ class VM(qtest.QEMUQtestMachine): error =3D j['error'] if use_log: log('Job failed: %s' % (j['error'])) + elif status =3D=3D 'ready': + self.qmp_log('job-complete', id=3Djob) elif status =3D=3D 'pending' and not auto_finalize: if pre_finalize: pre_finalize() --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777369; cv=none; d=zohomail.com; s=zohoarc; b=OoTTDxx6eFNPWlirLK8RN5yxEkxPhRRxh6VZ1/+Q87nwuJaJkClxAV5DwcMKxOAGFstWrL9y87Ujm9YXPfkB/V+uDX/JBlW1fVHCA/Z54UrxQM9+wpqqXwmpdROzEDfFnlnjY6puF1aKozAzG1ogTA40/moRD8bKKUjnU+nZkH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777369; 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=NUTCLFW3Yth22AoaoD0n40NJcS3KSifraPDy20bZCjo=; b=HYABO6rfA6O0xpvV2665bj/uSVuSoaH/KRMYCrs1NAFyg0yDyrN9cyt1oCDq5fwkN16P8ZddXioxQ4+H1ys3wOeTN1pVCqjnPk1sLYkadZG3fUwiqSj6mN9R0OwVzcq6HKE3fTI0+8ifMTBav1OkRFQXq7etCN2LKhGdz9TRMxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777369753522.5947406487588; Thu, 19 Dec 2019 09:42:49 -0800 (PST) Received: from localhost ([::1]:45522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzp2-0001iB-9C for importer@patchew.org; Thu, 19 Dec 2019 12:42:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45654) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzY5-0006c6-BM for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzY3-00076c-AP for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:16 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:21819 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 1ihzY2-00073b-UF for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25: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-269-bwOZaFOwMoKru7AMvRhkVA-1; Thu, 19 Dec 2019 12:25:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A3C410054E3; Thu, 19 Dec 2019 17:25:06 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id F346D63B8A; Thu, 19 Dec 2019 17:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776314; 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=NUTCLFW3Yth22AoaoD0n40NJcS3KSifraPDy20bZCjo=; b=P5RVGWNumwKBbq4xmZC9Im50KEr0kHDrQAfrnVBcCdTOuL7CqJ4LPvoDs4GgZtw2CrpX11 35FgpzjA/T8Ybu1LNPlV8WmsvbuOwz0autxpsrvWN4aIVkag9cBXAuLazBYUOMpkm0Fgpb V/SSuTl2YZDIl/qdSnSeAljtPCTopvg= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 12/30] qcow2: Use offset_into_cluster() Date: Thu, 19 Dec 2019 18:24:23 +0100 Message-Id: <20191219172441.7289-13-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: bwOZaFOwMoKru7AMvRhkVA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Alberto Garcia There's a couple of places left in the qcow2 code that still do the calculation manually, so let's replace them. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/qcow2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index de0e89cf25..375bbd0ad3 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -367,7 +367,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, return -EINVAL; } =20 - if (bitmaps_ext.bitmap_directory_offset & (s->cluster_size - 1= )) { + if (offset_into_cluster(s, bitmaps_ext.bitmap_directory_offset= )) { error_setg(errp, "bitmaps_ext: " "invalid bitmap directory offset"); return -EINVAL; @@ -1959,9 +1959,8 @@ static int coroutine_fn qcow2_co_block_status(BlockDr= iverState *bs, { BDRVQcow2State *s =3D bs->opaque; uint64_t cluster_offset; - int index_in_cluster, ret; unsigned int bytes; - int status =3D 0; + int ret, status =3D 0; =20 qemu_co_mutex_lock(&s->lock); =20 @@ -1982,8 +1981,7 @@ static int coroutine_fn qcow2_co_block_status(BlockDr= iverState *bs, =20 if ((ret =3D=3D QCOW2_CLUSTER_NORMAL || ret =3D=3D QCOW2_CLUSTER_ZERO_= ALLOC) && !s->crypto) { - index_in_cluster =3D offset & (s->cluster_size - 1); - *map =3D cluster_offset | index_in_cluster; + *map =3D cluster_offset | offset_into_cluster(s, offset); *file =3D s->data_file->bs; status |=3D BDRV_BLOCK_OFFSET_VALID; } --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776955; cv=none; d=zohomail.com; s=zohoarc; b=X5Br+a5OVYXlXuFmMNUuBbmbjaOT/KVCl6jAg80+plavhnQjx4ZBvKJgYsTSC1ZZRmov4aBcW9a/Z6yuj8mKKebDx9WNbRWGrFS9SYEjL4LONlQxdSkZLihlL8iOqJqHmFAp4TTJUo2GfOZeiHaojHsVTj0kgo1HAyxNvy8dFxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776955; 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=/TwCJpHfViZxCTvm6acdY8G48cikhN1vzfsDhDwmhZM=; b=c/ngSKeh3PG0B+h1CwBRUTGKP/NAlCFCfUZttwUe6REyPLFB+OgbGtpQoysQYehGLRUtRF0t+2irbVrkmc0VvOmrKcIoKHzdLo/Dfnu6QSkC4CH6+saiMRJ26Te2hwQUlXBUkw2k1wqmPK/0SG4mjPHscTwS4NpsdpCoYuOPWLI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776955536131.4905376882906; Thu, 19 Dec 2019 09:35:55 -0800 (PST) Received: from localhost ([::1]:45404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihziL-0000zn-J1 for importer@patchew.org; Thu, 19 Dec 2019 12:35:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45363) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzY1-0006YM-Tr for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzY0-0006sv-6M for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:13 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:20007 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 1ihzXz-0006px-W1 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25: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-32-dMAmk2geMDCDgewU0PkGIQ-1; Thu, 19 Dec 2019 12:25:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6928100550E; Thu, 19 Dec 2019 17:25:07 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CD0A5C7DD; Thu, 19 Dec 2019 17:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776311; 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=/TwCJpHfViZxCTvm6acdY8G48cikhN1vzfsDhDwmhZM=; b=UEyamfecF32WuDm1mhy6eM8DTR5EvZY1/GD0ZX2lFSOlKYSEOtg4CbQLgksGZrppDTBt+C SWtG7OSqZBJ/Lfsqbcs2uEt5nph2AmRPRCCOmZgOy0Pu2QsOLfFNMlquF+LcFVTVApRCO7 PGoA3EgNIOwMINyGv2uZRWm8EU67L/w= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 13/30] MAINTAINERS: fix qcow2-bitmap.c under Dirty Bitmaps header Date: Thu, 19 Dec 2019 18:24:24 +0100 Message-Id: <20191219172441.7289-14-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: dMAmk2geMDCDgewU0PkGIQ-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Somehow I wrote not full path to the file. Fix that. Also, while being here, rearrange entries, so that includes go first, then block, than migration, than util. Fixes: 052db8e71444d Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- MAINTAINERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 740401bcbb..dc81c89ccb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1870,12 +1870,12 @@ M: John Snow R: Vladimir Sementsov-Ogievskiy L: qemu-block@nongnu.org S: Supported -F: util/hbitmap.c -F: block/dirty-bitmap.c F: include/qemu/hbitmap.h F: include/block/dirty-bitmap.h -F: qcow2-bitmap.c +F: block/dirty-bitmap.c +F: block/qcow2-bitmap.c F: migration/block-dirty-bitmap.c +F: util/hbitmap.c F: tests/test-hbitmap.c F: docs/interop/bitmaps.rst T: git https://github.com/jnsnow/qemu.git bitmaps --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777564; cv=none; d=zohomail.com; s=zohoarc; b=ghMM9uR5P+9QpPC5galsagHngKwTeS0wysdT/Bw519L7bF3YQKbOFcK+nqLJEjG4dhSOBk99eACk38gwJj10eHyrGr6kZ6QxcfOw0YCU3htzsikfc5wyjbhWYhwYNTXkhgdKQ4TSk99CJso3+Zv1GazahNt4qKPFcq80IttsSho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777564; 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=Zh/uEnfpcdXuhvmMKgELcN8eOKfIOwzcm1GbF3BqXwI=; b=kcbSAIR8sfa8nOnQrHFjhuQxEBLoHtmkR3tk8yoRTVLLSfsjp8pbaQ/FtzXJkJk3XaIpqy23lAOTxWGZRmNVk2Aq8xRkrh3sA58wrgdg9IhWZJ3Q7TmwDkRnfY5ZlRXcdZnJq9YLVduD0u7kALAVHn0ZZZBishaXfNtWxxZPZuw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777564926373.4460882842135; Thu, 19 Dec 2019 09:46:04 -0800 (PST) Received: from localhost ([::1]:45550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzsB-0005zu-87 for importer@patchew.org; Thu, 19 Dec 2019 12:46:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45678) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzY5-0006cH-Ch for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzY2-00072s-Gj for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:15 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:51868 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 1ihzY2-000718-Ci for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25: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-285-KuDg2OjpPCC11fieIAjWaA-1; Thu, 19 Dec 2019 12:25:10 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4192E107ACC7; Thu, 19 Dec 2019 17:25:09 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4905063B9F; Thu, 19 Dec 2019 17:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776313; 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=Zh/uEnfpcdXuhvmMKgELcN8eOKfIOwzcm1GbF3BqXwI=; b=S6ycmLZKmTJV4NkI94GeVqSnwVaL++NvYelZRKj6+XGjljg7z/v6PRQkk7hOrL2D/CJOhH bfzQht5XJLGRZCc05Aj7smdVMcE+dJQX8ZuVAFGUluY0OAm9PhOxDSSr4K9F9zzz7LXQ1L HoqzdemGgbI3U/qqbIxdlC9wiBDbhVs= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 14/30] iotests: Add more "_require_drivers" checks to the shell-based tests Date: Thu, 19 Dec 2019 18:24:25 +0100 Message-Id: <20191219172441.7289-15-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: KuDg2OjpPCC11fieIAjWaA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Thomas Huth Test 051 should be skipped if nbd is not available, and 267 should be skipped if copy-on-read is not enabled. Signed-off-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/051 | 1 + tests/qemu-iotests/267 | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index 53bcdbc911..a13bce2fd0 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -41,6 +41,7 @@ _supported_proto file # A compat=3D0.10 image is created in this test which does not support any= thing # other than refcount_bits=3D16 _unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +_require_drivers nbd =20 do_run_qemu() { diff --git a/tests/qemu-iotests/267 b/tests/qemu-iotests/267 index 170e173c0a..b823668e29 100755 --- a/tests/qemu-iotests/267 +++ b/tests/qemu-iotests/267 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +_require_drivers copy-on-read =20 # Internal snapshots are (currently) impossible with refcount_bits=3D1 _unsupported_imgopts 'refcount_bits=3D1[^0-9]' --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776715; cv=none; d=zohomail.com; s=zohoarc; b=bG3AJBek0Xt32ROK+WCsAhe6djPOggwvE58+JgZXXvVWsKf5w9glVR8S8PdpopRFMJyDLrrGQKZRis7DhYBPJbPjGIxBKXKLycbDNjuv5p6HQwXwQlopiJvHWSG/xplSpOhp6RB5F6VM5LqcZNSIp2w/3D2OB9IoX/j9T2wb7Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776715; 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=XP3z2u17AeMkGWh3JcAijiW2am7KHBDX5/Yd+Ds14ZY=; b=G2eAz8TTeizAgfI7Iet5Hu8eR+Jik9WCPtMrfI2HNwlfT5MhVthvKxTyXXL+mIC2dgiADgSFNs+xhvzMX2BPdqioG3lQu4MCrBVrAe3VLQqJ38BkfaaKUF+x0Kz2R9buSzrVl6jGhyFNi+RWXcIs+/MYSxpUydi0tFGdj/2Y8uQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576776715663582.9513196996834; Thu, 19 Dec 2019 09:31:55 -0800 (PST) Received: from localhost ([::1]:45368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzeT-0005Oz-J8 for importer@patchew.org; Thu, 19 Dec 2019 12:31:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45814) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzY8-0006fa-EN for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzY6-0007BE-Og for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:20 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:28741 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 1ihzY5-00078G-BB for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25: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-248-vgKE5_FSMVixmU9BwmzVjA-1; Thu, 19 Dec 2019 12:25:12 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46F8E800D4C; Thu, 19 Dec 2019 17:25:11 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A430563B95; Thu, 19 Dec 2019 17:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776316; 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=XP3z2u17AeMkGWh3JcAijiW2am7KHBDX5/Yd+Ds14ZY=; b=Wfwmh2kpX1R5fualBLVsJ6Mzq2hSM/7hEVZoYlLLEmhL3C+j9xJRCO9evyQ69wUHQ9yHhL UL7jKkY036iNVi8nPLDm5rpNPERHk6kXN6G+uu2phkT53HiyWEg+51hssPnnK8Mlsk8AVt rm+tfYbkyxdjh/t70A08LrhbZ6i70Vs= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 15/30] iotests/273: Filter format-specific information Date: Thu, 19 Dec 2019 18:24:26 +0100 Message-Id: <20191219172441.7289-16-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: vgKE5_FSMVixmU9BwmzVjA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Max Reitz Doing this allows running this test with e.g. -o compat=3D0.10 or -o compat=3Drefcount_bits=3D1. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- tests/qemu-iotests/273 | 3 ++- tests/qemu-iotests/273.out | 27 --------------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/tests/qemu-iotests/273 b/tests/qemu-iotests/273 index 98a672516d..d598c47d9b 100755 --- a/tests/qemu-iotests/273 +++ b/tests/qemu-iotests/273 @@ -48,7 +48,8 @@ do_run_qemu() run_qemu() { do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp | - _filter_generated_node_ids | _filter_imgfmt | _filter_actual_image= _size + _filter_generated_node_ids | _filter_imgfmt | + _filter_actual_image_size | _filter_img_info } =20 TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M diff --git a/tests/qemu-iotests/273.out b/tests/qemu-iotests/273.out index c410fee5c4..684b8d6f77 100644 --- a/tests/qemu-iotests/273.out +++ b/tests/qemu-iotests/273.out @@ -38,15 +38,6 @@ Testing: -blockdev file,node-name=3Dbase,filename=3DTEST= _DIR/t.IMGFMT.base -blockdev "cluster-size": 65536, "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "IMGFMT", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "full-backing-filename": "TEST_DIR/t.IMGFMT.base", "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false @@ -57,15 +48,6 @@ Testing: -blockdev file,node-name=3Dbase,filename=3DTEST= _DIR/t.IMGFMT.base -blockdev "cluster-size": 65536, "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "IMGFMT", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "full-backing-filename": "TEST_DIR/t.IMGFMT.mid", "backing-filename": "TEST_DIR/t.IMGFMT.mid", "dirty-flag": false @@ -136,15 +118,6 @@ Testing: -blockdev file,node-name=3Dbase,filename=3DTE= ST_DIR/t.IMGFMT.base -blockdev "cluster-size": 65536, "format": "IMGFMT", "actual-size": SIZE, - "format-specific": { - "type": "IMGFMT", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, "full-backing-filename": "TEST_DIR/t.IMGFMT.base", "backing-filename": "TEST_DIR/t.IMGFMT.base", "dirty-flag": false --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777156; cv=none; d=zohomail.com; s=zohoarc; b=eQyVogkcJFIB3hzYQGvDOwpmjSmW4jHqzJXjfyku4meoGq0+lnCVVcc7RUR6ymSLILkWd4zsLFJiA9vAndUlj7FebdWpbUzcne0GeeqO2sORqDWC0+HHn0eg7VsNLd4zntu89ytfyXWmgCDpthmMIvwo6Gott1RJPxtNtI3ksnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777156; 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=vw7oRuycYJOyTajnvrh56g2DEx0T4R/7mnlQWZ8eZg0=; b=BoAq55YPOqJpGqTSpbfgwjpbNF2xPz7Q5XY2Tnco8wgCiyEhnayLxqIZx7Sdh3ziY/MZBw1QKv4Ybf0cFXLdT2ejAaG85EJ6+3G2yfog+fSpHGZqNJb7W3vONOL2vpUhPWBL3IgI5Sw3u8GVCWEH+Wo5/eUNfAqYf6NF4rFEDXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777156286370.0128274067506; Thu, 19 Dec 2019 09:39:16 -0800 (PST) Received: from localhost ([::1]:45446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzlb-0005Ie-1M for importer@patchew.org; Thu, 19 Dec 2019 12:39:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45727) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzY6-0006e7-QP for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzY5-00079S-CO for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:18 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30511 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 1ihzY5-00077u-7P for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25: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-400-2LJmOuDsMKawxR5tmFilpQ-1; Thu, 19 Dec 2019 12:25:13 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E92C2800D41; Thu, 19 Dec 2019 17:25:12 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B28963B8A; Thu, 19 Dec 2019 17:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776315; 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=vw7oRuycYJOyTajnvrh56g2DEx0T4R/7mnlQWZ8eZg0=; b=PSyoMNXOZK2AUzuIy4wst6YHT3v2HJ8W229W4fr4yUJz8JU0JzOOozwr2QRQB72yNWaVzm D6HMFjchBRYMm4ASInS6Blu+X0PZ8YQ5AMR+CB7VVbpxV2FoW8cy+/OA/hQUonvx/lU7Qp Nd/V6oGZo4Ae6REC9c0QWOGo5mmXvCs= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 16/30] iotests: Fix IMGOPTSSYNTAX for nbd Date: Thu, 19 Dec 2019 18:24:27 +0100 Message-Id: <20191219172441.7289-17-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 2LJmOuDsMKawxR5tmFilpQ-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Max Reitz There is no $SOCKDIR, only $SOCK_DIR. Fixes: f3923a72f199b2c63747a7032db74730546f55c6 Signed-off-by: Max Reitz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Kevin Wolf --- tests/qemu-iotests/common.rc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 6f0582c79a..555c453911 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -217,7 +217,8 @@ if [ "$IMGOPTSSYNTAX" =3D "true" ]; then TEST_IMG=3D"$DRIVER,file.filename=3D$TEST_DIR/t.$IMGFMT" elif [ "$IMGPROTO" =3D "nbd" ]; then TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT - TEST_IMG=3D"$DRIVER,file.driver=3Dnbd,file.type=3Dunix,file.path= =3D$SOCKDIR/nbd" + TEST_IMG=3D"$DRIVER,file.driver=3Dnbd,file.type=3Dunix" + TEST_IMG=3D"$TEST_IMG,file.path=3D$SOCK_DIR/nbd" elif [ "$IMGPROTO" =3D "ssh" ]; then TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT TEST_IMG=3D"$DRIVER,file.driver=3Dssh,file.host=3D127.0.0.1,file.p= ath=3D$TEST_IMG_FILE" --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576776997; cv=none; d=zohomail.com; s=zohoarc; b=GPWjSoTdrvNMA1/hXpL2HseBBJoOn6+dPPm0k+6FI7KB21hPAHOvKQZppD51ik1PN/FdFSDJMvd9KvEjULPZ5h9+gEQLE7bUSxUGr/iEy3wOc8XPs9oH9P5M8gStywVYh98GltFVdzRnKVXiPKrtXtM/nJH8nEnOT5VO3WTm3UA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576776997; 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=kLYtGlFVP6cijOFdOLP8wtUjEOb634rB639PnlrYs2w=; b=W/8tbHITFVdgUwyMAvzjeahgLQvDB0tjc2uZmU55IEqb0962asE0mgsmcpCETFN0bj3nbHR5fnRCMT2yxvVN1rNaHLwoxGDcuyDYItDqqGtJWqtvnDCCW25X250zEx1uXbe3okc+narh1S4rm3l+/g9slk+q77T24tZr99S9yoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15767769979401011.07795624511; Thu, 19 Dec 2019 09:36:37 -0800 (PST) Received: from localhost ([::1]:45420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzj2-00027O-GL for importer@patchew.org; Thu, 19 Dec 2019 12:36:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45920) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYA-0006gu-IY for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzY8-0007Eb-VR for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:21 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:31163) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihzY8-0007Bn-DY for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:20 -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-10-d61iplFHMViCSKIShih1fg-1; Thu, 19 Dec 2019 12:25:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A05B4801E72; Thu, 19 Dec 2019 17:25:15 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C3DD620C0; Thu, 19 Dec 2019 17:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776318; 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=kLYtGlFVP6cijOFdOLP8wtUjEOb634rB639PnlrYs2w=; b=XFHopo5LYQopp4zYdn9a8JqbcxHf2oe7br+AEHH/9Kq7wEdK10fyzSrDqEcm1Z2ExNlJgc Q5Gif4tRE4YyN1BH/nYqRVC3Nh9e4N33Z0PLK1HD0R17CI1snKEP3qlTaUklY8ExmYuY1q 2qG2ASlVanuDyNQ5URqjGqz29q0EKyY= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 17/30] qcow2: Move error check of local_err near its assignment Date: Thu, 19 Dec 2019 18:24:28 +0100 Message-Id: <20191219172441.7289-18-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: d61iplFHMViCSKIShih1fg-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Tuguoyi The local_err check outside of the if block was necessary when it was introduced in commit d1258dd0c87 because it needed to be executed even if qcow2_load_autoloading_dirty_bitmaps() returned false. After some modifications that all required the error check to remain where it is, commit 9c98f145dfb finally moved the qcow2_load_dirty_bitmaps() call into the if block, so now the error check should be there, too. Signed-off-by: Guoyi Tu Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- block/qcow2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 375bbd0ad3..7fbaac8457 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1705,14 +1705,14 @@ static int coroutine_fn qcow2_do_open(BlockDriverSt= ate *bs, QDict *options, if (!(bdrv_get_flags(bs) & BDRV_O_INACTIVE)) { /* It's case 1, 2 or 3.2. Or 3.1 which is BUG in management layer.= */ bool header_updated =3D qcow2_load_dirty_bitmaps(bs, &local_err); + if (local_err !=3D NULL) { + error_propagate(errp, local_err); + ret =3D -EINVAL; + goto fail; + } =20 update_header =3D update_header && !header_updated; } - if (local_err !=3D NULL) { - error_propagate(errp, local_err); - ret =3D -EINVAL; - goto fail; - } =20 if (update_header) { ret =3D qcow2_update_header(bs); --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777432; cv=none; d=zohomail.com; s=zohoarc; b=SAeLgAGn0IocVv9/TW5Boe+VVCWcu0V5fppR+jzQzi7eo6zDZL/WjZIIIVo0T880aRidBzdbotxK4waj7nyjEK2xPNnzUdFMo15r8j9jAFlSfgRbtc9SxrShIz8ABnW5qWBlwFjDe2/tvYWa2jaD8nLgie6RaLOwrWyOhtbOOas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777432; 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=H2+vGK+W5yIe7mJqMKNyZ4r4vIEObDyD7TxyB9HJZ5/M4kyKQAZmyVpdVyJl7NEgTf4nb44flJl5PLOXZW854+tKf1JAa5JFrE9emWKC0RtsVbL+baxxY9MVEv7sWdBbyC2KxWzretzm+mvd9bhYfMtqNHvRWprLEs/HjlEJKTM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777432003635.2347708175333; Thu, 19 Dec 2019 09:43:52 -0800 (PST) Received: from localhost ([::1]:45526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzq2-0003Rs-Ji for importer@patchew.org; Thu, 19 Dec 2019 12:43:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46099) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYE-0006l9-24 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYC-0007Ju-P4 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:25 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52066 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 1ihzYB-0007Hg-L5 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:24 -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-254-SbwOIM2oNHCmbOtMlHhAgA-1; Thu, 19 Dec 2019 12:25:19 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 082A4107ACC9; Thu, 19 Dec 2019 17:25:18 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7ECD620C0; Thu, 19 Dec 2019 17:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776322; 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=cDfnNbIiZD94SsM7HVXUvW0o2QGfvLvWfdmI+n4iqfSQcZzocAIUMaqekEj2599CjRyr95 F0UcwLzBmIM/9oELmaPVJhExUIz78MOpKwFeN1LghRSvwWXGwqXJPNJiLy0s/7gn9xIJme rDUs8F/+7lxwRshhxOr+mG82yqx5ag4= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 18/30] iotests: Create VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:29 +0100 Message-Id: <20191219172441.7289-19-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: SbwOIM2oNHCmbOtMlHhAgA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777782; cv=none; d=zohomail.com; s=zohoarc; b=Cg097nQQa1IB/vT/+hCn5J1SsHvIfGs36M2Xxya6Zh4+uoU6x6m4MgFqSKPp52R7mX42ZVzaZgQuNulVJn9afTKdGxaXGO7AAep61+183wLVk1x1uWHQ08bPsAPB++IsCAmScVCKzxZmuVI8qHjGfT/PxUkQIcUVvA5V1dtCsnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777782; 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=cj7+s/b8Z54uy/s0Vs8U/yh772rJWWcIh/bnCCyJwChDtHbQNqLs24Sov11IycUD7RAy6mWAQzH5jOEttVLGahBHhhYYQOBc+VshFPGBPSnL2eefwgFOLC/GL3T5nNpJ9dovlFVqxIiDpQJpv7J2DbkLqx10TlGGFo2Qunc9j6M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777782170372.7073891395786; Thu, 19 Dec 2019 09:49:42 -0800 (PST) Received: from localhost ([::1]:45600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzvg-0001PH-0O for importer@patchew.org; Thu, 19 Dec 2019 12:49:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46136) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYE-0006li-FA for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYD-0007La-4g for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:26 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:21737 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 1ihzYC-0007Je-Si for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:24 -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-58-qT648d2nNhCrSp78hdkxJg-1; Thu, 19 Dec 2019 12:25:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F2B5107ACC4; Thu, 19 Dec 2019 17:25:20 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F35063B8A; Thu, 19 Dec 2019 17:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776324; 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=diEmigJoVtsSLkNpH7thfoTsrcbPKhPVLmIJIwvD4ysiimDi23oNxlyO9A5Eycthnj8GY7 JVLDIevttkPTiXaIghzum/8id5XrwP867dKSv95YLhqOHlawiqklU/ob+zMfVMuDEgbFVM p46ye9Sdzo8rviuoauyAH2BplVRse0o= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 19/30] iotests: 255: Drop blockdev_create() Date: Thu, 19 Dec 2019 18:24:30 +0100 Message-Id: <20191219172441.7289-20-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: qT648d2nNhCrSp78hdkxJg-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777193; cv=none; d=zohomail.com; s=zohoarc; b=Ylh8HWXFWJe1OkT1x7BXepwcAYIBixUy6zn5aQCtL1q4TrV3s0eIhgjczc3uBFR7WOwziOMJtp12xIL9jsXKfwdwQAkOqOJDcJfaCE6J8dSjiM6wHPFNCxnxxscKXk4DLnncGosJqUOd9JiUkdzfvuGR/NzNMn+kadzqzeU4Hag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777193; 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=HLfxWVf1yQeaJMuxqqbO2toG8xcvggUxRygjrWhc3abyoydc/pVdRI9hu2JQLdsPvNxtqWf077wTMYR6Oo3e5u+Fv6IprZBjfW1Ez//GqTQ4MPRX1gMC4SC/pco4ICP7o1TIwpZchhjTtcBVrl/upehJgWZ62oXle/5pYcSE2gc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777193092831.5028307260658; Thu, 19 Dec 2019 09:39:53 -0800 (PST) Received: from localhost ([::1]:45450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzmB-0006Kh-CI for importer@patchew.org; Thu, 19 Dec 2019 12:39:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYH-0006rj-V7 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYG-0007ZA-0F for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:29 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:57879 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 1ihzYF-0007XL-PS for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:27 -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-331-EZhg3sk4OhuzY5FyWRtGXQ-1; Thu, 19 Dec 2019 12:25:24 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E99E2800EB8; Thu, 19 Dec 2019 17:25:22 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6CE3620C0; Thu, 19 Dec 2019 17:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776327; 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=JKHzODpauz3J6YglXqwW3E5L9Zoeufpgw4gVfZNT/P/KBEMTGVhFn+3iJIlm1pyrS6ITu9 rIUwIKYGcJ8w+Lmg08i3+wNaxMGAnxyivIGvjsR6YCa6R9WWWE7jypSmtKMu1GOcTAiFhG 6EL/ycToPRmWY9AbeDQQozfcagM78eo= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 20/30] iotests: 206: Convert to VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:31 +0100 Message-Id: <20191219172441.7289-21-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: EZhg3sk4OhuzY5FyWRtGXQ-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777782; cv=none; d=zohomail.com; s=zohoarc; b=kCwfNWTX65rc+LtkgyZM046JhlgFQhYS9ALcq39GApeugvlh6yl6TWoo3JBOvc0DVhtFrLWr3DMPV4EO2MKI9ad3uBVTa7ToaN3Y2byVVJhMKdUIQQhaSb9vG8trGwzWqhSQ8EY0nrjk+JRYIPQfkeB63hAofyTciS+IHuNWa9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777782; 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=ltEBGZM6yH4HaPV8/7i8botQBd3FkzX/6MtQo9l4wj893zVq5Ss1NVI07eY4xH+Jvx2wqbiLGMVO/A8oBpM73Bf8/hMdz5PNYKt99v7Idy3KCCoESVfRGKvI/AacsX2IIb2+/nu6OvG9tEj2vTtYavs37/2Kx4etz6qdZ4MM0BY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777782713351.93706439090386; Thu, 19 Dec 2019 09:49:42 -0800 (PST) Received: from localhost ([::1]:45602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzvg-0001PP-5I for importer@patchew.org; Thu, 19 Dec 2019 12:49:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46774) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYJ-0006ug-L0 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYI-0007jv-37 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:31 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:41951 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 1ihzYH-0007gd-U7 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:29 -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-336-vWQQS20QNe-13krOr3MLug-1; Thu, 19 Dec 2019 12:25:26 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06EC7107ACC4; Thu, 19 Dec 2019 17:25:25 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C64F620C0; Thu, 19 Dec 2019 17:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776329; 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=HKd2TtDDuvNniVyIOGLbVdVrDLtGkdCb3RW5Ik5qq5OGaZ90Ra+x3XCOIgyQochUQX0RVv zAEp0ADfZnr6nC96UE2bo5hRAc855UtN5/lR+2kA9unrZtXH7d6iAiPB15fUsrDEAz3+SM wNfSVW2wO5qwld4wS9VB3b/mKcb//3c= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 21/30] iotests: 210: Convert to VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:32 +0100 Message-Id: <20191219172441.7289-22-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: vWQQS20QNe-13krOr3MLug-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777960; cv=none; d=zohomail.com; s=zohoarc; b=X0c1l9bzfp+NCOkCFoKC9eDScHaJV5FvKmmJ800pVv+pSB1yAcThRgbXwDFaiGZHA3+P1UsGb9kz+XhO7WVvD00Zl64Gj1nWrRnwuoPF76BLxVp4qHYKE0oJeU8llVht9SRV6ImRqyLK/4MUvD8rb2q32e2+9URqmhgFuRYGFXg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777960; 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=VDyQRRrNE3RD1UOFTCmSRXFQc5OYU12sZqnL6Tjqf42qa4Ub9gBTp+EaBrsZWkDT2J3TSEapJgfPYhKCSG5olDcHhSvIEGEqTrU6NAtR8tYTHZo6G7pGlc35lEAi9BvliHH+t1PZ7BfbUhMWRyUWHUBeN4Q/mCQ4QinXLyHeUNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777960889114.50847690733826; Thu, 19 Dec 2019 09:52:40 -0800 (PST) Received: from localhost ([::1]:45700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzyZ-0005d7-5q for importer@patchew.org; Thu, 19 Dec 2019 12:52:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46929) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYT-00071X-R0 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYL-0007sD-Be for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:36 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47358 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 1ihzYL-0007qu-6t for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:33 -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-14-1V0YNZJoPpKrQ3VR4xDFLw-1; Thu, 19 Dec 2019 12:25:28 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F03E800D48; Thu, 19 Dec 2019 17:25:27 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D37E620C0; Thu, 19 Dec 2019 17:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776331; 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=CZ6LbqP0T8zJhDPtny2b+xw2nuKbJykzbUV2axlcmPm+HlEo7e72cJ1xYfGFFjDfu4thue Tf5D35vakabd1nnuZ6IYftNA0AdnBUQTUeDco2Pn0QTneD2i3ZofJCqeEeysdgDAPGU/vw EnAROrtUtuaF4ut8ffhbcb5cSEX0n1U= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 22/30] iotests: 212: Convert to VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:33 +0100 Message-Id: <20191219172441.7289-23-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 1V0YNZJoPpKrQ3VR4xDFLw-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576778115; cv=none; d=zohomail.com; s=zohoarc; b=Uis0Y1/DEXNflwWNHCEzmCeQBi0clL1y7cwI7WorKoD7F9ZPBaGIma6aohqIc6+vxZRetSnPiLHQyXInk0jm7J/TNyQGOuInQ05eAVGgkKWA8RKiyNCzbb5uFc0TRQ7b6XifZ+SMslT569B/q6fmnunugUNqQPXhBXK3y06qx8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576778115; 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=VpQz95VismsaBgOps4Vn4gIkC5SuH8WXtmFmbT2e7G41mII4F9mn9mb4enfb8ZcQiGYSmaXKa0FJx7H5H/uP3x6gFiBX01Dsl8pS4d9XOdDY0k7TPb1SeqRclWXVyD36LUMSiAnqN/1rSSBnCQiMJNCAzOyRsxfv1kTcO5iPOJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576778115687544.5964581092878; Thu, 19 Dec 2019 09:55:15 -0800 (PST) Received: from localhost ([::1]:45738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii013-0001X2-Sd for importer@patchew.org; Thu, 19 Dec 2019 12:55:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46950) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYb-00074o-Bb for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYT-0007yY-Q3 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:44 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:21024 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 1ihzYM-0007t9-GU for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:35 -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-37-FqieSac1Ouar5KtLyiJKyQ-1; Thu, 19 Dec 2019 12:25:30 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFD8C800EB8; Thu, 19 Dec 2019 17:25:29 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6D3E620C0; Thu, 19 Dec 2019 17:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776334; 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=CaxWOAqSixznosORmrXULyb/Gd/4i0l+Wty8pIDObRuTw9DPn13PHsX9XrCMwtx7GV8ZBD L2AQWzEkmeNMdELNau6pzt0EGf4vAtHF2OuaBfDv9znW4SNL5RGowtY9WhqfyGUlCE3DK2 pFgE81eT19SdnVtlKY7HeUUusPKfPIU= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 23/30] iotests: 213: Convert to VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:34 +0100 Message-Id: <20191219172441.7289-24-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: FqieSac1Ouar5KtLyiJKyQ-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777979; cv=none; d=zohomail.com; s=zohoarc; b=k+M9gryHciLDB5ymosNt4/2qGnGgE5hDdu+y5Q6Z4O/kPMQ/ua22l8iNjJhFeudWO5GoUTJXRhIzFgedioVXpr0pOsxBoqzbPzgpha9s3l/agYC2wr3EYlbqYtB2rjuoRSIVY2I8EUPNGFfZJkatBIkGpN2Rfs12e9kGztYT+6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777979; 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=fTs1oNcYAVBWxDowHqIgJk8dntJlMfnKIpN+yppvLpO/fCm5p/eHmv+E7jbRUYkRVF0a7F7ipgEybOxBVtmrjnU/+h1tNGwMESXRu/VWfH+Qbwwb8T88l7R1B/IcWOk74TR1LBes/3NGoDES2Z2QmOzFQ4eP1wDby5LE8Oakl4w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777979239823.945373512564; Thu, 19 Dec 2019 09:52:59 -0800 (PST) Received: from localhost ([::1]:45708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzyr-0006Go-L7 for importer@patchew.org; Thu, 19 Dec 2019 12:52:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47035) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYe-00077E-SV for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYb-00085A-Av for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54741 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 1ihzYV-0007v1-NO for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:45 -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-358-ikZvk8nuMCGUNXa8pwNEQQ-1; Thu, 19 Dec 2019 12:25:33 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 424F110054E3; Thu, 19 Dec 2019 17:25:32 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 020A263B8A; Thu, 19 Dec 2019 17:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776336; 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=hcs2ngf5eU1GDa9QaS093Ar4SeruLg4A1k6J3Gqfpnd7VPX14R17LnO7EhB0SUWDNFJOwb lyt1BLmn3bc9qWYlakm+dsowSVXRf5cG+4UaLOUwwRC/byAEgNgSN6NaKZhTSl/xaQWEQx wfenhzaEila4jX+I6RgB2VUhZ+LXmXI= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 24/30] iotests: 237: Convert to VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:35 +0100 Message-Id: <20191219172441.7289-25-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: ikZvk8nuMCGUNXa8pwNEQQ-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777661; cv=none; d=zohomail.com; s=zohoarc; b=SoAoQj3cbGgKcgniz11PcdsoZafOmEbAGO1BwZyX72C3saHz5js7bSlN+r93Wvbn+6NqqJjiR8d4B1Dv8Rzx0qgUrHDvKNiJqEkEH5vgNL+6LjgqO7FCnTMaFUNcaMLxocbHfDhNPcxS23aoPUH5bgqJaqppcfijuBWbvLbOY/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777661; 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=WEzTGPH/ZsvlLpmWxxl+2xU/6whN5Hv8cmFwnqDtK+A3zv0XY7719SusUISEpzI79xq85GW0X8TVeAa6CCNfCFFX1jukYaGJLfuT1n2I/32ooA/P7fQbp8/WYlUwMj0DeVUWnMuu4hXqjnwGwxrh648dY4Q3VLqczqfaPV7i/Pk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777661234884.940317899722; Thu, 19 Dec 2019 09:47:41 -0800 (PST) Received: from localhost ([::1]:45576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzti-0007aQ-QA for importer@patchew.org; Thu, 19 Dec 2019 12:47:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47030) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYe-00077B-Sj for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYb-00086B-Gr for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:51 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46614 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 1ihzYb-0007w0-9C for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:49 -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-145-HTeuY3DVPKipAXzJhpStFA-1; Thu, 19 Dec 2019 12:25:35 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3F64800D41; Thu, 19 Dec 2019 17:25:34 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89C8663B8A; Thu, 19 Dec 2019 17:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776339; 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=RuKmVwQ257NAiMQRT3AXBSDEWcrsXRFjQLRuEB2pCZ30DyGar9JwIODF2KZnAZ7N5FKp3a JKkGhhb9pscEV8p7KhQ89scQ8BRajx6LuYNUhEl5Dpse+gDB17RGCJpFG6HGBv5q7QxOh6 qt8xddYVXKa081q2bxpNQVTrnUzDrbM= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 25/30] iotests: 266: Convert to VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:36 +0100 Message-Id: <20191219172441.7289-26-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: HTeuY3DVPKipAXzJhpStFA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576778418; cv=none; d=zohomail.com; s=zohoarc; b=LGWzA4jKuOo0n60mywQxLrGxMRUlmQIdAgz0Q+JHi1GTMvlySbhCr5u9RD4/b8uubQxDYEummxBRXC5I5Fqr8Kfe8Rkn9I553a9o98f4ZUBymRxWlmiaRTziueQX4IBZhTJbBMJbKj8Fj+DW+x6/nP7NdDdSAftR/+xnqRwisYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576778418; 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=gHTxDFqUSq/VK+4wO89OpDZv25Vb/+fysOUTzCN6gfciDlmNlJPI5KosIfYbUbyDDLsHNd9Y673Mnp8XMCRQ72RlEVominAWGcct4gNDoRnmaKSPzWB3FTGvRo6Vg5W/lpE5qlVmUjNYYYxKv1yEVHeDVLzwgVEY8o3ElEju/68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576778418235564.6941387489151; Thu, 19 Dec 2019 10:00:18 -0800 (PST) Received: from localhost ([::1]:45860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii05w-0000dn-5V for importer@patchew.org; Thu, 19 Dec 2019 13:00:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47299) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYl-0007GE-Kr for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYi-0008DH-G0 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:58 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:57375 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 1ihzYh-00089t-1B for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:56 -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-96-BIBfJ0r_PPyzRza2och-Xw-1; Thu, 19 Dec 2019 12:25:37 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7C99DB61; Thu, 19 Dec 2019 17:25:36 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 077EB620C0; Thu, 19 Dec 2019 17:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776354; 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=XTYqATv3Z24rQMb6GI5MgSJMJYwnu/xC7NDln33+pe3wyX/rG2T8+hyGrAyPofQG73vZSU EdIiiem8jXxLKqPJ28teDVSW/RXAZ+hwPkEG6E2MmmB0sJkLsWIRv7rOeC9JLEhzYK2xjt 8D6UAZ54JOWjEGnkBNnpTvqFd0OcC0U= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 26/30] iotests: 207: Remove duplication with VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:37 +0100 Message-Id: <20191219172441.7289-27-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: BIBfJ0r_PPyzRza2och-Xw-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777865; cv=none; d=zohomail.com; s=zohoarc; b=AXmTGxW1Cjmch/bz4V3QDOwtjX0lXKs4zUw0ZFu2ezwI6Nd+dSWSZPcrYm10fkQxBv+jzdlFPfxLveMXhQLR/D8TGkXyE1U8yqpgd16fZHSvKdfEk8P2W0pA/OBfuW7qqOyP6TcWH/0XgBd0GaL7bDwaqmQe9r6JNetpn+zerAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777865; 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=YbKMbO/RjHDTBm6fcfhbYLyz8rGz0zFALp5jVq4WzgAAE18IeEg5GVzqGLPQbenW28Rn+Gmdqr/hYJTPy292KStfsLDcKHqDDZoJPoJPb0u+LhgCmFDdRYJb6KeiDSUscWkxXLhIvS1L3yA6adnyT0OsdPHzVP2+8yr/aWteaYA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777865420179.20038511402333; Thu, 19 Dec 2019 09:51:05 -0800 (PST) Received: from localhost ([::1]:45646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzx1-0002zW-Kh for importer@patchew.org; Thu, 19 Dec 2019 12:51:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47067) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYg-0007A8-Kr for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYd-00087D-CT for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:52 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42964 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 1ihzYb-00081F-DP for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:49 -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-59-dB3Gu43BNqKQhmDkos81Gw-1; Thu, 19 Dec 2019 12:25:40 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 15662107ACC5; Thu, 19 Dec 2019 17:25:39 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A61E620C0; Thu, 19 Dec 2019 17:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776343; 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=LPuSEXwEf0/5jCPKE4CR0qdfv9F+TF0k5kCjgacaWmJ65EV3KJyLzn+w1vw5x5HGBCZ2Rc MXkUQccvXuxvudBOv71sCg7DjMqKJWRASfGcI4qduMbETuuAQzPV6K3e7wzn3fnD1wDn7G D7AzQzOTquK/KeiZFA1XPszmM/gZILQ= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 27/30] iotests: 211: Remove duplication with VM.blockdev_create() Date: Thu, 19 Dec 2019 18:24:38 +0100 Message-Id: <20191219172441.7289-28-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: dB3Gu43BNqKQhmDkos81Gw-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.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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) 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 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777596; cv=none; d=zohomail.com; s=zohoarc; b=TRaFWyB1+1JG51pSl8L0055noHbvg72TuCzyyQB4E1MuGNv8z2zJpiIA6WWiZLdjoGqZ/fQbkx2rpS6c62EqntHvfKasKtczPw49ewZy0KPd86fnf5aMJ+aZXnPdDX5SxuZkaG77k+ei6F7rxyoXYHBzvWoAUAHMF2+ZbFXs8NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777596; 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=meKYZHvu6iLzH5cv3ecnPslSJkM31+5zXd/Sw8MPy/0=; b=oC3vTkMZuCqhyOeQ8R5U1TY43e8RHvkx4oc03q4pjnNJzDQX4niby1sYTJJuVIBYe7sBn4F0qWv2r6lLDq2z+TGP0jEOohGYG3VwjhcuHLKLQowmYWmQT+dNpQhcdrfRrdmIENbl6w+vWsJaGa0GeXnHgzFdMxGxXN/sOYDDVX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777596217520.7545810529509; Thu, 19 Dec 2019 09:46:36 -0800 (PST) Received: from localhost ([::1]:45572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzsh-0006e9-1G for importer@patchew.org; Thu, 19 Dec 2019 12:46:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47245) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYk-0007F0-Jh for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYi-0008C1-CA for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:58 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41189 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 1ihzYf-00082M-6I for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:54 -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-143-YhbXKbZ-NIeEYaWaK146Lg-1; Thu, 19 Dec 2019 12:25:42 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C77718B9F5C; Thu, 19 Dec 2019 17:25:41 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A49DC620C0; Thu, 19 Dec 2019 17:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776345; 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=meKYZHvu6iLzH5cv3ecnPslSJkM31+5zXd/Sw8MPy/0=; b=YRfLsud352GuUGuzogql/nM62M1VElCqAHtzXZ73QbiN2nBzdSC1JSpk/h+aY6Q9J5BceU T6bxvRrEeDvLozXkwTQsW9QVzGXX8iQEFSJwHWa5Xkw5h+nFia+TCCEgrGJigHDTm4+VD/ gNmuRCawbSWodayBJpKUdEeqRViMZIY= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 28/30] block: Activate recursively even for already active nodes Date: Thu, 19 Dec 2019 18:24:39 +0100 Message-Id: <20191219172441.7289-29-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: YhbXKbZ-NIeEYaWaK146Lg-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.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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" bdrv_invalidate_cache_all() assumes that all nodes in a given subtree are either active or inactive when it starts. Therefore, as soon as it arrives at an already active node, it stops. However, this assumption is wrong. For example, it's possible to take a snapshot of an inactive node, which results in an active overlay over an inactive backing file. The active overlay is probably also the root node of an inactive BlockBackend (blk->disable_perm =3D=3D true). In this case, bdrv_invalidate_cache_all() does not need to do anything to activate the overlay node, but it still needs to recurse into the children and the parents to make sure that after returning success, really everything is activated. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/block.c b/block.c index 73029fad64..1b6f7c86e8 100644 --- a/block.c +++ b/block.c @@ -5335,10 +5335,6 @@ static void coroutine_fn bdrv_co_invalidate_cache(Bl= ockDriverState *bs, return; } =20 - if (!(bs->open_flags & BDRV_O_INACTIVE)) { - return; - } - QLIST_FOREACH(child, &bs->children, next) { bdrv_co_invalidate_cache(child->bs, &local_err); if (local_err) { @@ -5360,34 +5356,36 @@ static void coroutine_fn bdrv_co_invalidate_cache(B= lockDriverState *bs, * just keep the extended permissions for the next time that an activa= tion * of the image is tried. */ - bs->open_flags &=3D ~BDRV_O_INACTIVE; - bdrv_get_cumulative_perm(bs, &perm, &shared_perm); - ret =3D bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, &loca= l_err); - if (ret < 0) { - bs->open_flags |=3D BDRV_O_INACTIVE; - error_propagate(errp, local_err); - return; - } - bdrv_set_perm(bs, perm, shared_perm); - - if (bs->drv->bdrv_co_invalidate_cache) { - bs->drv->bdrv_co_invalidate_cache(bs, &local_err); - if (local_err) { + if (bs->open_flags & BDRV_O_INACTIVE) { + bs->open_flags &=3D ~BDRV_O_INACTIVE; + bdrv_get_cumulative_perm(bs, &perm, &shared_perm); + ret =3D bdrv_check_perm(bs, NULL, perm, shared_perm, NULL, NULL, &= local_err); + if (ret < 0) { bs->open_flags |=3D BDRV_O_INACTIVE; error_propagate(errp, local_err); return; } - } + bdrv_set_perm(bs, perm, shared_perm); =20 - FOR_EACH_DIRTY_BITMAP(bs, bm) { - bdrv_dirty_bitmap_skip_store(bm, false); - } + if (bs->drv->bdrv_co_invalidate_cache) { + bs->drv->bdrv_co_invalidate_cache(bs, &local_err); + if (local_err) { + bs->open_flags |=3D BDRV_O_INACTIVE; + error_propagate(errp, local_err); + return; + } + } =20 - ret =3D refresh_total_sectors(bs, bs->total_sectors); - if (ret < 0) { - bs->open_flags |=3D BDRV_O_INACTIVE; - error_setg_errno(errp, -ret, "Could not refresh total sector count= "); - return; + FOR_EACH_DIRTY_BITMAP(bs, bm) { + bdrv_dirty_bitmap_skip_store(bm, false); + } + + ret =3D refresh_total_sectors(bs, bs->total_sectors); + if (ret < 0) { + bs->open_flags |=3D BDRV_O_INACTIVE; + error_setg_errno(errp, -ret, "Could not refresh total sector c= ount"); + return; + } } =20 QLIST_FOREACH(parent, &bs->parents, next_parent) { --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576777401; cv=none; d=zohomail.com; s=zohoarc; b=g5Xq/CH9ZzgWxCGUZdL2MElCPYlhUkQwRmLT90OeP77XM7OATRhyskxAejHNnvO6bCM70Y92EfRKiqw84EymNn+tfIsqJdTX+AYvlcJPX5yXChLH+Ez4039zNWSQ/UDQrdOTZx7mf743dJLBj3OVCqDc4AQPOWAj8srR2dDmYjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576777401; 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=rz8XplpVE9Nfga1S43gkcI04Wv87Es806T4s0FizFFk=; b=jsJsXICHnRkSEutS7yXCOzfEjsVNjLFKGChxeE38NHQu/fzJ4QI7Fu89kWYPY68pWaJhJmAJ9EnL9u8GnF9mA7LNGO69iUfkB8WRMODoQAOW2TdHWHYNTicP0XJGl2bmHTjydcsI8fxY3JKiwnkaBbDo/3zb0FmGc+0sQ5kNlcs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576777401241482.31658105167446; Thu, 19 Dec 2019 09:43:21 -0800 (PST) Received: from localhost ([::1]:45524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzpX-0002k5-Lq for importer@patchew.org; Thu, 19 Dec 2019 12:43:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47128) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYi-0007Bi-8M for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYe-00088g-Sl for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:54 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:27380 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 1ihzYd-000847-Af for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:51 -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-345-34k4uNdjPUiJdTIimAYxJA-1; Thu, 19 Dec 2019 12:25:44 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F40B107ACCA; Thu, 19 Dec 2019 17:25:43 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1E3A620C0; Thu, 19 Dec 2019 17:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776347; 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=rz8XplpVE9Nfga1S43gkcI04Wv87Es806T4s0FizFFk=; b=T8ReqE1YbNqd7Qq9v60xB35edIFqRz0lWEiWj6nnDpT37kN4AMsUyXLhSWiXG619KYmbuZ AKlpBPbVtfoP8tUONDaN+qLC4oPssu02lBViVE335L354bufJJxfMyWsJFYCkmutN18nGo M6r1KZEkJufSvMUzk9PFR6xbCuSMoPE= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 29/30] hmp: Allow using qdev ID for qemu-io command Date: Thu, 19 Dec 2019 18:24:40 +0100 Message-Id: <20191219172441.7289-30-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: 34k4uNdjPUiJdTIimAYxJA-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In order to issue requests on an existing BlockBackend with the 'qemu-io' HMP command, allow specifying the BlockBackend not only with a BlockBackend name, but also with a qdev ID/QOM path for a device that owns the (possibly anonymous) BlockBackend. Because qdev names could be conflicting with BlockBackend and node names, introduce a -d option to explicitly address a device. If the option is not given, a BlockBackend or a node is addressed. Signed-off-by: Kevin Wolf --- monitor/hmp-cmds.c | 28 ++++++++++++++++++---------- hmp-commands.hx | 8 +++++--- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index b2551c16d1..5f8941d298 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -2468,23 +2468,31 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict) { BlockBackend *blk; BlockBackend *local_blk =3D NULL; + bool qdev =3D qdict_get_try_bool(qdict, "qdev", false); const char* device =3D qdict_get_str(qdict, "device"); const char* command =3D qdict_get_str(qdict, "command"); Error *err =3D NULL; int ret; =20 - blk =3D blk_by_name(device); - if (!blk) { - BlockDriverState *bs =3D bdrv_lookup_bs(NULL, device, &err); - if (bs) { - blk =3D local_blk =3D blk_new(bdrv_get_aio_context(bs), - 0, BLK_PERM_ALL); - ret =3D blk_insert_bs(blk, bs, &err); - if (ret < 0) { + if (qdev) { + blk =3D blk_by_qdev_id(device, &err); + if (!blk) { + goto fail; + } + } else { + blk =3D blk_by_name(device); + if (!blk) { + BlockDriverState *bs =3D bdrv_lookup_bs(NULL, device, &err); + if (bs) { + blk =3D local_blk =3D blk_new(bdrv_get_aio_context(bs), + 0, BLK_PERM_ALL); + ret =3D blk_insert_bs(blk, bs, &err); + if (ret < 0) { + goto fail; + } + } else { goto fail; } - } else { - goto fail; } } =20 diff --git a/hmp-commands.hx b/hmp-commands.hx index cfcc044ce4..dc23185de4 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1875,9 +1875,11 @@ ETEXI =20 { .name =3D "qemu-io", - .args_type =3D "device:B,command:s", - .params =3D "[device] \"[command]\"", - .help =3D "run a qemu-io command on a block device", + .args_type =3D "qdev:-d,device:B,command:s", + .params =3D "[-d] [device] \"[command]\"", + .help =3D "run a qemu-io command on a block device\n\t\t\t" + "-d: [device] is a device ID rather than a " + "drive ID or node name", .cmd =3D hmp_qemu_io, }, =20 --=20 2.20.1 From nobody Sun May 5 06:33:32 2024 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=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576778266; cv=none; d=zohomail.com; s=zohoarc; b=OYh0t7z999NEFaVb7E/aw40u7IgBGltamKYuZ9et4p8sMCVJrp30JtACXHbHN4Cr9xUrbK2LE9mFUzJDpqpEt9NgUEymSyFTO2UP6sEjw4znhKUTRJsAbK89BziXnkXSgphWHLG6qO2b9riGse1+WDPqZoTuOY07rPqT0zvSc0Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576778266; 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=e3TfjD0fS7Mp3hQfmRnugCBI6yIIHc/ijdcZX5e1m5I=; b=VY4a+FU3OIBdxZJsPb0+3Gsx+Y8iFSP2pI8Je6+vc6mjhc2s1WTM+8Y5Cv5dgXKFwcF6ixpHCQz0ocCeDvzSoKb9tJu/SMNsRQFXxsuYUeVH5OdGfSAvsxcdqFy4fvjcHamIpQQaSBhyo1WvlYxaRYVBQ+Mv7EhqH9zsNg2rPtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576778266134315.1401939404185; Thu, 19 Dec 2019 09:57:46 -0800 (PST) Received: from localhost ([::1]:45808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii03U-00059N-Fq for importer@patchew.org; Thu, 19 Dec 2019 12:57:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47247) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihzYk-0007F1-Js for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihzYi-0008Bt-8P for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:58 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26915 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 1ihzYf-00087i-6b for qemu-devel@nongnu.org; Thu, 19 Dec 2019 12:25:54 -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-229-cS1cljoJO2-oHGtnnKg7Ww-1; Thu, 19 Dec 2019 12:25:46 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCEA41005502; Thu, 19 Dec 2019 17:25:44 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-53.ams2.redhat.com [10.36.117.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id E728A620C0; Thu, 19 Dec 2019 17:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576776352; 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=e3TfjD0fS7Mp3hQfmRnugCBI6yIIHc/ijdcZX5e1m5I=; b=gp7wR17OtCPDjtnz/+Ij79SLe4ci63R6vQ+0cQp6+9ktQGcLVFyWPgokxn6uZ/ntC+Gq/B dgC6KpqOCdzFprU9Rvt0uSvkYn7sHZ/rE0rv2BiULvfgGUPw9t3f78zs2YcjIQNApg0lh0 bUjadMS4WPhXPJgS91kG5R5Q61yaG4E= From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 30/30] iotests: Test external snapshot with VM state Date: Thu, 19 Dec 2019 18:24:41 +0100 Message-Id: <20191219172441.7289-31-kwolf@redhat.com> In-Reply-To: <20191219172441.7289-1-kwolf@redhat.com> References: <20191219172441.7289-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: cS1cljoJO2-oHGtnnKg7Ww-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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This tests creating an external snapshot with VM state (which results in an active overlay over an inactive backing file, which is also the root node of an inactive BlockBackend), re-activating the images and performing some operations to test that the re-activation worked as intended. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/280 | 83 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/280.out | 50 +++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 134 insertions(+) create mode 100755 tests/qemu-iotests/280 create mode 100644 tests/qemu-iotests/280.out diff --git a/tests/qemu-iotests/280 b/tests/qemu-iotests/280 new file mode 100755 index 0000000000..0b1fa8e1d8 --- /dev/null +++ b/tests/qemu-iotests/280 @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# +# 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 . +# +# Creator/Owner: Kevin Wolf +# +# Test migration to file for taking an external snapshot with VM state. + +import iotests +import os + +iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.verify_protocol(supported=3D['file']) +iotests.verify_platform(['linux']) + +with iotests.FilePath('base') as base_path , \ + iotests.FilePath('top') as top_path, \ + iotests.VM() as vm: + + iotests.qemu_img_log('create', '-f', iotests.imgfmt, base_path, '64M') + + iotests.log('=3D=3D=3D Launch VM =3D=3D=3D') + vm.add_object('iothread,id=3Diothread0') + vm.add_blockdev('file,filename=3D%s,node-name=3Dbase-file' % (base_pat= h)) + vm.add_blockdev('%s,file=3Dbase-file,node-name=3Dbase-fmt' % (iotests.= imgfmt)) + vm.add_device('virtio-blk,drive=3Dbase-fmt,iothread=3Diothread0,id=3Dv= da') + vm.launch() + + vm.enable_migration_events('VM') + + iotests.log('\n=3D=3D=3D Migrate to file =3D=3D=3D') + vm.qmp_log('migrate', uri=3D'exec:cat > /dev/null') + + with iotests.Timeout(3, 'Migration does not complete'): + vm.wait_migration() + + iotests.log('\nVM is now stopped:') + iotests.log(vm.qmp('query-migrate')['return']['status']) + vm.qmp_log('query-status') + + iotests.log('\n=3D=3D=3D Create a snapshot of the disk image =3D=3D=3D= ') + vm.blockdev_create({ + 'driver': 'file', + 'filename': top_path, + 'size': 0, + }) + vm.qmp_log('blockdev-add', node_name=3D'top-file', + driver=3D'file', filename=3Dtop_path, + filters=3D[iotests.filter_qmp_testfiles]) + + vm.blockdev_create({ + 'driver': iotests.imgfmt, + 'file': 'top-file', + 'size': 1024 * 1024, + }) + vm.qmp_log('blockdev-add', node_name=3D'top-fmt', + driver=3Diotests.imgfmt, file=3D'top-file') + + vm.qmp_log('blockdev-snapshot', node=3D'base-fmt', overlay=3D'top-fmt') + + iotests.log('\n=3D=3D=3D Resume the VM and simulate a write request = =3D=3D=3D') + vm.qmp_log('cont') + iotests.log(vm.hmp_qemu_io('-d vda/virtio-backend', 'write 4k 4k')) + + iotests.log('\n=3D=3D=3D Commit it to the backing file =3D=3D=3D') + result =3D vm.qmp_log('block-commit', job_id=3D'job0', auto_dismiss=3D= False, + device=3D'top-fmt', top_node=3D'top-fmt', + filters=3D[iotests.filter_qmp_testfiles]) + if 'return' in result: + vm.run_job('job0') diff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out new file mode 100644 index 0000000000..5d382faaa8 --- /dev/null +++ b/tests/qemu-iotests/280.out @@ -0,0 +1,50 @@ +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D67108864 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 + +=3D=3D=3D Launch VM =3D=3D=3D +Enabling migration QMP events on VM... +{"return": {}} + +=3D=3D=3D Migrate to file =3D=3D=3D +{"execute": "migrate", "arguments": {"uri": "exec:cat > /dev/null"}} +{"return": {}} +{"data": {"status": "setup"}, "event": "MIGRATION", "timestamp": {"microse= conds": "USECS", "seconds": "SECS"}} +{"data": {"status": "active"}, "event": "MIGRATION", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"mic= roseconds": "USECS", "seconds": "SECS"}} + +VM is now stopped: +completed +{"execute": "query-status", "arguments": {}} +{"return": {"running": false, "singlestep": false, "status": "postmigrate"= }} + +=3D=3D=3D Create a snapshot of the disk image =3D=3D=3D +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-top", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-top", "node-name": "top-file"}} +{"return": {}} +{"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "qcow2", "file": "top-file", "size": 1048576}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": "top-= file", "node-name": "top-fmt"}} +{"return": {}} +{"execute": "blockdev-snapshot", "arguments": {"node": "base-fmt", "overla= y": "top-fmt"}} +{"return": {}} + +=3D=3D=3D Resume the VM and simulate a write request =3D=3D=3D +{"execute": "cont", "arguments": {}} +{"return": {}} +{"return": ""} + +=3D=3D=3D Commit it to the backing file =3D=3D=3D +{"execute": "block-commit", "arguments": {"auto-dismiss": false, "device":= "top-fmt", "job-id": "job0", "top-node": "top-fmt"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "job0"}} +{"return": {}} +{"data": {"device": "job0", "len": 65536, "offset": 65536, "speed": 0, "ty= pe": "commit"}, "event": "BLOCK_JOB_READY", "timestamp": {"microseconds": "= USECS", "seconds": "SECS"}} +{"data": {"device": "job0", "len": 65536, "offset": 65536, "speed": 0, "ty= pe": "commit"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds= ": "USECS", "seconds": "SECS"}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index eb57ddc72c..cb2b789e44 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -287,3 +287,4 @@ 273 backing quick 277 rw quick 279 rw backing quick +280 rw migration quick --=20 2.20.1