From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578321863; cv=none; d=zohomail.com; s=zohoarc; b=eZNEE3nXHl9bLnA9jtqHSBawhBHMb06wUcS4inQfM3JFrqk9uOf908LBrtZSmJXkb4HTcHJrMg2Ki8Bi1n6at4KORqtL3D0t+zuqgE4JuDFqVeqC2uo/VqCGb9U1mId2kELbMkSPAQOqmHkIyF4os2Xze9s53dgc/pO/t0RQmlA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578321863; 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=KpkZy4bMp0pv9v7d08fb+rnzbShSFWmeOerHzoF1Hto=; b=Uajr64Ce8v5LBqNcJ55Gh+vWi8iK0ZkywbARamL1URrn686Pvkck0xE1y6AL7s77+zY4fQGxxbHllW7CjX2/3r8WRjgh75GE6hV0iGLA0iyH4Wx67+SY1WBf5KMktjygIB8WvQXuGTdl3TtNp/fiKWiLQ5tNKJp+rvVJ2/WdkJA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578321863620985.6075970908474; Mon, 6 Jan 2020 06:44:23 -0800 (PST) Received: from localhost ([::1]:52756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTcD-0007ZU-NS for importer@patchew.org; Mon, 06 Jan 2020 09:44:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43042) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTaI-0005Bp-KC for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTaH-0008CT-Go for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:22 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:36352 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 1ioTaH-0008C9-D2 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:21 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-tJMUHBTTNDKgBI5JFARPDA-1; Mon, 06 Jan 2020 09:42:19 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3AF52800D48; Mon, 6 Jan 2020 14:42:18 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7C01610B0; Mon, 6 Jan 2020 14:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321740; 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=KpkZy4bMp0pv9v7d08fb+rnzbShSFWmeOerHzoF1Hto=; b=Br6P+pWW9AuF1LA63E6ohzrFmHqd5FT9xVyLp3sgsnsIQXRDMkUJmaRompGQzq4mkAztFx 4jm9BVcQIOiMKQUV5WknW90DGJzngED5iCqIDe1h4JhdLFzIxlruy1mp7hBK0hQkvTa1Uo 7BnV374l/ijG82H6EwioVeZyjoZ6F4k= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 01/34] block: Add bdrv_qapi_perm_to_blk_perm() Date: Mon, 6 Jan 2020 15:41:33 +0100 Message-Id: <20200106144206.698920-2-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: tJMUHBTTNDKgBI5JFARPDA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We need some way to correlate QAPI BlockPermission values with BLK_PERM_* flags. We could: (1) have the same order in the QAPI definition as the the BLK_PERM_* flags are in LSb-first order. However, then there is no guarantee that they actually match (e.g. when someone modifies the QAPI schema without thinking of the BLK_PERM_* definitions). We could add static assertions, but these would break what=E2=80=99s go= od about this solution, namely its simplicity. (2) define the BLK_PERM_* flags based on the BlockPermission values. But this way whenever someone were to modify the QAPI order (perfectly sensible in theory), the BLK_PERM_* values would change. Because these values are used for file locking, this might break file locking between different qemu versions. Therefore, go the slightly more cumbersome way: Add a function to translate from the QAPI constants to the BLK_PERM_* flags. Signed-off-by: Max Reitz Message-id: 20191108123455.39445-2-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- block.c | 18 ++++++++++++++++++ include/block/block.h | 1 + 2 files changed, 19 insertions(+) diff --git a/block.c b/block.c index 1b6f7c86e8..28eb5a774c 100644 --- a/block.c +++ b/block.c @@ -2227,6 +2227,24 @@ void bdrv_format_default_perms(BlockDriverState *bs,= BdrvChild *c, *nshared =3D shared; } =20 +uint64_t bdrv_qapi_perm_to_blk_perm(BlockPermission qapi_perm) +{ + static const uint64_t permissions[] =3D { + [BLOCK_PERMISSION_CONSISTENT_READ] =3D BLK_PERM_CONSISTENT_READ, + [BLOCK_PERMISSION_WRITE] =3D BLK_PERM_WRITE, + [BLOCK_PERMISSION_WRITE_UNCHANGED] =3D BLK_PERM_WRITE_UNCHANGED, + [BLOCK_PERMISSION_RESIZE] =3D BLK_PERM_RESIZE, + [BLOCK_PERMISSION_GRAPH_MOD] =3D BLK_PERM_GRAPH_MOD, + }; + + QEMU_BUILD_BUG_ON(ARRAY_SIZE(permissions) !=3D BLOCK_PERMISSION__MAX); + QEMU_BUILD_BUG_ON(1UL << ARRAY_SIZE(permissions) !=3D BLK_PERM_ALL + 1= ); + + assert(qapi_perm < BLOCK_PERMISSION__MAX); + + return permissions[qapi_perm]; +} + static void bdrv_replace_child_noperm(BdrvChild *child, BlockDriverState *new_bs) { diff --git a/include/block/block.h b/include/block/block.h index 1df9848e74..e9dcfef7fa 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -280,6 +280,7 @@ enum { }; =20 char *bdrv_perm_names(uint64_t perm); +uint64_t bdrv_qapi_perm_to_blk_perm(BlockPermission qapi_perm); =20 /* disk I/O throttling */ void bdrv_init(void); --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322062; cv=none; d=zohomail.com; s=zohoarc; b=MabHVmuQxo/AlqNoF8C6Jbv+nXEiiaeheXCMCQCmuX40w5xXvMjvb0XwjtxTv/r1CQympvyiAVjiqAmWpV/ey7hStLqSUameYWvZdNuCaneSX+rxeY6JHlg0DQFtwSSlKG2bcT95nDH48w4g6JMLqP2riwyLjW4PDDMq2+at0eE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322062; 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=adnSmFW2MO3ldu51Knve6ZtHfLKEhg60Av+XXSsaHaY=; b=dHz3ObZTwOV/L/JhAV9g6q9bg7c/3gQM0lTcTABm06RWyWGcNhrhyr0+BXdOqd6Ux8nTax/iNp62Em63yfPOR5kIXA+NDL3GUWAZ2/5XvEdyWKlKL3r1FKePx1UbsouZz1zGZGmMf4NvvZ5Zzt0/i3Gpcg82wI9Ue6Q4jYUiX0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322062978850.032905446358; Mon, 6 Jan 2020 06:47:42 -0800 (PST) Received: from localhost ([::1]:52846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTfQ-000307-Le for importer@patchew.org; Mon, 06 Jan 2020 09:47:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTaP-0005Qt-5t for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTaO-0008IA-1f for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:29 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:34489 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 1ioTaN-0008I3-UA for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42: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-382-sHAKtn6aP_2XPH3llQdp4A-1; Mon, 06 Jan 2020 09:42:24 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16505800D41; Mon, 6 Jan 2020 14:42:23 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 18298100164D; Mon, 6 Jan 2020 14:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321747; 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=adnSmFW2MO3ldu51Knve6ZtHfLKEhg60Av+XXSsaHaY=; b=Meo5jsZW4/dI4jjXm72gtJP+SYfoYwJCgogP5iD3zOyuXRk8M9PJvA5fayO8hxab/jVgMZ Ce0bH51gkPOOw1nlaQxZrhvPat89DkYwrX2uJ/gjEqIcrreLta8/ccYCEE+w4nXm5dSK12 /pGSjyeZeEqP5DH3DrxqjbqSP3YWQNg= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 02/34] block: Use bdrv_qapi_perm_to_blk_perm() Date: Mon, 6 Jan 2020 15:41:34 +0100 Message-Id: <20200106144206.698920-3-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: sHAKtn6aP_2XPH3llQdp4A-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We can save some LoC in xdbg_graph_add_edge() by using bdrv_qapi_perm_to_blk_perm(). Signed-off-by: Max Reitz Message-id: 20191108123455.39445-3-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- block.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/block.c b/block.c index 28eb5a774c..ecd09dbbfd 100644 --- a/block.c +++ b/block.c @@ -4872,36 +4872,23 @@ static void xdbg_graph_add_node(XDbgBlockGraphConst= ructor *gr, void *node, static void xdbg_graph_add_edge(XDbgBlockGraphConstructor *gr, void *paren= t, const BdrvChild *child) { - typedef struct { - unsigned int flag; - BlockPermission num; - } PermissionMap; - - static const PermissionMap permissions[] =3D { - { BLK_PERM_CONSISTENT_READ, BLOCK_PERMISSION_CONSISTENT_READ }, - { BLK_PERM_WRITE, BLOCK_PERMISSION_WRITE }, - { BLK_PERM_WRITE_UNCHANGED, BLOCK_PERMISSION_WRITE_UNCHANGED }, - { BLK_PERM_RESIZE, BLOCK_PERMISSION_RESIZE }, - { BLK_PERM_GRAPH_MOD, BLOCK_PERMISSION_GRAPH_MOD }, - { 0, 0 } - }; - const PermissionMap *p; + BlockPermission qapi_perm; XDbgBlockGraphEdge *edge; =20 - QEMU_BUILD_BUG_ON(1UL << (ARRAY_SIZE(permissions) - 1) !=3D BLK_PERM_A= LL + 1); - edge =3D g_new0(XDbgBlockGraphEdge, 1); =20 edge->parent =3D xdbg_graph_node_num(gr, parent); edge->child =3D xdbg_graph_node_num(gr, child->bs); edge->name =3D g_strdup(child->name); =20 - for (p =3D permissions; p->flag; p++) { - if (p->flag & child->perm) { - QAPI_LIST_ADD(edge->perm, p->num); + for (qapi_perm =3D 0; qapi_perm < BLOCK_PERMISSION__MAX; qapi_perm++) { + uint64_t flag =3D bdrv_qapi_perm_to_blk_perm(qapi_perm); + + if (flag & child->perm) { + QAPI_LIST_ADD(edge->perm, qapi_perm); } - if (p->flag & child->shared_perm) { - QAPI_LIST_ADD(edge->shared_perm, p->num); + if (flag & child->shared_perm) { + QAPI_LIST_ADD(edge->shared_perm, qapi_perm); } } =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322270; cv=none; d=zohomail.com; s=zohoarc; b=kSMnLCzBmXROwaa1BUHHzgmAgWSz1yqGscL0XqraOc0w/HrdeczYtc3m1wrYFbDZ+BJB+HQxIgV+ecg0saAmjBslQk+waH6rONb3UUh1BIWUV9NPE0ZYsbcY0ZA/oiXhRGodGiIAHhpDLWqyZ6y1UA/q3r6ynWpeJsl24oF/ps0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322270; 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=p9tpAQdINwsC2qxcq9bQXk8UJ95ABgg+qf/HxpPai1I=; b=bqZxmxE/WAXSgJ59fLmFt0fmjuUJEgHHgDvo6JAi0CAcOIRBGF8UtKtTykzaouq17ABNAsIHdXKNiKzdieLZQ/ULO7TrvQxGWS599ya2LJGiA4SEUaJOuOU4ZYDSYReuIlCJIul3dJZVzzrrEy1koHV/+HKN1E7osiIVMIOAWn0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322270412907.4619369469567; Mon, 6 Jan 2020 06:51:10 -0800 (PST) Received: from localhost ([::1]:52900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTim-0006pN-OU for importer@patchew.org; Mon, 06 Jan 2020 09:51:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43174) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTaT-0005Yx-5y for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTaR-0008Kk-Il for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:32 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52919 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 1ioTaR-0008Jv-Eb for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:31 -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-yN6O0pjCPbWvhexxuZVeTw-1; Mon, 06 Jan 2020 09:42:27 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53ED61083E88; Mon, 6 Jan 2020 14:42:26 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B698E7C00A; Mon, 6 Jan 2020 14:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321751; 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=p9tpAQdINwsC2qxcq9bQXk8UJ95ABgg+qf/HxpPai1I=; b=alG9N8e9skJAMuWTfedGPZy43mc4zq/EubbyaerVPk3A2nVl0/4exc7EafYv8X3X7v/dE2 dDBnB11dTdSn127KrcU8ihYoNYiBkwtTLc8YbSWnJnMp0q94he5RMON6ZXGLk/td2ZNTFw E5ACl0fOrWiJFQEkmxLWt0TqJl/oD3Q= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 03/34] blkdebug: Allow taking/unsharing permissions Date: Mon, 6 Jan 2020 15:41:35 +0100 Message-Id: <20200106144206.698920-4-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: yN6O0pjCPbWvhexxuZVeTw-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Sometimes it is useful to be able to add a node to the block graph that takes or unshare a certain set of permissions for debugging purposes. This patch adds this capability to blkdebug. (Note that you cannot make blkdebug release or share permissions that it needs to take or cannot share, because this might result in assertion failures in the block layer. But if the blkdebug node has no parents, it will not take any permissions and share everything by default, so you can then freely choose what permissions to take and share.) Signed-off-by: Max Reitz Message-id: 20191108123455.39445-4-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- block/blkdebug.c | 93 +++++++++++++++++++++++++++++++++++++++++++- qapi/block-core.json | 14 ++++++- 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 5ae96c52b0..af44aa973f 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -28,10 +28,14 @@ #include "qemu/cutils.h" #include "qemu/config-file.h" #include "block/block_int.h" +#include "block/qdict.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qapi/qapi-visit-block-core.h" #include "qapi/qmp/qdict.h" +#include "qapi/qmp/qlist.h" #include "qapi/qmp/qstring.h" +#include "qapi/qobject-input-visitor.h" #include "sysemu/qtest.h" =20 typedef struct BDRVBlkdebugState { @@ -44,6 +48,9 @@ typedef struct BDRVBlkdebugState { uint64_t opt_discard; uint64_t max_discard; =20 + uint64_t take_child_perms; + uint64_t unshare_child_perms; + /* For blkdebug_refresh_filename() */ char *config_file; =20 @@ -344,6 +351,69 @@ static void blkdebug_parse_filename(const char *filena= me, QDict *options, qdict_put_str(options, "x-image", filename); } =20 +static int blkdebug_parse_perm_list(uint64_t *dest, QDict *options, + const char *prefix, Error **errp) +{ + int ret =3D 0; + QDict *subqdict =3D NULL; + QObject *crumpled_subqdict =3D NULL; + Visitor *v =3D NULL; + BlockPermissionList *perm_list =3D NULL, *element; + Error *local_err =3D NULL; + + *dest =3D 0; + + qdict_extract_subqdict(options, &subqdict, prefix); + if (!qdict_size(subqdict)) { + goto out; + } + + crumpled_subqdict =3D qdict_crumple(subqdict, errp); + if (!crumpled_subqdict) { + ret =3D -EINVAL; + goto out; + } + + v =3D qobject_input_visitor_new(crumpled_subqdict); + visit_type_BlockPermissionList(v, NULL, &perm_list, &local_err); + if (local_err) { + error_propagate(errp, local_err); + ret =3D -EINVAL; + goto out; + } + + for (element =3D perm_list; element; element =3D element->next) { + *dest |=3D bdrv_qapi_perm_to_blk_perm(element->value); + } + +out: + qapi_free_BlockPermissionList(perm_list); + visit_free(v); + qobject_unref(subqdict); + qobject_unref(crumpled_subqdict); + return ret; +} + +static int blkdebug_parse_perms(BDRVBlkdebugState *s, QDict *options, + Error **errp) +{ + int ret; + + ret =3D blkdebug_parse_perm_list(&s->take_child_perms, options, + "take-child-perms.", errp); + if (ret < 0) { + return ret; + } + + ret =3D blkdebug_parse_perm_list(&s->unshare_child_perms, options, + "unshare-child-perms.", errp); + if (ret < 0) { + return ret; + } + + return 0; +} + static QemuOptsList runtime_opts =3D { .name =3D "blkdebug", .head =3D QTAILQ_HEAD_INITIALIZER(runtime_opts.head), @@ -419,6 +489,12 @@ static int blkdebug_open(BlockDriverState *bs, QDict *= options, int flags, /* Set initial state */ s->state =3D 1; =20 + /* Parse permissions modifiers before opening the image file */ + ret =3D blkdebug_parse_perms(s, options, errp); + if (ret < 0) { + goto out; + } + /* Open the image file */ bs->file =3D bdrv_open_child(qemu_opt_get(opts, "x-image"), options, "= image", bs, &child_file, false, &local_err); @@ -916,6 +992,21 @@ static int blkdebug_reopen_prepare(BDRVReopenState *re= open_state, return 0; } =20 +static void blkdebug_child_perm(BlockDriverState *bs, BdrvChild *c, + const BdrvChildRole *role, + BlockReopenQueue *reopen_queue, + uint64_t perm, uint64_t shared, + uint64_t *nperm, uint64_t *nshared) +{ + BDRVBlkdebugState *s =3D bs->opaque; + + bdrv_filter_default_perms(bs, c, role, reopen_queue, perm, shared, + nperm, nshared); + + *nperm |=3D s->take_child_perms; + *nshared &=3D ~s->unshare_child_perms; +} + static const char *const blkdebug_strong_runtime_opts[] =3D { "config", "inject-error.", @@ -940,7 +1031,7 @@ static BlockDriver bdrv_blkdebug =3D { .bdrv_file_open =3D blkdebug_open, .bdrv_close =3D blkdebug_close, .bdrv_reopen_prepare =3D blkdebug_reopen_prepare, - .bdrv_child_perm =3D bdrv_filter_default_perms, + .bdrv_child_perm =3D blkdebug_child_perm, =20 .bdrv_getlength =3D blkdebug_getlength, .bdrv_refresh_filename =3D blkdebug_refresh_filename, diff --git a/qapi/block-core.json b/qapi/block-core.json index fcb52ec24f..839b10b3f0 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3454,6 +3454,16 @@ # # @set-state: array of state-change descriptions # +# @take-child-perms: Permissions to take on @image in addition to what +# is necessary anyway (which depends on how the +# blkdebug node is used). Defaults to none. +# (since 5.0) +# +# @unshare-child-perms: Permissions not to share on @image in addition +# to what cannot be shared anyway (which depends +# on how the blkdebug node is used). Defaults +# to none. (since 5.0) +# # Since: 2.9 ## { 'struct': 'BlockdevOptionsBlkdebug', @@ -3463,7 +3473,9 @@ '*opt-write-zero': 'int32', '*max-write-zero': 'int32', '*opt-discard': 'int32', '*max-discard': 'int32', '*inject-error': ['BlkdebugInjectErrorOptions'], - '*set-state': ['BlkdebugSetStateOptions'] } } + '*set-state': ['BlkdebugSetStateOptions'], + '*take-child-perms': ['BlockPermission'], + '*unshare-child-perms': ['BlockPermission'] } } =20 ## # @BlockdevOptionsBlklogwrites: --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322070; cv=none; d=zohomail.com; s=zohoarc; b=X/fNGwO0uXaYGn42nD02jd/2rm+HSTYTeuZLPby4Z42LARo/SaIi5Ore6d3ngAPGMSKmCAbVELQya2Cv/ZcPhOS0+X/AXXoLT6HBtlNf7p021a2jToY95Oc0jyEDWQggE05VoOr7o8X8B17BtB+cg7SoAVcgvBwM84558SyMwQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322070; 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=fGUsSHviFiMFZM+Ex3/VmZDtOXy0QymT91TaVIBYx3o=; b=Vuc8xlhE6SB1/aAAU3oY6EgcNtItrh+Yo/cYHZP0PHd/pArrp32c3uPLsPlsqdW8ar4fbMvhhviSPFuvRAmWuikGLE6oKO1SfqUX1YLVryNAAMT1SmEq44tJPe301l4wio4ByEY6g8gMgYGrl1CmLNCojkclNPyN2Zf7o8rS5P8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322070766931.8137851837209; Mon, 6 Jan 2020 06:47:50 -0800 (PST) Received: from localhost ([::1]:52852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTfY-0003EQ-RS for importer@patchew.org; Mon, 06 Jan 2020 09:47:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTaX-0005jT-8Q for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTaW-0008Nh-5J for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:37 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26222 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 1ioTaW-0008NF-2Q for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:36 -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-351-bOjreZorPmm5FGVBFUjPXw-1; Mon, 06 Jan 2020 09:42:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5A0A108C317; Mon, 6 Jan 2020 14:42:30 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81A2B60F89; Mon, 6 Jan 2020 14:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321755; 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=fGUsSHviFiMFZM+Ex3/VmZDtOXy0QymT91TaVIBYx3o=; b=Mz00BfDZeQbtXC1MFtDvpwoSGMBUkxdw1smFwiBA2peseYx16tMdywPlH+U6ClhZHCAxcH h7w8Ww5rcljCjbtzhRlBknxlQ6Bh1kpyIjYf4GP89wSiK5Y749FWWBv5w4bi+XEOPkbDU1 s6GsrmAkCNf9+S9NNaaIjTm2BhSgEww= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 04/34] iotests: Add @error to wait_until_completed Date: Mon, 6 Jan 2020 15:41:36 +0100 Message-Id: <20200106144206.698920-5-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: bOjreZorPmm5FGVBFUjPXw-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Callers can use this new parameter to expect failure during the completion process. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20191108123455.39445-5-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/iotests.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 8739ec6613..13fd8b5cd2 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -811,15 +811,20 @@ class QMPTestCase(unittest.TestCase): self.assert_no_active_block_jobs() return result =20 - def wait_until_completed(self, drive=3D'drive0', check_offset=3DTrue, = wait=3D60.0): + def wait_until_completed(self, drive=3D'drive0', check_offset=3DTrue, = wait=3D60.0, + error=3DNone): '''Wait for a block job to finish, returning the event''' while True: for event in self.vm.get_qmp_events(wait=3Dwait): if event['event'] =3D=3D 'BLOCK_JOB_COMPLETED': self.assert_qmp(event, 'data/device', drive) - self.assert_qmp_absent(event, 'data/error') - if check_offset: - self.assert_qmp(event, 'data/offset', event['data'= ]['len']) + if error is None: + self.assert_qmp_absent(event, 'data/error') + if check_offset: + self.assert_qmp(event, 'data/offset', + event['data']['len']) + else: + self.assert_qmp(event, 'data/error', error) self.assert_no_active_block_jobs() return event elif event['event'] =3D=3D 'JOB_STATUS_CHANGE': @@ -837,7 +842,8 @@ class QMPTestCase(unittest.TestCase): self.assert_qmp(event, 'data/type', 'mirror') self.assert_qmp(event, 'data/offset', event['data']['len']) =20 - def complete_and_wait(self, drive=3D'drive0', wait_ready=3DTrue): + def complete_and_wait(self, drive=3D'drive0', wait_ready=3DTrue, + completion_error=3DNone): '''Complete a block job and wait for it to finish''' if wait_ready: self.wait_ready(drive=3Ddrive) @@ -845,7 +851,7 @@ class QMPTestCase(unittest.TestCase): result =3D self.vm.qmp('block-job-complete', device=3Ddrive) self.assert_qmp(result, 'return', {}) =20 - event =3D self.wait_until_completed(drive=3Ddrive) + event =3D self.wait_until_completed(drive=3Ddrive, error=3Dcomplet= ion_error) self.assert_qmp(event, 'data/type', 'mirror') =20 def pause_wait(self, job_id=3D'job0'): --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322406; cv=none; d=zohomail.com; s=zohoarc; b=lY23X6vj2esp0jENpSv0GjUi4jU2AdVGYYHStz9qnd857EbUHVy0Pj6B6ZzrUXRF/CTNNVspj4TSww0gjpP84fEv7dGESlEg9uXg3zdxhstMcpVUWhs/yUoyYxotCRi3PQJJetDbSymKf82rfrmWkBIyP6EZ+xJ4SZJXyGykJ7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322406; 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=QSBQdOnL72EHKVqrlm6ZtVcGCAI/LeO2wRMWAF3DQec=; b=oKouOwZTcHScys8d9JXzn8vI/tUcXeQbnOFCT33DniXfYL3Au/09SkpCVdTr/ooYfDq0Ypc9Bw9/TyKvfhAM2wkEcc+icON+iqjAtNEk5Gu27rpTOReeDPOR0l+GvtqOAwSUZ3yNgsxMEy4JirOtX5fn0S/Cl/BducuCShwjG3w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322406901518.8062065960751; Mon, 6 Jan 2020 06:53:26 -0800 (PST) Received: from localhost ([::1]:52932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTkz-0001wD-7e for importer@patchew.org; Mon, 06 Jan 2020 09:53:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43286) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTab-0005td-Uv for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTaa-0008QP-O6 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:41 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34670 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 1ioTaa-0008Pv-Ko for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:40 -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-ydecRgtTPmirzHBA_0eAGw-1; Mon, 06 Jan 2020 09:42:36 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 90BEF107AD3E; Mon, 6 Jan 2020 14:42:35 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 179B510840F1; Mon, 6 Jan 2020 14:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321760; 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=QSBQdOnL72EHKVqrlm6ZtVcGCAI/LeO2wRMWAF3DQec=; b=WDsU6oZoYH1DeN2301/fbrBT362XvPKnv3dMQcmHCcGtXVDvkaf8x+fq5rLejL1k/EET93 de/lvkna/KXQyS8ke4bRuQtCKAXuex3TF4/Nj4oSccB6fDXUah/eWr9XbHFVWW8Kn87dSG YKlPNYGIHA+mVB2X1cNDZas3U6zWIMA= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 05/34] iotests: Add test for failing mirror complete Date: Mon, 6 Jan 2020 15:41:37 +0100 Message-Id: <20200106144206.698920-6-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: ydecRgtTPmirzHBA_0eAGw-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20191108123455.39445-6-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/041 | 44 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/041.out | 4 ++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 8568426311..d7be30b62b 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -1121,6 +1121,50 @@ class TestOrphanedSource(iotests.QMPTestCase): target=3D'dest-ro') self.assert_qmp(result, 'error/class', 'GenericError') =20 + def test_failing_permission_in_complete(self): + self.assert_no_active_block_jobs() + + # Unshare consistent-read on the target + # (The mirror job does not care) + result =3D self.vm.qmp('blockdev-add', + driver=3D'blkdebug', + node_name=3D'dest-perm', + image=3D'dest', + unshare_child_perms=3D['consistent-read']) + self.assert_qmp(result, 'return', {}) + + result =3D self.vm.qmp('blockdev-mirror', job_id=3D'job', device= =3D'src', + sync=3D'full', target=3D'dest', + filter_node_name=3D'mirror-filter') + self.assert_qmp(result, 'return', {}) + + # Require consistent-read on the source + # (We can only add this node once the job has started, or it + # will complain that it does not want to run on non-root nodes) + result =3D self.vm.qmp('blockdev-add', + driver=3D'blkdebug', + node_name=3D'src-perm', + image=3D'src', + take_child_perms=3D['consistent-read']) + self.assert_qmp(result, 'return', {}) + + # While completing, mirror will attempt to replace src by + # dest, which must fail because src-perm requires + # consistent-read but dest-perm does not share it; thus + # aborting the job when it is supposed to complete + self.complete_and_wait('job', + completion_error=3D'Operation not permitted= ') + + # Assert that all of our nodes are still there (except for the + # mirror filter, which should be gone despite the failure) + nodes =3D self.vm.qmp('query-named-block-nodes')['return'] + nodes =3D [node['node-name'] for node in nodes] + + for expect in ('src', 'src-perm', 'dest', 'dest-perm'): + self.assertTrue(expect in nodes, '%s disappeared' % expect) + self.assertFalse('mirror-filter' in nodes, + 'Mirror filter node did not disappear') + if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2', 'qed'], supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out index 2c448b4239..f496be9197 100644 --- a/tests/qemu-iotests/041.out +++ b/tests/qemu-iotests/041.out @@ -1,5 +1,5 @@ -..........................................................................= ................ +..........................................................................= ................. ---------------------------------------------------------------------- -Ran 90 tests +Ran 91 tests =20 OK --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322275; cv=none; d=zohomail.com; s=zohoarc; b=J4Wx0jXBImycIUyDfW2OZR7Sf8vqdkiL/QXl3WXr7eoHcREoXQU42P8Nz3oKbbUkQH8/mAPRicquFMTy6T5ykKczfY78LNxSf+13KrMMAVTmGR0jIxAcLD5IrVtJLQ0KY/mEIUjA+bXqSMZyLCpKw33DRiRCjzP1trC8ldOEwA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322275; 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=HcR8kdZVNr6+Xmm97ZoQXx/mtvvqp3phSsQ3QlqYEE8=; b=EoQaVmSA4M5waIwTWkVieEMBu7dbQr3JmoeV+30q6R8pDcseKdj+k9A3cy2EGdlsRh9e6iJ+/D1Dql+9fkgYigcTx45hNYQGIf+BBxoNk5anGudQH3mPsITjrrJV93FJpivx+vmLVaP1CfYcmg5P2a+MoJ5cCJbrwVAFY9Zpg80= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322275558540.1315055080893; Mon, 6 Jan 2020 06:51:15 -0800 (PST) Received: from localhost ([::1]:52906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTis-0006zP-4E for importer@patchew.org; Mon, 06 Jan 2020 09:51:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43313) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTae-0005vi-LQ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTad-0008SJ-HR for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:44 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39227 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 1ioTad-0008Rg-E3 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:43 -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-18-PGKEBlKJPtyFb-0gutoewA-1; Mon, 06 Jan 2020 09:42:39 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 281C585B6FE; Mon, 6 Jan 2020 14:42:38 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8499B29342; Mon, 6 Jan 2020 14:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321762; 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=HcR8kdZVNr6+Xmm97ZoQXx/mtvvqp3phSsQ3QlqYEE8=; b=GPcKP9VmlVcBzcV++eCEoeQLfTtM4BorLGlqciRF/vzEtlsPEBdTQ8yf00YWU1JPVt2Yal 2uvCMw7Fz85UUHGsCpMWeZPTe0H/JYczJnWsoUprNJ6SThEh1kozxZYmnHaE00qR9pVlLM iKadDg4QTLkcyV1bFBja5W6u3wC9OO4= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 06/34] throttle-groups: fix memory leak in throttle_group_set_limit: Date: Mon, 6 Jan 2020 15:41:38 +0100 Message-Id: <20200106144206.698920-7-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: PGKEBlKJPtyFb-0gutoewA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: PanNengyuan This avoid a memory leak when qom-set is called to set throttle_group limits, here is an easy way to reproduce: 1. run qemu-iotests as follow and check the result with asan: ./check -qcow2 184 Following is the asan output backtrack: Direct leak of 912 byte(s) in 3 object(s) allocated from: #0 0xffff8d7ab3c3 in __interceptor_calloc (/lib64/libasan.so.4+0xd33c= 3) #1 0xffff8d4c31cb in g_malloc0 (/lib64/libglib-2.0.so.0+0x571cb) #2 0x190c857 in qobject_input_start_struct /mnt/sdc/qemu-master/qemu-4= .2.0-rc0/qapi/qobject-input-visitor.c:295 #3 0x19070df in visit_start_struct /mnt/sdc/qemu-master/qemu-4.2.0-rc= 0/qapi/qapi-visit-core.c:49 #4 0x1948b87 in visit_type_ThrottleLimits qapi/qapi-visit-block-core.= c:3759 #5 0x17e4aa3 in throttle_group_set_limits /mnt/sdc/qemu-master/qemu-4= .2.0-rc0/block/throttle-groups.c:900 #6 0x1650eff in object_property_set /mnt/sdc/qemu-master/qemu-4.2.0= -rc0/qom/object.c:1272 #7 0x1658517 in object_property_set_qobject /mnt/sdc/qemu-master/qemu= -4.2.0-rc0/qom/qom-qobject.c:26 #8 0x15880bb in qmp_qom_set /mnt/sdc/qemu-master/qemu-4.2.0-rc0/qom/qo= m-qmp-cmds.c:74 #9 0x157e3e3 in qmp_marshal_qom_set qapi/qapi-commands-qom.c:154 Reported-by: Euler Robot Signed-off-by: PanNengyuan Message-id: 1574835614-42028-1-git-send-email-pannengyuan@huawei.com Signed-off-by: Max Reitz --- block/throttle-groups.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/throttle-groups.c b/block/throttle-groups.c index 77014c741b..37695b0cd7 100644 --- a/block/throttle-groups.c +++ b/block/throttle-groups.c @@ -893,8 +893,7 @@ static void throttle_group_set_limits(Object *obj, Visi= tor *v, { ThrottleGroup *tg =3D THROTTLE_GROUP(obj); ThrottleConfig cfg; - ThrottleLimits arg =3D { 0 }; - ThrottleLimits *argp =3D &arg; + ThrottleLimits *argp; Error *local_err =3D NULL; =20 visit_type_ThrottleLimits(v, name, &argp, &local_err); @@ -912,6 +911,7 @@ static void throttle_group_set_limits(Object *obj, Visi= tor *v, unlock: qemu_mutex_unlock(&tg->lock); ret: + qapi_free_ThrottleLimits(argp); error_propagate(errp, local_err); return; } --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322548; cv=none; d=zohomail.com; s=zohoarc; b=ThK62w7O/zgxlSRiSTJMLrv3lt8NamqB7ojExmoXa7RNLKRf3IAz/14dVJw2b5Reo1OcTPCCfnSJSXxsqF3hdVy5VeIU9/0JuWOIbIqm8YelfbzS3PVUzpjwAqU5E6S8aNDbptqdf62M+Ycg3Gr50k2leOwLai+MD51KW/LzRsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322548; 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=/IpDbiZG05sAUScSJC7wQs3uaDUS0rYw+sdrCP2plhw=; b=VXNT2G9JvjSWtjdGllgTBvqvevqdjh0CSPrRLm++dGUZ4jCuJnsgRmJvvX3GvmcuSlVxp2xdi9ppCnQFUbw0NN8ZLpQD+UnCNL7feCPI6rAa9c/18BewvTNipLh8lLhEIlU6yMftGn0Et9Ep3vnmC63uDHKuy0B3Hr8V/gMoNio= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322548955144.72929350044774; Mon, 6 Jan 2020 06:55:48 -0800 (PST) Received: from localhost ([::1]:52968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTnH-0006Ag-3U for importer@patchew.org; Mon, 06 Jan 2020 09:55:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43342) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTah-0005xR-FN for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTag-0008Tu-6L for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:47 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:45908 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 1ioTag-0008TG-3K for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:46 -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-NxrSOsEvPMSB68lbvd4D7w-1; Mon, 06 Jan 2020 09:42:41 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5F14A9D740; Mon, 6 Jan 2020 14:42:40 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39F4F271B4; Mon, 6 Jan 2020 14:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321765; 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=/IpDbiZG05sAUScSJC7wQs3uaDUS0rYw+sdrCP2plhw=; b=MgFOQNPd6VMnzPrOgIkGA4SLFSb45eUyylDSNKZDZv74/3Pctgw28th63fc6DEIGbjMxoJ IVLE6SThBeAQec/NEWY9ZQWCsE10rKuXk2wEqZCRLHhBVqHf5yJofhuUKmhnaOpPqdfb7y p/+2wrL5F98Fag0fsNzBj1nzu6CRG1Y= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 07/34] qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap Date: Mon, 6 Jan 2020 15:41:39 +0100 Message-Id: <20200106144206.698920-8-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: NxrSOsEvPMSB68lbvd4D7w-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy qcow2_can_store_new_dirty_bitmap works wrong, as it considers only bitmaps already stored in the qcow2 image and ignores persistent BdrvDirtyBitmap objects. So, let's instead count persistent BdrvDirtyBitmaps. We load all qcow2 bitmaps on open, so there should not be any bitmap in the image for which we don't have BdrvDirtyBitmaps version. If it is - it's a kind of corruption, and no reason to check for corruptions here (open() and close() are better places for it). Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191014115126.15360-2-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz --- block/qcow2-bitmap.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index c6c8ebbe89..d41f5d049b 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -1703,8 +1703,14 @@ bool coroutine_fn qcow2_co_can_store_new_dirty_bitma= p(BlockDriverState *bs, Error **errp) { BDRVQcow2State *s =3D bs->opaque; - bool found; - Qcow2BitmapList *bm_list; + BdrvDirtyBitmap *bitmap; + uint64_t bitmap_directory_size =3D 0; + uint32_t nb_bitmaps =3D 0; + + if (bdrv_find_dirty_bitmap(bs, name)) { + error_setg(errp, "Bitmap already exists: %s", name); + return false; + } =20 if (s->qcow_version < 3) { /* Without autoclear_features, we would always have to assume @@ -1720,38 +1726,27 @@ bool coroutine_fn qcow2_co_can_store_new_dirty_bitm= ap(BlockDriverState *bs, goto fail; } =20 - if (s->nb_bitmaps =3D=3D 0) { - return true; + FOR_EACH_DIRTY_BITMAP(bs, bitmap) { + if (bdrv_dirty_bitmap_get_persistence(bitmap)) { + nb_bitmaps++; + bitmap_directory_size +=3D + calc_dir_entry_size(strlen(bdrv_dirty_bitmap_name(bitmap))= , 0); + } } + nb_bitmaps++; + bitmap_directory_size +=3D calc_dir_entry_size(strlen(name), 0); =20 - if (s->nb_bitmaps >=3D QCOW2_MAX_BITMAPS) { + if (nb_bitmaps > QCOW2_MAX_BITMAPS) { error_setg(errp, "Maximum number of persistent bitmaps is already reache= d"); goto fail; } =20 - if (s->bitmap_directory_size + calc_dir_entry_size(strlen(name), 0) > - QCOW2_MAX_BITMAP_DIRECTORY_SIZE) - { + if (bitmap_directory_size > QCOW2_MAX_BITMAP_DIRECTORY_SIZE) { error_setg(errp, "Not enough space in the bitmap directory"); goto fail; } =20 - qemu_co_mutex_lock(&s->lock); - bm_list =3D bitmap_list_load(bs, s->bitmap_directory_offset, - s->bitmap_directory_size, errp); - qemu_co_mutex_unlock(&s->lock); - if (bm_list =3D=3D NULL) { - goto fail; - } - - found =3D find_bitmap_by_name(bm_list, name); - bitmap_list_free(bm_list); - if (found) { - error_setg(errp, "Bitmap with the same name is already stored"); - goto fail; - } - return true; =20 fail: --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578321896; cv=none; d=zohomail.com; s=zohoarc; b=dL45a2XuTke/ocaJZeQxgCaH8B64mDsBddXwfPZmExcgFEgnDAtDxkrRBwdu+7j4Gdh6eTGeEuF7+HxzWAsd9Yw3OwChd3exBJWZP2x7BlPoX0Er/t3ILPIP/Q0wWtQa91tSjvwrUj2CVqHBc3s2tFOgP8M22GMcEM3IR3yrX3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578321896; 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=yWlbrJzuULgjCZZfWA/TRSan+80TX2F0hTU19vEOaZg=; b=XIe/F/3lDbnxWi2vjfeqbndRGs70MjsKPhAunMrmFfBtgo7sQeCW/Q8XAnco8uLkd0tNq78StJc6RV1eaJnmlRfS/9mN92tjaT/X1Z9O/bVBW3IoVJNwsWzlZMYwBQpMzePWLQTL8ufYIIz5YNLJk/aDUW4CQ/oNkxw/tegw2UI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578321896306969.6517888275895; Mon, 6 Jan 2020 06:44:56 -0800 (PST) Received: from localhost ([::1]:52776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTck-0008OX-TU for importer@patchew.org; Mon, 06 Jan 2020 09:44:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43398) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTak-00060C-FF for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTaj-0008WD-7d for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27343 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 1ioTaj-0008VI-4c for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42: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-61-mhPUKoe2NnKVHxtGWJ7tUQ-1; Mon, 06 Jan 2020 09:42:45 -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 22877805149; Mon, 6 Jan 2020 14:42:43 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97C3B7FB72; Mon, 6 Jan 2020 14:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321768; 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=yWlbrJzuULgjCZZfWA/TRSan+80TX2F0hTU19vEOaZg=; b=cqKkTwJ8rVWWHDHfrMSvSZ3JZzJBw3VMYgylKC4nYaUHD9DTTz6mrVkbxuEbPcscea3Dxl UEJTNf56s7wlahaC6NT/OpnVK+4D+SJOh/iQhCGzx/5Zkdku5qh57AJes2cSKe5LDd4F9d Vzi6H9RIN8UpNmUxShEYlFG4xfaN7DQ= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 08/34] iotests: s/qocw2/qcow2/ Date: Mon, 6 Jan 2020 15:41:40 +0100 Message-Id: <20200106144206.698920-9-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: mhPUKoe2NnKVHxtGWJ7tUQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Probably due to blind copy-pasting, we have several instances of "qocw2" in our iotests. Fix them. Reported-by: Maxim Levitsky Signed-off-by: Max Reitz Message-id: 20191107163708.833192-2-mreitz@redhat.com Reviewed-by: Eric Blake Reviewed-by: Maxim Levitsky Signed-off-by: Max Reitz --- tests/qemu-iotests/060 | 2 +- tests/qemu-iotests/061 | 2 +- tests/qemu-iotests/062 | 2 +- tests/qemu-iotests/066 | 2 +- tests/qemu-iotests/068 | 2 +- tests/qemu-iotests/108 | 2 +- tests/qemu-iotests/138 | 2 +- tests/qemu-iotests/261 | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index d96f17a484..7439be894b 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -44,7 +44,7 @@ _filter_io_error() . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file _supported_os Linux diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index 4eac5b83bd..e1b8044630 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file _supported_os Linux diff --git a/tests/qemu-iotests/062 b/tests/qemu-iotests/062 index d5f818fcce..79738b1c26 100755 --- a/tests/qemu-iotests/062 +++ b/tests/qemu-iotests/062 @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic =20 diff --git a/tests/qemu-iotests/066 b/tests/qemu-iotests/066 index 28f8c98412..cacbdb6ae0 100755 --- a/tests/qemu-iotests/066 +++ b/tests/qemu-iotests/066 @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic =20 diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index 22f5ca3ba6..c164ccc64a 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic =20 diff --git a/tests/qemu-iotests/108 b/tests/qemu-iotests/108 index 9c08172237..872a9afec9 100755 --- a/tests/qemu-iotests/108 +++ b/tests/qemu-iotests/108 @@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file _supported_os Linux diff --git a/tests/qemu-iotests/138 b/tests/qemu-iotests/138 index 6a731370db..8b2f587af0 100755 --- a/tests/qemu-iotests/138 +++ b/tests/qemu-iotests/138 @@ -36,7 +36,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file _supported_os Linux diff --git a/tests/qemu-iotests/261 b/tests/qemu-iotests/261 index fb96bcfbe2..9f2817251f 100755 --- a/tests/qemu-iotests/261 +++ b/tests/qemu-iotests/261 @@ -40,7 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter =20 -# This tests qocw2-specific low-level functionality +# This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file _supported_os Linux --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322723; cv=none; d=zohomail.com; s=zohoarc; b=bUfvicgQw6pHWEvoDXQXQC3du9AtaPYD8R+6Tes4DiFOWccFdLqp7TkIPW5n/c6dwWXVl2+FEi3kId7SSnDK6Hk6PgAnMFmuV5xD3HxGuIG7Ak3uA1pwkFX3A8ed+7XdB/Vx6o4oHbCzl3Jl3jvQuJs3JiZeQERdsHRsDcs8WL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322723; 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=ZqqUZoUNfmSVcC5/0YumgBn+5w0ZWMiiC/7GW0nI5f8=; b=i6qx0ZANNXlSXkj49Xl7s2rDv0mqoKnJOcgN8jW6YaZodZcMsGT+po+r4DrJg5Qj2BoEUkzY4Ilo7HiRfNyQ2XO2x0heYeuCLS4JF8akuCO5C9LvUEep1KTZXwi319hXilsVLKbofc4CH4uNSwTQJorQI8EwaBVpXXlU7V93Z/o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322723508395.5100403065045; Mon, 6 Jan 2020 06:58:43 -0800 (PST) Received: from localhost ([::1]:53024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTq5-0001cb-O4 for importer@patchew.org; Mon, 06 Jan 2020 09:58:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43412) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTal-00061D-KN for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTak-00005E-H6 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:28777 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 1ioTak-00004r-Do for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:50 -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-266-zJt8-1SkPg-Z68Y1DAnzrQ-1; Mon, 06 Jan 2020 09:42: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 733528C1343; Mon, 6 Jan 2020 14:42:45 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1186250A8F; Mon, 6 Jan 2020 14:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321769; 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=ZqqUZoUNfmSVcC5/0YumgBn+5w0ZWMiiC/7GW0nI5f8=; b=gf75nUCUNRGJ9FiIxEGfI2DlNsBPCXdwvqJnjIMqTfyHhKzrFl6J/IvYoC9LBkW5jHDaqH mBl0mDK0av/LS0kTMiokoDhxwa32FLaBFfjEzGHK/sb9XfMpjkez5kOVe/u3rbOmJt8Xcn 0p8RoOijU+JtYmv5hKsrymxv1rW14TI= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 09/34] iotests/qcow2.py: Add dump-header-exts Date: Mon, 6 Jan 2020 15:41:41 +0100 Message-Id: <20200106144206.698920-10-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: zJt8-1SkPg-Z68Y1DAnzrQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is useful for tests that want to whitelist fields from dump-header (with grep) but still print all header extensions. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-3-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/qcow2.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py index b392972d1b..d813b4fc81 100755 --- a/tests/qemu-iotests/qcow2.py +++ b/tests/qemu-iotests/qcow2.py @@ -154,6 +154,10 @@ def cmd_dump_header(fd): h.dump() h.dump_extensions() =20 +def cmd_dump_header_exts(fd): + h =3D QcowHeader(fd) + h.dump_extensions() + def cmd_set_header(fd, name, value): try: value =3D int(value, 0) @@ -230,6 +234,7 @@ def cmd_set_feature_bit(fd, group, bit): =20 cmds =3D [ [ 'dump-header', cmd_dump_header, 0, 'Dump image hea= der and header extensions' ], + [ 'dump-header-exts', cmd_dump_header_exts, 0, 'Dump image hea= der extensions' ], [ 'set-header', cmd_set_header, 2, 'Set a field in= the header'], [ 'add-header-ext', cmd_add_header_ext, 2, 'Add a header e= xtension' ], [ 'add-header-ext-stdio', cmd_add_header_ext_stdio, 1, 'Add a header e= xtension, data from stdin' ], --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322139; cv=none; d=zohomail.com; s=zohoarc; b=FGUhrYcVxQb9lu1P09WExDeb8RLS1F6N98LrKGc3+/rofbjsHRbKzVJeUYrwqehBbP2/PzwEGLmmyAdequK9nJfxjUsWKKb/RFki9pFxWBi7XCOLzOx1uh/XAZU2d1IqzRLlWb8mU25XGrerNy2dnzcVLvvAsAnayVXsJQ+7XNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322139; 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=aObt0XmQT8lE1//zhu4oxlCRVCTMYyASQBKPv4yu6JA=; b=C3UpXg1zijtWRNF3/usb8Tb1ATSEmQWZhHRw2+tbMFDOrv2fxAJBUp/S6zeiJGshPU+5J9J6YRMnkK3vHM2bbfKFuBMkgE14CleIuM7ibVgEpAhUIuHKasC5dcZcoLVIfz99LmY8O6XWLJyClqAug//HyYaonx85CHSyuy7eY9I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15783221396251013.4227830274948; Mon, 6 Jan 2020 06:48:59 -0800 (PST) Received: from localhost ([::1]:52864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTgf-0004Sb-O1 for importer@patchew.org; Mon, 06 Jan 2020 09:48:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43468) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTaq-00068f-5t for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTan-00007t-P4 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:56 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20125 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 1ioTan-00007g-KI for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42: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-345-EcZNnMl1Pq6oS1H0Y7GCrA-1; Mon, 06 Jan 2020 09:42: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 919F710865DA; Mon, 6 Jan 2020 14:42:48 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7893D7FB61; Mon, 6 Jan 2020 14:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321773; 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=aObt0XmQT8lE1//zhu4oxlCRVCTMYyASQBKPv4yu6JA=; b=KJh8Szkopi2vtAY/kdbesYnNHOaaxIS3ImLz7Bw2SdvSS1xKUJqWU5UkY4yw+7GBlvLWxj J4lZAQ08O5A0tu/weZ1ILuoc88AhMjgzQglljL6yqn9g5beKTmfEjvVIFs+/v2m2zMBchC ipGHW+166OtGnZc00G0OlRggq8IWYgw= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 10/34] iotests/qcow2.py: Split feature fields into bits Date: Mon, 6 Jan 2020 15:41:42 +0100 Message-Id: <20200106144206.698920-11-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: EcZNnMl1Pq6oS1H0Y7GCrA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Print the feature fields as a set of bits so that filtering is easier. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-4-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/031.out | 36 +++++++++---------- tests/qemu-iotests/036.out | 18 +++++----- tests/qemu-iotests/039.out | 22 ++++++------ tests/qemu-iotests/060.out | 20 +++++------ tests/qemu-iotests/061.out | 72 ++++++++++++++++++------------------- tests/qemu-iotests/137.out | 2 +- tests/qemu-iotests/qcow2.py | 18 +++++++--- 7 files changed, 99 insertions(+), 89 deletions(-) diff --git a/tests/qemu-iotests/031.out b/tests/qemu-iotests/031.out index 68a74d03b9..d535e407bc 100644 --- a/tests/qemu-iotests/031.out +++ b/tests/qemu-iotests/031.out @@ -18,9 +18,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -46,9 +46,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -74,9 +74,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -109,9 +109,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -142,9 +142,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -175,9 +175,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 104 =20 diff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out index e489b44386..15229a9604 100644 --- a/tests/qemu-iotests/036.out +++ b/tests/qemu-iotests/036.out @@ -16,9 +16,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x8000000000000000 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [63] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -50,9 +50,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x8000000000000000 +incompatible_features [] +compatible_features [] +autoclear_features [63] refcount_order 4 header_length 104 =20 @@ -78,9 +78,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 104 =20 diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out index 2e356d51b6..bdafa3ace3 100644 --- a/tests/qemu-iotests/039.out +++ b/tests/qemu-iotests/039.out @@ -4,7 +4,7 @@ QA output created by 039 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -incompatible_features 0x0 +incompatible_features [] No errors were found on the image. =20 =3D=3D Creating a dirty image file =3D=3D @@ -12,7 +12,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D13421= 7728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features 0x1 +incompatible_features [0] ERROR cluster 5 refcount=3D0 reference=3D1 ERROR OFLAG_COPIED data cluster: l2_entry=3D8000000000050000 refcount=3D0 =20 @@ -22,7 +22,7 @@ Data may be corrupted, or further writes to the image may= corrupt it. =3D=3D Read-only access must still work =3D=3D read 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -incompatible_features 0x1 +incompatible_features [0] =20 =3D=3D Repairing the image file must succeed =3D=3D ERROR cluster 5 refcount=3D0 reference=3D1 @@ -36,7 +36,7 @@ The following inconsistencies were found and repaired: =20 Double checking the fixed image now... No errors were found on the image. -incompatible_features 0x0 +incompatible_features [] =20 =3D=3D Data should still be accessible after repair =3D=3D read 512/512 bytes at offset 0 @@ -47,21 +47,21 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134= 217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features 0x1 +incompatible_features [0] ERROR cluster 5 refcount=3D0 reference=3D1 Rebuilding refcount structure Repairing cluster 1 refcount=3D1 reference=3D0 Repairing cluster 2 refcount=3D1 reference=3D0 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -incompatible_features 0x0 +incompatible_features [] =20 =3D=3D Creating an image file with lazy_refcounts=3Doff =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features 0x0 +incompatible_features [] No errors were found on the image. =20 =3D=3D Committing to a backing file with lazy_refcounts=3Don =3D=3D @@ -70,8 +70,8 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D13421= 7728 backing_file=3DTEST_DIR/ wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Image committed. -incompatible_features 0x0 -incompatible_features 0x0 +incompatible_features [] +incompatible_features [] No errors were found on the image. No errors were found on the image. =20 @@ -80,7 +80,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D13421= 7728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features 0x1 +incompatible_features [0] ERROR cluster 5 refcount=3D0 reference=3D1 ERROR OFLAG_COPIED data cluster: l2_entry=3D8000000000050000 refcount=3D0 =20 @@ -90,6 +90,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D13421= 7728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features 0x0 +incompatible_features [] No errors were found on the image. *** done diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index 0f6b0658a1..d27692a33c 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -7,10 +7,10 @@ ERROR cluster 3 refcount=3D1 reference=3D3 =20 1 errors were found on the image. Data may be corrupted, or further writes to the image may corrupt it. -incompatible_features 0x0 +incompatible_features [] qcow2: Marking image as corrupt: Preventing invalid write on metadata (ove= rlaps with active L1 table); further corruption events will be suppressed write failed: Input/output error -incompatible_features 0x2 +incompatible_features [1] image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 64 MiB (67108864 bytes) @@ -33,10 +33,10 @@ ERROR cluster 2 refcount=3D1 reference=3D2 =20 2 errors were found on the image. Data may be corrupted, or further writes to the image may corrupt it. -incompatible_features 0x0 +incompatible_features [] qcow2: Marking image as corrupt: Preventing invalid write on metadata (ove= rlaps with refcount block); further corruption events will be suppressed write failed: Input/output error -incompatible_features 0x2 +incompatible_features [1] ERROR refcount block 0 refcount=3D2 ERROR cluster 2 refcount=3D1 reference=3D2 Rebuilding refcount structure @@ -49,10 +49,10 @@ The following inconsistencies were found and repaired: =20 Double checking the fixed image now... No errors were found on the image. -incompatible_features 0x0 +incompatible_features [] wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -incompatible_features 0x0 +incompatible_features [] =20 =3D=3D=3D Testing cluster data reference into inactive L2 table =3D=3D=3D =20 @@ -69,10 +69,10 @@ Data may be corrupted, or further writes to the image m= ay corrupt it. =20 1 leaked clusters were found on the image. This means waste of disk space, but no harm to data. -incompatible_features 0x0 +incompatible_features [] qcow2: Marking image as corrupt: Preventing invalid write on metadata (ove= rlaps with inactive L2 table); further corruption events will be suppressed write failed: Input/output error -incompatible_features 0x2 +incompatible_features [1] ERROR cluster 4 refcount=3D1 reference=3D2 Leaked cluster 9 refcount=3D1 reference=3D0 Repairing cluster 4 refcount=3D1 reference=3D2 @@ -85,10 +85,10 @@ The following inconsistencies were found and repaired: =20 Double checking the fixed image now... No errors were found on the image. -incompatible_features 0x0 +incompatible_features [] wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -incompatible_features 0x0 +incompatible_features [] read 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) No errors were found on the image. diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index d6a7c2af95..8b3091a412 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -18,9 +18,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x1 -autoclear_features 0x0 +incompatible_features [] +compatible_features [0] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -42,9 +42,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -76,9 +76,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x1 -autoclear_features 0x0 +incompatible_features [] +compatible_features [0] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -100,9 +100,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -132,9 +132,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x1 -compatible_features 0x1 -autoclear_features 0x0 +incompatible_features [0] +compatible_features [0] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -161,9 +161,9 @@ refcount_table_offset 0x80000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -187,9 +187,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x40000000000 -autoclear_features 0x40000000000 +incompatible_features [] +compatible_features [42] +autoclear_features [42] refcount_order 4 header_length 104 =20 @@ -211,9 +211,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -237,9 +237,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 72 =20 @@ -256,9 +256,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x1 -autoclear_features 0x0 +incompatible_features [] +compatible_features [0] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -290,9 +290,9 @@ refcount_table_offset 0x10000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x1 -compatible_features 0x1 -autoclear_features 0x0 +incompatible_features [0] +compatible_features [0] +autoclear_features [] refcount_order 4 header_length 104 =20 @@ -319,9 +319,9 @@ refcount_table_offset 0x80000 refcount_table_clusters 1 nb_snapshots 0 snapshot_offset 0x0 -incompatible_features 0x0 -compatible_features 0x0 -autoclear_features 0x0 +incompatible_features [] +compatible_features [] +autoclear_features [] refcount_order 4 header_length 104 =20 diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out index 1c6569eb2c..bd4523a853 100644 --- a/tests/qemu-iotests/137.out +++ b/tests/qemu-iotests/137.out @@ -36,7 +36,7 @@ qemu-io: Unsupported value 'blubb' for qcow2 option 'over= lap-check'. Allowed are wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features 0x0 +incompatible_features [] Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py index d813b4fc81..91e4420b9f 100755 --- a/tests/qemu-iotests/qcow2.py +++ b/tests/qemu-iotests/qcow2.py @@ -42,9 +42,9 @@ class QcowHeader: [ uint64_t, '%#x', 'snapshot_offset' ], =20 # Version 3 header fields - [ uint64_t, '%#x', 'incompatible_features' ], - [ uint64_t, '%#x', 'compatible_features' ], - [ uint64_t, '%#x', 'autoclear_features' ], + [ uint64_t, 'mask', 'incompatible_features' ], + [ uint64_t, 'mask', 'compatible_features' ], + [ uint64_t, 'mask', 'autoclear_features' ], [ uint32_t, '%d', 'refcount_order' ], [ uint32_t, '%d', 'header_length' ], ]; @@ -130,7 +130,17 @@ class QcowHeader: =20 def dump(self): for f in QcowHeader.fields: - print("%-25s" % f[2], f[1] % self.__dict__[f[2]]) + value =3D self.__dict__[f[2]] + if f[1] =3D=3D 'mask': + bits =3D [] + for bit in range(64): + if value & (1 << bit): + bits.append(bit) + value_str =3D str(bits) + else: + value_str =3D f[1] % value + + print("%-25s" % f[2], value_str) print("") =20 def dump_extensions(self): --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322423; cv=none; d=zohomail.com; s=zohoarc; b=SmznT0j5l04AS8Mo5gmG/COt5dojfj/q2RjHZuZCQWP3s5zvRewhRqJ7E6J54Gz3iqWdMYCGO9MQklJ4CUJ/1Z1bHbxRAjT9fYEbHdTa/WEvq58pUlJ9DItHfnLmVDo7bY7nI04Ik5ACfEuiwnBg6A7kfblbcWoVAI21Gso4lF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322423; 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=5fV0o92wv3EQ/Iwazcvp/NxjEvMeO/Tonk+nyxiGGRc=; b=nY/g4hlhW/zU3IXaF7UOzJtjWnIoF6VPSIqsNU5/Z0EkiCnlQHjI5htLS3l0C/XvOvsCbvh2w9oHlN8Ve+T992xE+3CvWeKuk3PgxLsXQt7VJee3WblfQTjYAiDNqQe0OlXpbRQg/FHLAnqW0DcdHiRPbZ/UPPF7MDZIuD84VAU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322423176878.2661318994415; Mon, 6 Jan 2020 06:53:43 -0800 (PST) Received: from localhost ([::1]:52940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTlF-0002Ox-G0 for importer@patchew.org; Mon, 06 Jan 2020 09:53:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43484) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTar-0006A4-0q for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTap-00009d-R4 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:56 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27730 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 1ioTap-00008u-N1 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:55 -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-6-2xJ6fo-HOjqEL_z47pfVjA-1; Mon, 06 Jan 2020 09:42:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01C5618B9F54; Mon, 6 Jan 2020 14:42:51 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8087687ECB; Mon, 6 Jan 2020 14:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321775; 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=5fV0o92wv3EQ/Iwazcvp/NxjEvMeO/Tonk+nyxiGGRc=; b=h/N3SMOsS4ntPCkCkh/IO1GfJ8Unv9OOkT4Nhas1gDVh8IFLWlY9aQvlhayTGygafnOfTU lCjOOTVcTxDn5kHUVFC+QA98PhldaDokUvM77pwrFgdWDWfyQqzsRCe4iKu1eqTHiQ1h1I bATYEBdbdgBog3ybbMYLJ+rkuDvpfZk= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 11/34] iotests: Add _filter_json_filename Date: Mon, 6 Jan 2020 15:41:43 +0100 Message-Id: <20200106144206.698920-12-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 2xJ6fo-HOjqEL_z47pfVjA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-5-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/common.filter | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 5367deea39..116cc8a840 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -232,5 +232,29 @@ _filter_qmp_empty_return() grep -v '{"return": {}}' } =20 +_filter_json_filename() +{ + $PYTHON -c 'import sys +result, *fnames =3D sys.stdin.read().split("json:{") +depth =3D 0 +for fname in fnames: + depth +=3D 1 # For the opening brace in the split separator + for chr_i, chr in enumerate(fname): + if chr =3D=3D "{": + depth +=3D 1 + elif chr =3D=3D "}": + depth -=3D 1 + if depth =3D=3D 0: + break + + # json:{} filenames may be nested; filter out everything from + # inside the outermost one + if depth =3D=3D 0: + chr_i +=3D 1 # First character past the filename + result +=3D "json:{ /* filtered */ }" + fname[chr_i:] + +sys.stdout.write(result)' +} + # make sure this script returns success true --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322937; cv=none; d=zohomail.com; s=zohoarc; b=OPsJAsYcjOUv6uzX1Hzujnu06gAiosp2biadN5+plC3JBE5UE3fyCSWPTubiV0asDxgusSmuUigHD2Y4G9lxKg/ojCejf86rOPTl6iTqKBm7m8KCc/ZYBW+faxMHwLA8hu6CrBSo8oomeJUVmwWcKhuo+Yh1nWFagWlctTVg3pI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322937; 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=osQrdo77LH9FFoH7Ou21azj0h3tsEoibCd2rMNMALcw=; b=G3YwH/vVPZjSuJeau1Vf3QpF5NlFa3QTiZUvSJwbwmVE28ImQiGuOYyf4aCYzROsK1DWlP3luukjzqx3+8W4onHt9169e8XzCAKx1gDJOP2dsTAS+lcRfk3c3X9zFvFBldcVQCYLrZBHAw+m5u1x2PnskrMAFNwKVJDG3yrdLIA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322937775964.4683256271004; Mon, 6 Jan 2020 07:02:17 -0800 (PST) Received: from localhost ([::1]:53076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTtY-0005ji-5w for importer@patchew.org; Mon, 06 Jan 2020 10:02:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43551) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTau-0006FS-Pg for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTat-0000Ck-A7 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:00 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:47626 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 1ioTat-0000CS-6v for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:59 -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-61-KE8bTMJYNNKfIA6nBdVntA-1; Mon, 06 Jan 2020 09:42:54 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 587821099317; Mon, 6 Jan 2020 14:42:53 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9417289A8; Mon, 6 Jan 2020 14:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321778; 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=osQrdo77LH9FFoH7Ou21azj0h3tsEoibCd2rMNMALcw=; b=itXxTqik7oPf0E2LoZvXzfFC0Mk8yzlovWkiSGFlyRTmTJdczxDr+ETUhaj7lIBoNgJiK6 qiAFVs7CNfKEmgIVJP8UddVHdd5ULgxslT+am7bll6B/UQnKe/rbQnV8COwSgqjQwY4JtI tqSGKOOKvZg0kG/6LdL5NS7nIsL8Fec= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 12/34] iotests: Filter refcount_order in 036 Date: Mon, 6 Jan 2020 15:41:44 +0100 Message-Id: <20200106144206.698920-13-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: KE8bTMJYNNKfIA6nBdVntA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This test can run just fine with other values for refcount_bits, so we should filter the value from qcow2.py's dump-header. In fact, we can filter everything but the feature bits and header extensions, because that is what the test is about. (036 currently ignores user-specified image options, but that will be fixed in the next patch.) Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-6-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/036 | 9 ++++--- tests/qemu-iotests/036.out | 48 -------------------------------------- 2 files changed, 6 insertions(+), 51 deletions(-) diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036 index f06ff67408..5f929ad3be 100755 --- a/tests/qemu-iotests/036 +++ b/tests/qemu-iotests/036 @@ -55,7 +55,8 @@ $PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible= 63 =20 # Without feature table $PYTHON qcow2.py "$TEST_IMG" del-header-ext 0x6803f857 -$PYTHON qcow2.py "$TEST_IMG" dump-header +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep features +$PYTHON qcow2.py "$TEST_IMG" dump-header-exts _img_info =20 # With feature table containing bit 63 @@ -103,14 +104,16 @@ echo =3D=3D=3D Create image with unknown autoclear fe= ature bit =3D=3D=3D echo _make_test_img 64M $PYTHON qcow2.py "$TEST_IMG" set-feature-bit autoclear 63 -$PYTHON qcow2.py "$TEST_IMG" dump-header +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep features +$PYTHON qcow2.py "$TEST_IMG" dump-header-exts =20 echo echo =3D=3D=3D Repair image =3D=3D=3D echo _check_test_img -r all =20 -$PYTHON qcow2.py "$TEST_IMG" dump-header +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep features +$PYTHON qcow2.py "$TEST_IMG" dump-header-exts =20 # success, all done echo "*** done" diff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out index 15229a9604..0b52b934e1 100644 --- a/tests/qemu-iotests/036.out +++ b/tests/qemu-iotests/036.out @@ -3,25 +3,9 @@ QA output created by 036 =3D=3D=3D Image with unknown incompatible feature bit =3D=3D=3D =20 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -magic 0x514649fb -version 3 -backing_file_offset 0x0 -backing_file_size 0x0 -cluster_bits 16 -size 67108864 -crypt_method 0 -l1_size 1 -l1_table_offset 0x30000 -refcount_table_offset 0x10000 -refcount_table_clusters 1 -nb_snapshots 0 -snapshot_offset 0x0 incompatible_features [63] compatible_features [] autoclear_features [] -refcount_order 4 -header_length 104 - qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Unsupported IMGFMT feature(s= ): Unknown incompatible feature: 8000000000000000 qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Unsupported IMGFMT feature(s= ): Test feature =20 @@ -37,25 +21,9 @@ qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Unsupporte= d IMGFMT feature(s): tes =3D=3D=3D Create image with unknown autoclear feature bit =3D=3D=3D =20 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -magic 0x514649fb -version 3 -backing_file_offset 0x0 -backing_file_size 0x0 -cluster_bits 16 -size 67108864 -crypt_method 0 -l1_size 1 -l1_table_offset 0x30000 -refcount_table_offset 0x10000 -refcount_table_clusters 1 -nb_snapshots 0 -snapshot_offset 0x0 incompatible_features [] compatible_features [] autoclear_features [63] -refcount_order 4 -header_length 104 - Header extension: magic 0x6803f857 length 192 @@ -65,25 +33,9 @@ data =3D=3D=3D Repair image =3D=3D=3D =20 No errors were found on the image. -magic 0x514649fb -version 3 -backing_file_offset 0x0 -backing_file_size 0x0 -cluster_bits 16 -size 67108864 -crypt_method 0 -l1_size 1 -l1_table_offset 0x30000 -refcount_table_offset 0x10000 -refcount_table_clusters 1 -nb_snapshots 0 -snapshot_offset 0x0 incompatible_features [] compatible_features [] autoclear_features [] -refcount_order 4 -header_length 104 - Header extension: magic 0x6803f857 length 192 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322557; cv=none; d=zohomail.com; s=zohoarc; b=kmF5RqnRvfKhc9731/QMFiT9m3MWHGRDi+et4GAjQyFTmaIk3IU3m6SEa75QXYv6hUfyF0ZgozFt4tkQl+VC2kgw64xQYKPKTcyEdeEMNJz4sE3QUMN58rF6aWiZ3nNxe7p1SoaJsWPWDS4Q3TbT4R53rfzpuakJa3+LcmThvqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322557; 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=W0W6tNZ0LA7meTysDEAPtVwA/q4/ZNpLhybH76WkG28=; b=XQUVWaC+yJu8gLQnSHTVs5ACR+9VzuTxfICssc3movNlJ6pDSgtFjZMZkjI3H/9nEEe7NB3e8oO8863bn6anVxnTLWUbzQgFXuAhNPG7On5L6n68+G1iAlWKD98NXE2VJ7m1a5nZKhfDobt7thIICtPqkWL4k14Qhnux7D3wHuc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322557581361.1240140022853; Mon, 6 Jan 2020 06:55:57 -0800 (PST) Received: from localhost ([::1]:52970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTnP-0006PW-Vj for importer@patchew.org; Mon, 06 Jan 2020 09:55:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43550) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTau-0006FO-KX for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTat-0000CW-3H for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:00 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:41117 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 1ioTas-0000CG-W0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:42:59 -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-158-4iNOI0GwNm6fBQEOSqdQLA-1; Mon, 06 Jan 2020 09:42:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DCEF7132F3B; Mon, 6 Jan 2020 14:42:55 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B12160C88; Mon, 6 Jan 2020 14:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321778; 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=W0W6tNZ0LA7meTysDEAPtVwA/q4/ZNpLhybH76WkG28=; b=hHkDgngktW8ortgYuTVPSND+WxTlg/gEtAYtfHGKiPw5ByivsXAFcWU2COVrFaP/K7bJtv pQ3L5Q/s5cO2ApkCt4Rou/gawJgX0aljrR2UQ/XItmoCZ1n8bDVLQ3LqMir774ZmwSCfP8 5Q16vRt1W/k4YDYEuOu0QfVxD2y4Y0w= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 13/34] iotests: Replace IMGOPTS by _unsupported_imgopts Date: Mon, 6 Jan 2020 15:41:45 +0100 Message-Id: <20200106144206.698920-14-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 4iNOI0GwNm6fBQEOSqdQLA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Some tests require compat=3D1.1 and thus set IMGOPTS=3D'compat=3D1.1' globally. That is not how it should be done; instead, they should simply set _unsupported_imgopts to compat=3D0.10 (compat=3D1.1 is the default anyway). This makes the tests heed user-specified $IMGOPTS. Some do not work with all image options, though, so we need to disable them accordingly. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-7-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/036 | 3 +-- tests/qemu-iotests/060 | 4 ++-- tests/qemu-iotests/062 | 3 ++- tests/qemu-iotests/066 | 3 ++- tests/qemu-iotests/068 | 3 ++- tests/qemu-iotests/098 | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036 index 5f929ad3be..bbaf0ef45b 100755 --- a/tests/qemu-iotests/036 +++ b/tests/qemu-iotests/036 @@ -43,9 +43,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file - # Only qcow2v3 and later supports feature bits -IMGOPTS=3D"compat=3D1.1" +_unsupported_imgopts 'compat=3D0.10' =20 echo echo =3D=3D=3D Image with unknown incompatible feature bit =3D=3D=3D diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index 7439be894b..932bc2f3f9 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -48,6 +48,8 @@ _filter_io_error() _supported_fmt qcow2 _supported_proto file _supported_os Linux +# These tests only work for compat=3D1.1 images with refcount_bits=3D16 +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D\([^1]\|.\([^6]\|$\)= \)' =20 # The repair process will create a large file - so check for availability = first _require_large_file 64G @@ -58,8 +60,6 @@ l1_offset=3D196608 # 0x30000 (XXX: just an assumption) l2_offset=3D262144 # 0x40000 (XXX: just an assumption) l2_offset_after_snapshot=3D524288 # 0x80000 (XXX: just an assumption) =20 -IMGOPTS=3D"compat=3D1.1" - OPEN_RW=3D"open -o overlap-check=3Dall $TEST_IMG" # Overlap checks are done before write operations only, therefore opening = an # image read-only makes the overlap-check option irrelevant diff --git a/tests/qemu-iotests/062 b/tests/qemu-iotests/062 index 79738b1c26..0df8667e5a 100755 --- a/tests/qemu-iotests/062 +++ b/tests/qemu-iotests/062 @@ -40,8 +40,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic +# We need zero clusters and snapshots +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' =20 -IMGOPTS=3D"compat=3D1.1" IMG_SIZE=3D64M =20 echo diff --git a/tests/qemu-iotests/066 b/tests/qemu-iotests/066 index cacbdb6ae0..71e8df598a 100755 --- a/tests/qemu-iotests/066 +++ b/tests/qemu-iotests/066 @@ -39,9 +39,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic +# We need zero clusters and snapshots +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' =20 # Intentionally create an unaligned image -IMGOPTS=3D"compat=3D1.1" IMG_SIZE=3D$((64 * 1024 * 1024 + 512)) =20 echo diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index c164ccc64a..fe9d7ae1be 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -39,8 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic +# Internal snapshots are (currently) impossible with refcount_bits=3D1 +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' =20 -IMGOPTS=3D"compat=3D1.1" IMG_SIZE=3D128K =20 case "$QEMU_DEFAULT_MACHINE" in diff --git a/tests/qemu-iotests/098 b/tests/qemu-iotests/098 index 1c1d1c468f..700068b328 100755 --- a/tests/qemu-iotests/098 +++ b/tests/qemu-iotests/098 @@ -40,8 +40,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file - -IMGOPTS=3D"compat=3D1.1" +# The code path we want to test here only works for compat=3D1.1 images +_unsupported_imgopts 'compat=3D0.10' =20 for event in l1_update empty_image_prepare reftable_update refblock_alloc;= do =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323167; cv=none; d=zohomail.com; s=zohoarc; b=fvrMdH9vCcyHO3D9IoQNWJhL0FcNRPPSo58YIaCwJFxdQC3kDczyDgWPWxyrGav3CNTadAc4ftqUDzuiVVu8i1XeK/Tlxgm99csd4rKx0PEP97Ug7pl/OV8YxH2PQbI0JX/+lycT2bZKKWPcOlzVmUODvOpoz39cbqCsjX38wvE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323167; 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=N9OkpeVzkzlcztCw+WGFva69O4o2CJxWuJHyMhqELkI=; b=JdpaQdIarwhQs1y+lbLhoJnuYE/UIw0lA/taPrg4sSAXVzxzXXqSwegzhvYYCF00Wcr6+IwY2jsfAFTp8SiP3l3RgDq3A0FRqFwuHTWjpd3WRyEaz4oyJlqYKKvEjzVNzTc3pqe9Og2aSFfTarHXKvUnmfCRCJDeIFPZsWi5GHY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578323167185594.1536541201967; Mon, 6 Jan 2020 07:06:07 -0800 (PST) Received: from localhost ([::1]:53120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTxF-0001AA-AY for importer@patchew.org; Mon, 06 Jan 2020 10:06:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43625) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTay-0006Lu-PS for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTax-0000Gp-OY for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:04 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:45932 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 1ioTax-0000Gj-Kt for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-345-EMJqrB09PVi_e1kGkNkdsA-1; Mon, 06 Jan 2020 09:43:00 -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 C40258E3BDD; Mon, 6 Jan 2020 14:42:58 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4022950A8F; Mon, 6 Jan 2020 14:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321783; 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=N9OkpeVzkzlcztCw+WGFva69O4o2CJxWuJHyMhqELkI=; b=REaIfO7dVWn0Amv5D2gj/eBbjaIqUKL7/9/cs2GQA+Rr9afVYUWox76Ykt/Tptjrxb0C7a sO4jw++VcwlPB2S4qqAuInnFNcKM59ePHVyYM0r35O4Kh1KcdvsjwvHJMIXVUp3hB49KiI 3sC/Mrv8z9SGAu7Uqq90l1DP06UVpgw= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 14/34] iotests: Drop compat=1.1 in 050 Date: Mon, 6 Jan 2020 15:41:46 +0100 Message-Id: <20200106144206.698920-15-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: EMJqrB09PVi_e1kGkNkdsA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" IMGOPTS can never be empty for qcow2, because the check scripts adds compat=3D1.1 unless the user specified any compat option themselves. Thus, this block does not do anything and can be dropped. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-8-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/050 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050 index 211fc00797..272ecab195 100755 --- a/tests/qemu-iotests/050 +++ b/tests/qemu-iotests/050 @@ -41,10 +41,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 qed _supported_proto file =20 -if test "$IMGFMT" =3D qcow2 && test $IMGOPTS =3D ""; then - IMGOPTS=3Dcompat=3D1.1 -fi - echo echo "=3D=3D Creating images =3D=3D" =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322341; cv=none; d=zohomail.com; s=zohoarc; b=VKqTLTmS8bkDxjiesfxJNHP79E8nBZM0d1GivyejFt3QXc7s/2YqOWlJYrE9Urz8kiG3YH+GjwSk5x6su2Hifm9Vnxe2veObGhbNTXnQPRexZYeQzCx4ZXcMexVeZ7We+IznvdFWZtnBzVxB+JaQ7Q4Qqf/WzU0L6ofk/FaBr+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322341; 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=u01rTctSs8+0K9/VA+A+luPYWsbvIftoRd+neOuoVRE=; b=fI38JtVXwPOxUv0rYXZku4ck1nfaZHIhExqs3SN3AwP5zbkYauJdanzhm8mWp3Gp+J828or92n+CPkEpTZvdRYXoUyP/5YF+if2tP+4bggHmmLr+jpj4bHFz5aAve+LeF4QpZ8oCPsoMjqTtXUorOM3qv5AoqtbZ75D39C5Ni8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322341577597.2222262147359; Mon, 6 Jan 2020 06:52:21 -0800 (PST) Received: from localhost ([::1]:52918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTjw-00005G-2K for importer@patchew.org; Mon, 06 Jan 2020 09:52:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43677) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTb1-0006Rq-P8 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTb0-0000KP-Kx for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:07 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:40252 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 1ioTb0-0000Jt-Hf for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-380-Rgat__iRMIuCUzkW32cFXg-1; Mon, 06 Jan 2020 09:43:02 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A4A201576AD; Mon, 6 Jan 2020 14:43:01 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 356FC28984; Mon, 6 Jan 2020 14:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321786; 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=u01rTctSs8+0K9/VA+A+luPYWsbvIftoRd+neOuoVRE=; b=CU0rS+/KpBJhEqVqL9qKwMwHEVbuMklEaGXT1m+rwajd2VE4tsNwx082P1igERR/N2ZFaj jR2PxNOuTh0mphmOaEBkrKaPQRUkxaZYfFYwnDEWszhVf0SE1MYMmY/pGb+LQ3v3fSt/zr 29WZZ0hzZTCt+Q/0lAC0aNpUh9WefWU= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 15/34] iotests: Let _make_test_img parse its parameters Date: Mon, 6 Jan 2020 15:41:47 +0100 Message-Id: <20200106144206.698920-16-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: Rgat__iRMIuCUzkW32cFXg-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This will allow us to add more options than just -b. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-9-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/common.rc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 555c453911..f01165a66e 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -303,12 +303,12 @@ _make_test_img() # extra qemu-img options can be added by tests # at least one argument (the image size) needs to be added local extra_img_options=3D"" - local image_size=3D$* local optstr=3D"" local img_name=3D"" local use_backing=3D0 local backing_file=3D"" local object_options=3D"" + local misc_params=3D() =20 if [ -n "$TEST_IMG_FILE" ]; then img_name=3D$TEST_IMG_FILE @@ -324,11 +324,23 @@ _make_test_img() optstr=3D$(_optstr_add "$optstr" "key-secret=3Dkeysec0") fi =20 - if [ "$1" =3D "-b" ]; then - use_backing=3D1 - backing_file=3D$2 - image_size=3D$3 - fi + for param; do + if [ "$use_backing" =3D "1" -a -z "$backing_file" ]; then + backing_file=3D$param + continue + fi + + case "$param" in + -b) + use_backing=3D1 + ;; + + *) + misc_params=3D("${misc_params[@]}" "$param") + ;; + esac + done + if [ \( "$IMGFMT" =3D "qcow2" -o "$IMGFMT" =3D "qed" \) -a -n "$CLUSTE= R_SIZE" ]; then optstr=3D$(_optstr_add "$optstr" "cluster_size=3D$CLUSTER_SIZE") fi @@ -344,9 +356,9 @@ _make_test_img() # XXX(hch): have global image options? ( if [ $use_backing =3D 1 ]; then - $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options -b = "$backing_file" "$img_name" $image_size 2>&1 + $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options -b = "$backing_file" "$img_name" "${misc_params[@]}" 2>&1 else - $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options "$i= mg_name" $image_size 2>&1 + $QEMU_IMG create $object_options -f $IMGFMT $extra_img_options "$i= mg_name" "${misc_params[@]}" 2>&1 fi ) | _filter_img_create =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322778; cv=none; d=zohomail.com; s=zohoarc; b=YcC3duy8ixIpqcBLuBGn5hnvHaz8+ik/wI77aOutkZEilroAUpidrKr7blQRWhjc/ot1WmHp8jgBUDnRzsG2/MPe87zqZLtVAR1ZCQKT4m+DFFyxvKDShziQMeR4RHPMqZBOMl/76JPKV2BduJhn0OaFN9VjvXWXLlE15wKNtMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322778; 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=wvs5BLjjC+phE0DkejwRiHX0/gXnCNReskLUf3qZM5M=; b=YignuAOPVPB8ObJ05NDrN0dgLHPITyVBUXxgcYdls+QMlLE3vQLjHpqrRBMXCKOr8BVhPRh0DY3TEnVm4LAOPpwb3NKtto256wnc/Vyad+3iM8Sp8jhCWVI2J6wo0/FHl59u4oAzVtKC3cFhmXQudKbZQXLmdVsjzd7Btowwofw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322778675137.3106669697438; Mon, 6 Jan 2020 06:59:38 -0800 (PST) Received: from localhost ([::1]:53036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTqy-000386-Um for importer@patchew.org; Mon, 06 Jan 2020 09:59:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43716) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTb4-0006Vx-CM for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTb3-0000MD-8u for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:10 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:52263 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 1ioTb3-0000M1-5y for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-kaXbUbqCM9OGae6pO8v_Fw-1; Mon, 06 Jan 2020 09:43:05 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2EA508F2CEA; Mon, 6 Jan 2020 14:43:04 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9833D1084201; Mon, 6 Jan 2020 14:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321788; 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=wvs5BLjjC+phE0DkejwRiHX0/gXnCNReskLUf3qZM5M=; b=dptcUr9wfkzx/GOczAz873FfFd42fiRoqZb+d1gYCoEE7u+jfJMZ04NQ0LRLdggyZu8kj4 fpU7NBhCM6Mc30aABb9Wz1pqjLOWev9tXxZojqxkDT9ZKA/Gb6ZHAPO2aDxaIHMNtGRJvZ uNE2aT35DMJIuSaji339EiqLSMtfJJo= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 16/34] iotests: Add -o and --no-opts to _make_test_img Date: Mon, 6 Jan 2020 15:41:48 +0100 Message-Id: <20200106144206.698920-17-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: kaXbUbqCM9OGae6pO8v_Fw-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Blindly overriding IMGOPTS is suboptimal as this discards user-specified options. Whatever options the test needs should simply be appended. Some tests do this (with IMGOPTS=3D$(_optstr_add "$IMGOPTS" "...")), but that is cumbersome. It=E2=80=99s simpler to just give _make_test_img an -o parameter with which tests can add options. Some tests actually must override the user-specified options, though, for example when creating an image in a different format than the test $IMGFMT. For such cases, --no-opts allows clearing the current option list. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-10-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/common.rc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index f01165a66e..7d704f9573 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -308,6 +308,7 @@ _make_test_img() local use_backing=3D0 local backing_file=3D"" local object_options=3D"" + local opts_param=3Dfalse local misc_params=3D() =20 if [ -n "$TEST_IMG_FILE" ]; then @@ -328,6 +329,10 @@ _make_test_img() if [ "$use_backing" =3D "1" -a -z "$backing_file" ]; then backing_file=3D$param continue + elif $opts_param; then + optstr=3D$(_optstr_add "$optstr" "$param") + opts_param=3Dfalse + continue fi =20 case "$param" in @@ -335,6 +340,14 @@ _make_test_img() use_backing=3D1 ;; =20 + -o) + opts_param=3Dtrue + ;; + + --no-opts) + optstr=3D"" + ;; + *) misc_params=3D("${misc_params[@]}" "$param") ;; --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323023; cv=none; d=zohomail.com; s=zohoarc; b=QFRrsyqwYhSSNBTIO7hF2YPhnf8Hl9oU4vAfCdUZhWbttwvxb52rG8IcTWkv1JsBxvUIdmdY8IuJ87kIpsxTVg30Ha2m2pHMcj7LdZzMNCJkx6qq4iJrcHPyGh852V1LgTqlc1RVTWYYJu223PbEG+11dTJwJzEHsBxPI6Kzw9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323023; 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=a3yi+86XKGWerRekgayIoQ0UIxyR9uQYIXSVaTtp5bc=; b=a2ZIwr56rfEJs9+vPgWndb2Ji4wVCwgzHbtujKYha+DSjFcdW/Ip2KILIaG6HOR0qa78L1yNkO6nUsHqwGPsgzcRpSl5F3j3V/+dEDslQZTHlS1LiQBAIQEuqwILcRRW4rtN8NTphu9bTjXv53rRcpYEEe0heFl8jMQxfoIgOFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578323023538234.51676736300408; Mon, 6 Jan 2020 07:03:43 -0800 (PST) Received: from localhost ([::1]:53094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTuv-000757-JH for importer@patchew.org; Mon, 06 Jan 2020 10:03:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43756) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTb7-0006Ze-0X for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTb6-0000P5-2S for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:12 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:53481 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 1ioTb5-0000Nh-UY for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-368-uCWCR4z_Mei5AjSMZ-wKHA-1; Mon, 06 Jan 2020 09:43:08 -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 22A551118E16; Mon, 6 Jan 2020 14:43:07 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98D706A83B; Mon, 6 Jan 2020 14:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321791; 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=a3yi+86XKGWerRekgayIoQ0UIxyR9uQYIXSVaTtp5bc=; b=fU8EOLZ8W8JWOUaw1HA5XNlFj8NKposxyOf4sBQkPVEiowabg8hTO93sPQiwqij+I79Nm/ Pk6rS8/ziv8wsXbLl2o8d8fixyZtnYv/Qr6nP+r1/nA2PWrF/bJDaJtjr7Om+5WnWXbZMs VNTtRx8zS65VOY70xPnGEFnfQj7R3kM= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 17/34] iotests: Inject space into -ocompat=0.10 in 051 Date: Mon, 6 Jan 2020 15:41:49 +0100 Message-Id: <20200106144206.698920-18-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: uCWCR4z_Mei5AjSMZ-wKHA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It did not matter before, but now that _make_test_img understands -o, we should use it properly here. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-11-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/051 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index a13bce2fd0..d7294d80d9 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -158,7 +158,7 @@ echo echo =3D=3D=3D With version 2 images enabling lazy refcounts must fail =3D= =3D=3D echo =20 -_make_test_img -ocompat=3D0.10 $size +_make_test_img -o compat=3D0.10 $size =20 run_qemu -drive file=3D"$TEST_IMG",format=3Dqcow2,lazy-refcounts=3Don run_qemu -drive file=3D"$TEST_IMG",format=3Dqcow2,lazy-refcounts=3Doff --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323258; cv=none; d=zohomail.com; s=zohoarc; b=Y70xZPmtAPCnrD31aHx5pghsJ8LYEh7Siy7Hg/CpR+jD8sbEwnemOZihcIuATYbSh+me3aNtTm5GWAyoegaf53xIEuC+0/wf9yVExv9iPS6rUpZJ2a4LVzcH3dD0DwNxzY4JFffL+HSNNQy2Egd+Qz3qm8tkPfWXmDkO95Idu2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323258; 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=M+Vg4Ktdxm5Fzke/GMloqwvv9jr5eqmyeAIOhwMZAF4=; b=lvWBvBXsyS9VXsw7TU+992X9cK0TgwG4WoEDzggh2qCWfnzpwMs8znSIRFrUAi7S4zwAgsJCdKOpkaNZP9cil991oEnwNt15bfpUVQaMTuWyMa7TwDUpMzX5o8dx35mC8jeRmWr1TzmlPZ3x4ix4W0QIRUYQoit48o6md8goSx0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157832325813669.77455664609965; Mon, 6 Jan 2020 07:07:38 -0800 (PST) Received: from localhost ([::1]:53154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTyi-0003FT-Iy for importer@patchew.org; Mon, 06 Jan 2020 10:07:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43835) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbD-0006iy-QZ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTb9-0000Rf-Oy for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:19 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:46269 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 1ioTb9-0000RU-IX for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-180-0tEg9cEWOginayVVakdP2Q-1; Mon, 06 Jan 2020 09:43:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A0598BAF61; Mon, 6 Jan 2020 14:43:10 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22A7860F82; Mon, 6 Jan 2020 14:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321795; 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=M+Vg4Ktdxm5Fzke/GMloqwvv9jr5eqmyeAIOhwMZAF4=; b=axGg6SgXGrX4SrrKkZDuZRkx0IxVUpU5tR7fRsMqbm9mW72zrSUPD1Qnhxx2Ka8tX8ujjF c9RzK4rYMuJyyTmWtHXenK5ZAiO5550LK5/fkrq4+QMDPOctYFlch8ZUhi+mPdH5EFR2/X NJUbsr/a9kkVC/vzNSTiglXJvwjS0Nk= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 18/34] iotests: Replace IMGOPTS= by -o Date: Mon, 6 Jan 2020 15:41:50 +0100 Message-Id: <20200106144206.698920-19-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: 0tEg9cEWOginayVVakdP2Q-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Tests should not overwrite all user-supplied image options, but only add to it (which will effectively overwrite conflicting values). Accomplish this by passing options to _make_test_img via -o instead of $IMGOPTS. For some tests, there is no functional change because they already only appended options to IMGOPTS. For these, this patch is just a simplification. For others, this is a change, so they now heed user-specified $IMGOPTS. Some of those tests do not work with all image options, though, so we need to disable them accordingly. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-12-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/031 | 9 ++++--- tests/qemu-iotests/039 | 24 ++++++------------ tests/qemu-iotests/059 | 18 ++++++------- tests/qemu-iotests/060 | 6 ++--- tests/qemu-iotests/061 | 57 ++++++++++++++++++++++-------------------- tests/qemu-iotests/079 | 3 +-- tests/qemu-iotests/106 | 2 +- tests/qemu-iotests/108 | 2 +- tests/qemu-iotests/112 | 32 ++++++++++++------------ tests/qemu-iotests/115 | 3 +-- tests/qemu-iotests/121 | 6 ++--- tests/qemu-iotests/125 | 2 +- tests/qemu-iotests/137 | 2 +- tests/qemu-iotests/138 | 3 +-- tests/qemu-iotests/175 | 2 +- tests/qemu-iotests/190 | 2 +- tests/qemu-iotests/191 | 3 +-- tests/qemu-iotests/220 | 4 ++- tests/qemu-iotests/243 | 6 +++-- tests/qemu-iotests/244 | 10 +++++--- tests/qemu-iotests/250 | 3 +-- tests/qemu-iotests/265 | 2 +- 22 files changed, 100 insertions(+), 101 deletions(-) diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031 index a3c25ec237..c44fcf91bb 100755 --- a/tests/qemu-iotests/031 +++ b/tests/qemu-iotests/031 @@ -40,19 +40,22 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file +# We want to test compat=3D0.10, which does not support refcount widths +# other than 16 +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' =20 CLUSTER_SIZE=3D65536 =20 # qcow2.py output depends on the exact options used, so override the comma= nd # line here as an exception -for IMGOPTS in "compat=3D0.10" "compat=3D1.1"; do +for compat in "compat=3D0.10" "compat=3D1.1"; do =20 echo - echo =3D=3D=3D=3D=3D Testing with -o $IMGOPTS =3D=3D=3D=3D=3D + echo =3D=3D=3D=3D=3D Testing with -o $compat =3D=3D=3D=3D=3D echo echo =3D=3D=3D Create image with unknown header extension =3D=3D=3D echo - _make_test_img 64M + _make_test_img -o $compat 64M $PYTHON qcow2.py "$TEST_IMG" add-header-ext 0x12345678 "This is a test= header extension" $PYTHON qcow2.py "$TEST_IMG" dump-header _check_test_img diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 325da63a4c..99563bf126 100755 --- a/tests/qemu-iotests/039 +++ b/tests/qemu-iotests/039 @@ -50,8 +50,7 @@ size=3D128M echo echo "=3D=3D Checking that image is clean on shutdown =3D=3D" =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" $size =20 $QEMU_IO -c "write -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io =20 @@ -62,8 +61,7 @@ _check_test_img echo echo "=3D=3D Creating a dirty image file =3D=3D" =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" $size =20 _NO_VALGRIND \ $QEMU_IO -c "write -P 0x5a 0 512" \ @@ -98,8 +96,7 @@ $QEMU_IO -c "read -P 0x5a 0 512" "$TEST_IMG" | _filter_qe= mu_io echo echo "=3D=3D Opening a dirty image read/write should repair it =3D=3D" =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" $size =20 _NO_VALGRIND \ $QEMU_IO -c "write -P 0x5a 0 512" \ @@ -117,8 +114,7 @@ $PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompa= tible_features echo echo "=3D=3D Creating an image file with lazy_refcounts=3Doff =3D=3D" =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Doff" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Doff" $size =20 _NO_VALGRIND \ $QEMU_IO -c "write -P 0x5a 0 512" \ @@ -132,11 +128,9 @@ _check_test_img echo echo "=3D=3D Committing to a backing file with lazy_refcounts=3Don =3D=3D" =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" -TEST_IMG=3D"$TEST_IMG".base _make_test_img $size +TEST_IMG=3D"$TEST_IMG".base _make_test_img -o "compat=3D1.1,lazy_refcounts= =3Don" $size =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don,backing_file=3D$TEST_IMG.base" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don,backing_file=3D$TEST_I= MG.base" $size =20 $QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG commit "$TEST_IMG" @@ -151,8 +145,7 @@ TEST_IMG=3D"$TEST_IMG".base _check_test_img echo echo "=3D=3D Changing lazy_refcounts setting at runtime =3D=3D" =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Doff" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Doff" $size =20 _NO_VALGRIND \ $QEMU_IO -c "reopen -o lazy-refcounts=3Don" \ @@ -164,8 +157,7 @@ $QEMU_IO -c "reopen -o lazy-refcounts=3Don" \ $PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features _check_test_img =20 -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" -_make_test_img $size +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" $size =20 _NO_VALGRIND \ $QEMU_IO -c "reopen -o lazy-refcounts=3Doff" \ diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 10bfbaecec..3941c3f0c2 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -70,18 +70,18 @@ poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\= x00\x00\x00" =20 echo echo "=3D=3D=3D Testing monolithicFlat creation and opening =3D=3D=3D" -IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 2G +_make_test_img -o "subformat=3DmonolithicFlat" 2G _img_info _cleanup_test_img =20 echo echo "=3D=3D=3D Testing monolithicFlat with zeroed_grain =3D=3D=3D" -IMGOPTS=3D"subformat=3DmonolithicFlat,zeroed_grain=3Don" _make_test_img 2G +_make_test_img -o "subformat=3DmonolithicFlat,zeroed_grain=3Don" 2G _cleanup_test_img =20 echo echo "=3D=3D=3D Testing big twoGbMaxExtentFlat =3D=3D=3D" -IMGOPTS=3D"subformat=3DtwoGbMaxExtentFlat" _make_test_img 1000G +_make_test_img -o "subformat=3DtwoGbMaxExtentFlat" 1000G $QEMU_IMG info $TEST_IMG | _filter_testdir | sed -e 's/cid: [0-9]*/cid: XX= XXXXXX/' _cleanup_test_img =20 @@ -101,13 +101,13 @@ _img_info =20 echo echo "=3D=3D=3D Testing truncated sparse =3D=3D=3D" -IMGOPTS=3D"subformat=3DmonolithicSparse" _make_test_img 100G +_make_test_img -o "subformat=3DmonolithicSparse" 100G truncate -s 10M $TEST_IMG _img_info =20 echo echo "=3D=3D=3D Converting to streamOptimized from image with small cluste= r size=3D=3D=3D" -TEST_IMG=3D"$TEST_IMG.qcow2" IMGFMT=3Dqcow2 IMGOPTS=3D"cluster_size=3D4096= " _make_test_img 1G +TEST_IMG=3D"$TEST_IMG.qcow2" IMGFMT=3Dqcow2 _make_test_img -o "cluster_siz= e=3D4096" 1G $QEMU_IO -f qcow2 -c "write -P 0xa 0 512" "$TEST_IMG.qcow2" | _filter_qemu= _io $QEMU_IO -f qcow2 -c "write -P 0xb 10240 512" "$TEST_IMG.qcow2" | _filter_= qemu_io $QEMU_IMG convert -f qcow2 -O vmdk -o subformat=3DstreamOptimized "$TEST_I= MG.qcow2" "$TEST_IMG" 2>&1 @@ -117,7 +117,7 @@ echo "=3D=3D=3D Testing monolithicFlat with internally = generated JSON file name =3D=3D=3D" =20 echo '--- blkdebug ---' # Should work, because bdrv_dirname() works fine with blkdebug -IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 64M +_make_test_img -o "subformat=3DmonolithicFlat" 64M $QEMU_IO -c "open -o driver=3D$IMGFMT,file.driver=3Dblkdebug,file.image.fi= lename=3D$TEST_IMG,file.inject-error.0.event=3Dread_aio" \ -c info \ 2>&1 \ @@ -126,7 +126,7 @@ _cleanup_test_img =20 echo '--- quorum ---' # Should not work, because bdrv_dirname() does not work with quorum -IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 64M +_make_test_img -o "subformat=3DmonolithicFlat" 64M cp "$TEST_IMG" "$TEST_IMG.orig" =20 filename=3D"json:{ @@ -161,7 +161,7 @@ _cleanup_test_img =20 echo echo "=3D=3D=3D Testing 4TB monolithicFlat creation and IO =3D=3D=3D" -IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 4T +_make_test_img -o "subformat=3DmonolithicFlat" 4T _img_info $QEMU_IO -c "write -P 0xa 900G 512" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "read -v 900G 1024" "$TEST_IMG" | _filter_qemu_io @@ -170,7 +170,7 @@ _cleanup_test_img echo echo "=3D=3D=3D Testing qemu-img map on extents =3D=3D=3D" for fmt in monolithicSparse twoGbMaxExtentSparse; do - IMGOPTS=3D"subformat=3D$fmt" _make_test_img 31G + _make_test_img -o "subformat=3D$fmt" 31G $QEMU_IO -c "write 65024 1k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "write 2147483136 1k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "write 5G 1k" "$TEST_IMG" | _filter_qemu_io diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index 932bc2f3f9..1411781618 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -161,7 +161,7 @@ $QEMU_IO -c 'write 0k 64k' "$BACKING_IMG" | _filter_qem= u_io # compat=3D0.10 is required in order to make the following discard actually # unallocate the sector rather than make it a zero sector - we want COW, a= fter # all. -IMGOPTS=3D'compat=3D0.10' _make_test_img -b "$BACKING_IMG" 1G +_make_test_img -o 'compat=3D0.10' -b "$BACKING_IMG" 1G # Write two clusters, the second one enforces creation of an L2 table after # the first data cluster. $QEMU_IO -c 'write 0k 64k' -c 'write 512M 64k' "$TEST_IMG" | _filter_qemu_= io @@ -401,7 +401,7 @@ echo echo "=3D=3D=3D Discarding a non-covered in-bounds refblock =3D=3D=3D" echo =20 -IMGOPTS=3D'refcount_bits=3D1' _make_test_img 64M +_make_test_img -o 'refcount_bits=3D1' 64M =20 # Pretend there's a refblock somewhere where there is no refblock to # cover it (but the covering refblock has a valid index in the @@ -425,7 +425,7 @@ echo echo "=3D=3D=3D Discarding a refblock covered by an unaligned refblock =3D= =3D=3D" echo =20 -IMGOPTS=3D'refcount_bits=3D1' _make_test_img 64M +_make_test_img -o 'refcount_bits=3D1' 64M =20 # Same as above poke_file "$TEST_IMG" "$(($rt_offset+8))" "\x00\x00\x00\x10\x00\x00\x00\x0= 0" diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index e1b8044630..2818c6a4a3 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -41,11 +41,14 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# Conversion between different compat versions can only really work +# with refcount_bits=3D16 +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' =20 echo echo "=3D=3D=3D Testing version downgrade with zero expansion =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" _make_test_img 64M +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io $PYTHON qcow2.py "$TEST_IMG" dump-header $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" @@ -56,7 +59,7 @@ _check_test_img echo echo "=3D=3D=3D Testing version downgrade with zero expansion and 4K cache= entries =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" _make_test_img 64M +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "write -z 32M 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c map "$TEST_IMG" | _filter_qemu_io @@ -72,7 +75,7 @@ _check_test_img echo echo "=3D=3D=3D Testing dirty version downgrade =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" _make_test_img 64M +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M _NO_VALGRIND \ $QEMU_IO -c "write -P 0x2a 0 128k" -c flush \ -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 | _filter_qemu_io @@ -85,7 +88,7 @@ _check_test_img echo echo "=3D=3D=3D Testing version downgrade with unknown compat/autoclear fl= ags =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" _make_test_img 64M +_make_test_img -o "compat=3D1.1" 64M $PYTHON qcow2.py "$TEST_IMG" set-feature-bit compatible 42 $PYTHON qcow2.py "$TEST_IMG" set-feature-bit autoclear 42 $PYTHON qcow2.py "$TEST_IMG" dump-header @@ -96,7 +99,7 @@ _check_test_img echo echo "=3D=3D=3D Testing version upgrade and resize =3D=3D=3D" echo -IMGOPTS=3D"compat=3D0.10" _make_test_img 64M +_make_test_img -o "compat=3D0.10" 64M $QEMU_IO -c "write -P 0x2a 42M 64k" "$TEST_IMG" | _filter_qemu_io $PYTHON qcow2.py "$TEST_IMG" dump-header $QEMU_IMG amend -o "compat=3D1.1,lazy_refcounts=3Don,size=3D128M" "$TEST_I= MG" @@ -107,7 +110,7 @@ _check_test_img echo echo "=3D=3D=3D Testing dirty lazy_refcounts=3Doff =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1,lazy_refcounts=3Don" _make_test_img 64M +_make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M _NO_VALGRIND \ $QEMU_IO -c "write -P 0x2a 0 128k" -c flush \ -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 | _filter_qemu_io @@ -120,8 +123,8 @@ _check_test_img echo echo "=3D=3D=3D Testing backing file =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" _make_test_img 64M -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M +_make_test_img -o "compat=3D1.1" 64M +TEST_IMG=3D"$TEST_IMG.base" _make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG amend -o "backing_file=3D$TEST_IMG.base,backing_fmt=3Dqcow2" "$T= EST_IMG" @@ -131,7 +134,7 @@ _check_test_img echo echo "=3D=3D=3D Testing invalid configurations =3D=3D=3D" echo -IMGOPTS=3D"compat=3D0.10" _make_test_img 64M +_make_test_img -o "compat=3D0.10" 64M $QEMU_IMG amend -o "lazy_refcounts=3Don" "$TEST_IMG" $QEMU_IMG amend -o "compat=3D1.1" "$TEST_IMG" # actually valid $QEMU_IMG amend -o "compat=3D0.10,lazy_refcounts=3Don" "$TEST_IMG" @@ -144,7 +147,7 @@ $QEMU_IMG amend -o "preallocation=3Don" "$TEST_IMG" echo echo "=3D=3D=3D Testing correct handling of unset value =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1,cluster_size=3D1k" _make_test_img 64M +_make_test_img -o "compat=3D1.1,cluster_size=3D1k" 64M echo "Should work:" $QEMU_IMG amend -o "lazy_refcounts=3Don" "$TEST_IMG" echo "Should not work:" # Just to know which of these tests actually fails @@ -153,7 +156,7 @@ $QEMU_IMG amend -o "cluster_size=3D64k" "$TEST_IMG" echo echo "=3D=3D=3D Testing zero expansion on inactive clusters =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" _make_test_img 64M +_make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG snapshot -c foo "$TEST_IMG" $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io @@ -167,7 +170,7 @@ $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qe= mu_io echo echo "=3D=3D=3D Testing zero expansion on shared L2 table =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" _make_test_img 64M +_make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG snapshot -c foo "$TEST_IMG" $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" @@ -180,9 +183,9 @@ $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qe= mu_io echo echo "=3D=3D=3D Testing zero expansion on backed image =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M +TEST_IMG=3D"$TEST_IMG.base" _make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io -IMGOPTS=3D"compat=3D1.1" _make_test_img -b "$TEST_IMG.base" 64M +_make_test_img -o "compat=3D1.1" -b "$TEST_IMG.base" 64M $QEMU_IO -c "read -P 0x2a 0 128k" -c "write -z 0 64k" "$TEST_IMG" | _filte= r_qemu_io $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" _check_test_img @@ -191,9 +194,9 @@ $QEMU_IO -c "read -P 0 0 64k" -c "read -P 0x2a 64k 64k"= "$TEST_IMG" | _filter_qe echo echo "=3D=3D=3D Testing zero expansion on backed inactive clusters =3D=3D= =3D" echo -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M +TEST_IMG=3D"$TEST_IMG.base" _make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io -IMGOPTS=3D"compat=3D1.1" _make_test_img -b "$TEST_IMG.base" 64M +_make_test_img -o "compat=3D1.1" -b "$TEST_IMG.base" 64M $QEMU_IO -c "write -z 0 64k" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG snapshot -c foo "$TEST_IMG" $QEMU_IO -c "write -P 0x42 0 128k" "$TEST_IMG" | _filter_qemu_io @@ -207,9 +210,9 @@ $QEMU_IO -c "read -P 0 0 64k" -c "read -P 0x2a 64k 64k"= "$TEST_IMG" | _filter_qe echo echo "=3D=3D=3D Testing zero expansion on backed image with shared L2 tabl= e =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M +TEST_IMG=3D"$TEST_IMG.base" _make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -P 0x2a 0 128k" "$TEST_IMG.base" | _filter_qemu_io -IMGOPTS=3D"compat=3D1.1" _make_test_img -b "$TEST_IMG.base" 64M +_make_test_img -o "compat=3D1.1" -b "$TEST_IMG.base" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG snapshot -c foo "$TEST_IMG" $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" @@ -222,7 +225,7 @@ $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qe= mu_io echo echo "=3D=3D=3D Testing preallocated zero expansion on full image =3D=3D= =3D" echo -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG" _make_test_img 64M +TEST_IMG=3D"$TEST_IMG" _make_test_img -o "compat=3D1.1" 64M $QEMU_IO -c "write -P 0x2a 0 64M" "$TEST_IMG" -c "write -z 0 64M" | _filte= r_qemu_io $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" _check_test_img @@ -231,8 +234,8 @@ $QEMU_IO -c "read -P 0 0 64M" "$TEST_IMG" | _filter_qem= u_io echo echo "=3D=3D=3D Testing progress report without snapshot =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG.base" _make_test_img 4G -IMGOPTS=3D"compat=3D1.1" _make_test_img -b "$TEST_IMG.base" 4G +TEST_IMG=3D"$TEST_IMG.base" _make_test_img -o "compat=3D1.1" 4G +_make_test_img -o "compat=3D1.1" -b "$TEST_IMG.base" 4G $QEMU_IO -c "write -z 0 64k" \ -c "write -z 1G 64k" \ -c "write -z 2G 64k" \ @@ -243,8 +246,8 @@ _check_test_img echo echo "=3D=3D=3D Testing progress report with snapshot =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" TEST_IMG=3D"$TEST_IMG.base" _make_test_img 4G -IMGOPTS=3D"compat=3D1.1" _make_test_img -b "$TEST_IMG.base" 4G +TEST_IMG=3D"$TEST_IMG.base" _make_test_img -o "compat=3D1.1" 4G +_make_test_img -o "compat=3D1.1" -b "$TEST_IMG.base" 4G $QEMU_IO -c "write -z 0 64k" \ -c "write -z 1G 64k" \ -c "write -z 2G 64k" \ @@ -256,7 +259,7 @@ _check_test_img echo echo "=3D=3D=3D Testing version downgrade with external data file =3D=3D= =3D" echo -IMGOPTS=3D"compat=3D1.1,data_file=3D$TEST_IMG.data" _make_test_img 64M +_make_test_img -o "compat=3D1.1,data_file=3D$TEST_IMG.data" 64M $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" _img_info --format-specific _check_test_img @@ -264,11 +267,11 @@ _check_test_img echo echo "=3D=3D=3D Try changing the external data file =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1" _make_test_img 64M +_make_test_img -o "compat=3D1.1" 64M $QEMU_IMG amend -o "data_file=3Dfoo" "$TEST_IMG" =20 echo -IMGOPTS=3D"compat=3D1.1,data_file=3D$TEST_IMG.data" _make_test_img 64M +_make_test_img -o "compat=3D1.1,data_file=3D$TEST_IMG.data" 64M $QEMU_IMG amend -o "data_file=3Dfoo" "$TEST_IMG" _img_info --format-specific TEST_IMG=3D"data-file.filename=3D$TEST_IMG.data,file.filename=3D$TEST_IMG"= _img_info --format-specific --image-opts @@ -281,7 +284,7 @@ TEST_IMG=3D"data-file.filename=3D$TEST_IMG.data,file.fi= lename=3D$TEST_IMG" _img_info - echo echo "=3D=3D=3D Clearing and setting data-file-raw =3D=3D=3D" echo -IMGOPTS=3D"compat=3D1.1,data_file=3D$TEST_IMG.data,data_file_raw=3Don" _ma= ke_test_img 64M +_make_test_img -o "compat=3D1.1,data_file=3D$TEST_IMG.data,data_file_raw= =3Don" 64M $QEMU_IMG amend -o "data_file_raw=3Don" "$TEST_IMG" _img_info --format-specific _check_test_img diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079 index 78536d3bbf..3642b51feb 100755 --- a/tests/qemu-iotests/079 +++ b/tests/qemu-iotests/079 @@ -47,8 +47,7 @@ echo cluster_sizes=3D"16384 32768 65536 131072 262144 524288 1048576 2097152 41= 94304" =20 for s in $cluster_sizes; do - IMGOPTS=3D$(_optstr_add "$IMGOPTS" "preallocation=3Dmetadata,cluster_s= ize=3D$s") \ - _make_test_img 4G + _make_test_img -o "preallocation=3Dmetadata,cluster_size=3D$s" 4G done =20 # success, all done diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106 index ac47eaa0f5..b5d1ec4078 100755 --- a/tests/qemu-iotests/106 +++ b/tests/qemu-iotests/106 @@ -51,7 +51,7 @@ for create_mode in off falloc full; do echo echo "--- create_mode=3D$create_mode growth_mode=3D$growth_mode --= -" =20 - IMGOPTS=3D"preallocation=3D$create_mode" _make_test_img ${CREATION= _SIZE}K + _make_test_img -o "preallocation=3D$create_mode" ${CREATION_SIZE}K $QEMU_IMG resize -f "$IMGFMT" --preallocation=3D$growth_mode "$TES= T_IMG" +${GROWTH_SIZE}K =20 expected_size=3D0 diff --git a/tests/qemu-iotests/108 b/tests/qemu-iotests/108 index 872a9afec9..3324c86b5f 100755 --- a/tests/qemu-iotests/108 +++ b/tests/qemu-iotests/108 @@ -65,7 +65,7 @@ echo echo '=3D=3D=3D Repairing unreferenced data cluster in new refblock area = =3D=3D=3D' echo =20 -IMGOPTS=3D'cluster_size=3D512' _make_test_img 64M +_make_test_img -o 'cluster_size=3D512' 64M # Allocate the first 128 kB in the image (first refblock) $QEMU_IO -c 'write 0 0x1b200' "$TEST_IMG" | _filter_qemu_io # should be 131072 =3D=3D 0x20000 diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112 index 706c10b600..6850225939 100755 --- a/tests/qemu-iotests/112 +++ b/tests/qemu-iotests/112 @@ -53,20 +53,20 @@ echo '=3D=3D=3D refcount_bits limits =3D=3D=3D' echo =20 # Must be positive (non-zero) -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D0" _make_test_img 64M +_make_test_img -o "refcount_bits=3D0" 64M # Must be positive (non-negative) -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D-1" _make_test_img 64M +_make_test_img -o "refcount_bits=3D-1" 64M # May not exceed 64 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D128" _make_test_img 64M +_make_test_img -o "refcount_bits=3D128" 64M # Must be a power of two -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D42" _make_test_img 64M +_make_test_img -o "refcount_bits=3D42" 64M =20 # 1 is the minimum -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D1" _make_test_img 64M +_make_test_img -o "refcount_bits=3D1" 64M print_refcount_bits =20 # 64 is the maximum -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D64" _make_test_img 64M +_make_test_img -o "refcount_bits=3D64" 64M print_refcount_bits =20 # 16 is the default @@ -78,19 +78,19 @@ echo '=3D=3D=3D refcount_bits and compat=3D0.10 =3D=3D= =3D' echo =20 # Should work -IMGOPTS=3D"$IMGOPTS,compat=3D0.10,refcount_bits=3D16" _make_test_img 64M +_make_test_img -o "compat=3D0.10,refcount_bits=3D16" 64M print_refcount_bits =20 # Should not work -IMGOPTS=3D"$IMGOPTS,compat=3D0.10,refcount_bits=3D1" _make_test_img 64M -IMGOPTS=3D"$IMGOPTS,compat=3D0.10,refcount_bits=3D64" _make_test_img 64M +_make_test_img -o "compat=3D0.10,refcount_bits=3D1" 64M +_make_test_img -o "compat=3D0.10,refcount_bits=3D64" 64M =20 =20 echo echo '=3D=3D=3D Snapshot limit on refcount_bits=3D1 =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D1" _make_test_img 64M +_make_test_img -o "refcount_bits=3D1" 64M print_refcount_bits =20 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -106,7 +106,7 @@ echo echo '=3D=3D=3D Snapshot limit on refcount_bits=3D2 =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D2" _make_test_img 64M +_make_test_img -o "refcount_bits=3D2" 64M print_refcount_bits =20 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -124,7 +124,7 @@ echo echo '=3D=3D=3D Compressed clusters with refcount_bits=3D1 =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D1" _make_test_img 64M +_make_test_img -o "refcount_bits=3D1" 64M print_refcount_bits =20 # Both should fit into a single host cluster; instead of failing to increa= se the @@ -140,7 +140,7 @@ echo echo '=3D=3D=3D MSb set in 64 bit refcount =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D64" _make_test_img 64M +_make_test_img -o "refcount_bits=3D64" 64M print_refcount_bits =20 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -158,7 +158,7 @@ echo echo '=3D=3D=3D Snapshot on maximum 64 bit refcount value =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D64" _make_test_img 64M +_make_test_img -o "refcount_bits=3D64" 64M print_refcount_bits =20 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io @@ -239,7 +239,7 @@ echo echo '=3D=3D=3D Testing too many references for check =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D1" _make_test_img 64M +_make_test_img -o "refcount_bits=3D1" 64M print_refcount_bits =20 # This cluster should be created at 0x50000 @@ -262,7 +262,7 @@ echo echo '=3D=3D=3D Multiple walks necessary during amend =3D=3D=3D' echo =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D1,cluster_size=3D512" _make_test_img 6= 4k +_make_test_img -o "refcount_bits=3D1,cluster_size=3D512" 64k =20 # Cluster 0 is the image header, clusters 1 to 4 are used by the L1 table,= a # single L2 table, the reftable and a single refblock. This creates 58 data diff --git a/tests/qemu-iotests/115 b/tests/qemu-iotests/115 index 9ed3cb6a83..d254b18342 100755 --- a/tests/qemu-iotests/115 +++ b/tests/qemu-iotests/115 @@ -64,8 +64,7 @@ echo # least 256 MB. We can achieve that by using preallocation=3Dmetadata for = an image # which has a guest disk size of 256 MB. =20 -IMGOPTS=3D"$IMGOPTS,refcount_bits=3D64,cluster_size=3D512,preallocation=3D= metadata" \ - _make_test_img 256M +_make_test_img -o "refcount_bits=3D64,cluster_size=3D512,preallocation=3Dm= etadata" 256M =20 # We know for sure that the L1 and refcount tables do not overlap with any= other # structure because the metadata overlap checks would have caught that cas= e. diff --git a/tests/qemu-iotests/121 b/tests/qemu-iotests/121 index 90a0424edb..10db813d94 100755 --- a/tests/qemu-iotests/121 +++ b/tests/qemu-iotests/121 @@ -50,7 +50,7 @@ echo # Preallocation speeds up the write operation, but preallocating everythin= g will # destroy the purpose of the write; so preallocate one KB less than what w= ould # cause a reftable growth... -IMGOPTS=3D'preallocation=3Dmetadata,cluster_size=3D1k' _make_test_img 6451= 2K +_make_test_img -o 'preallocation=3Dmetadata,cluster_size=3D1k' 64512K # ...and make the image the desired size afterwards. $QEMU_IMG resize "$TEST_IMG" 65M =20 @@ -73,7 +73,7 @@ echo echo '--- Test 2 ---' echo =20 -IMGOPTS=3D'preallocation=3Dmetadata,cluster_size=3D1k' _make_test_img 6451= 3K +_make_test_img -o 'preallocation=3Dmetadata,cluster_size=3D1k' 64513K # This results in an L1 table growth which in turn results in some cluster= s at # the start of the image becoming free $QEMU_IMG resize "$TEST_IMG" 65M @@ -96,7 +96,7 @@ echo echo '=3D=3D=3D Allocating a new refcount block must not leave holes in th= e image =3D=3D=3D' echo =20 -IMGOPTS=3D'cluster_size=3D512,refcount_bits=3D16' _make_test_img 1M +_make_test_img -o 'cluster_size=3D512,refcount_bits=3D16' 1M =20 # This results in an image with 256 used clusters: the qcow2 header, # the refcount table, one refcount block, the L1 table, four L2 tables diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125 index 4e31aa4e5f..d510984045 100755 --- a/tests/qemu-iotests/125 +++ b/tests/qemu-iotests/125 @@ -114,7 +114,7 @@ for GROWTH_SIZE in 16 48 80; do for growth_mode in off metadata falloc full; do echo "--- cluster_size=3D$cluster_size growth_size=3D$GROWTH_S= IZE create_mode=3D$create_mode growth_mode=3D$growth_mode ---" =20 - IMGOPTS=3D"preallocation=3D$create_mode,cluster_size=3D$cluste= r_size" _make_test_img ${CREATION_SIZE} + _make_test_img -o "preallocation=3D$create_mode,cluster_size= =3D$cluster_size" ${CREATION_SIZE} $QEMU_IMG resize -f "$IMGFMT" --preallocation=3D$growth_mode "= $TEST_IMG" +${GROWTH_SIZE}K =20 host_size_0=3D$(get_image_size_on_host) diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 index 089821da0c..6cf2997577 100755 --- a/tests/qemu-iotests/137 +++ b/tests/qemu-iotests/137 @@ -117,7 +117,7 @@ $QEMU_IO \ -c "reopen -o cache-clean-interval=3D-1" \ "$TEST_IMG" | _filter_qemu_io =20 -IMGOPTS=3D"cluster_size=3D256k" _make_test_img 32P +_make_test_img -o "cluster_size=3D256k" 32P $QEMU_IO \ -c "reopen -o l2-cache-entry-size=3D512,l2-cache-size=3D1T" \ "$TEST_IMG" | _filter_qemu_io diff --git a/tests/qemu-iotests/138 b/tests/qemu-iotests/138 index 8b2f587af0..26d18ac8b6 100755 --- a/tests/qemu-iotests/138 +++ b/tests/qemu-iotests/138 @@ -45,8 +45,7 @@ echo echo '=3D=3D=3D Check on an image with a multiple of 2^32 clusters =3D=3D= =3D' echo =20 -IMGOPTS=3D$(_optstr_add "$IMGOPTS" "cluster_size=3D512") \ - _make_test_img 512 +_make_test_img -o "cluster_size=3D512" 512 =20 # Allocate L2 table $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io diff --git a/tests/qemu-iotests/175 b/tests/qemu-iotests/175 index 55db2803ed..020ed8e61f 100755 --- a/tests/qemu-iotests/175 +++ b/tests/qemu-iotests/175 @@ -95,7 +95,7 @@ stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_bloc= ks $extra_blocks $min_block for mode in off full falloc; do echo echo "=3D=3D creating image with preallocation $mode =3D=3D" - IMGOPTS=3Dpreallocation=3D$mode _make_test_img $size | _filter_imgfmt + _make_test_img -o preallocation=3D$mode $size | _filter_imgfmt stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blo= cks $min_blocks $size done =20 diff --git a/tests/qemu-iotests/190 b/tests/qemu-iotests/190 index eb766ad09f..5890ff9cfc 100755 --- a/tests/qemu-iotests/190 +++ b/tests/qemu-iotests/190 @@ -45,7 +45,7 @@ _supported_proto file echo "=3D=3D Huge file =3D=3D" echo =20 -IMGOPTS=3D'cluster_size=3D2M' _make_test_img 2T +_make_test_img -o 'cluster_size=3D2M' 2T =20 $QEMU_IMG measure -O raw -f qcow2 "$TEST_IMG" $QEMU_IMG measure -O qcow2 -o cluster_size=3D64k -f qcow2 "$TEST_IMG" diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191 index 528022e8d8..21c16a32cb 100755 --- a/tests/qemu-iotests/191 +++ b/tests/qemu-iotests/191 @@ -51,8 +51,7 @@ echo =3D=3D=3D Preparing and starting VM =3D=3D=3D echo =20 TEST_IMG=3D"${TEST_IMG}.base" _make_test_img $size -IMGOPTS=3D$(_optstr_add "$IMGOPTS" "backing_fmt=3D$IMGFMT") \ - TEST_IMG=3D"${TEST_IMG}.mid" _make_test_img -b "${TEST_IMG}.base" +TEST_IMG=3D"${TEST_IMG}.mid" _make_test_img -o "backing_fmt=3D$IMGFMT" -b = "${TEST_IMG}.base" _make_test_img -b "${TEST_IMG}.mid" TEST_IMG=3D"${TEST_IMG}.ovl2" _make_test_img -b "${TEST_IMG}.mid" =20 diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220 index 15159270d3..3f86f24c4d 100755 --- a/tests/qemu-iotests/220 +++ b/tests/qemu-iotests/220 @@ -37,6 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# To use a different refcount width but 16 bits we need compat=3D1.1 +_unsupported_imgopts 'compat=3D0.10' =20 echo "=3D=3D Creating huge file =3D=3D" =20 @@ -44,7 +46,7 @@ echo "=3D=3D Creating huge file =3D=3D" # of a HUGE (but very sparse) file. tmpfs works, ext4 does not. _require_large_file 513T =20 -IMGOPTS=3D'cluster_size=3D2M,refcount_bits=3D1' _make_test_img 513T +_make_test_img -o 'cluster_size=3D2M,refcount_bits=3D1' 513T =20 echo "=3D=3D Populating refcounts =3D=3D" # We want an image with 256M refcounts * 2M clusters =3D 512T referenced. diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243 index e563761307..2b84b896db 100755 --- a/tests/qemu-iotests/243 +++ b/tests/qemu-iotests/243 @@ -40,6 +40,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# External data files do not work with compat=3D0.10 +_unsupported_imgopts 'compat=3D0.10' =20 for mode in off metadata falloc full; do =20 @@ -47,7 +49,7 @@ for mode in off metadata falloc full; do echo "=3D=3D=3D preallocation=3D$mode =3D=3D=3D" echo =20 - IMGOPTS=3D"preallocation=3D$mode" _make_test_img 64M + _make_test_img -o "preallocation=3D$mode" 64M =20 printf "File size: " du -b $TEST_IMG | cut -f1 @@ -64,7 +66,7 @@ for mode in off metadata falloc full; do echo "=3D=3D=3D External data file: preallocation=3D$mode =3D=3D=3D" echo =20 - IMGOPTS=3D"data_file=3D$TEST_IMG.data,preallocation=3D$mode" _make_tes= t_img 64M + _make_test_img -o "data_file=3D$TEST_IMG.data,preallocation=3D$mode" 6= 4M =20 echo -n "qcow2 file size: " du -b $TEST_IMG | cut -f1 diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244 index 13978f93d2..0375bc12d4 100755 --- a/tests/qemu-iotests/244 +++ b/tests/qemu-iotests/244 @@ -41,13 +41,15 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# External data files do not work with compat=3D0.10 +_unsupported_imgopts 'compat=3D0.10' =20 echo echo "=3D=3D=3D Create and open image with external data file =3D=3D=3D" echo =20 echo "With data file name in the image:" -IMGOPTS=3D"data_file=3D$TEST_IMG.data" _make_test_img 64M +_make_test_img -o "data_file=3D$TEST_IMG.data" 64M _check_test_img =20 $QEMU_IO -c "open $TEST_IMG" -c "read -P 0 0 64k" 2>&1 | _filter_qemu_io |= _filter_testdir @@ -104,7 +106,7 @@ echo echo "=3D=3D=3D Standalone image with external data file (efficient) =3D= =3D=3D" echo =20 -IMGOPTS=3D"data_file=3D$TEST_IMG.data" _make_test_img 64M +_make_test_img -o "data_file=3D$TEST_IMG.data" 64M =20 echo -n "qcow2 file size before I/O: " du -b $TEST_IMG | cut -f1 @@ -154,7 +156,7 @@ echo echo "=3D=3D=3D Standalone image with external data file (valid raw) =3D= =3D=3D" echo =20 -IMGOPTS=3D"data_file=3D$TEST_IMG.data,data_file_raw=3Don" _make_test_img 6= 4M +_make_test_img -o "data_file=3D$TEST_IMG.data,data_file_raw=3Don" 64M =20 echo -n "qcow2 file size before I/O: " du -b $TEST_IMG | cut -f1 @@ -187,7 +189,7 @@ echo echo "=3D=3D=3D bdrv_co_block_status test for file and offset=3D0 =3D=3D= =3D" echo =20 -IMGOPTS=3D"data_file=3D$TEST_IMG.data" _make_test_img 64M +_make_test_img -o "data_file=3D$TEST_IMG.data" 64M =20 $QEMU_IO -c 'write -P 0x11 0 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c 'read -P 0x11 0 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io diff --git a/tests/qemu-iotests/250 b/tests/qemu-iotests/250 index c9c0a84a5a..670cf19076 100755 --- a/tests/qemu-iotests/250 +++ b/tests/qemu-iotests/250 @@ -55,9 +55,8 @@ disk_usage() } =20 size=3D2100M -IMGOPTS=3D"cluster_size=3D1M,preallocation=3Dmetadata" =20 -_make_test_img $size +_make_test_img -o "cluster_size=3D1M,preallocation=3Dmetadata" $size $QEMU_IO -c 'discard 0 10M' -c 'discard 2090M 10M' \ -c 'write 2090M 10M' -c 'write 0 10M' "$TEST_IMG" | _filter_qemu_= io =20 diff --git a/tests/qemu-iotests/265 b/tests/qemu-iotests/265 index dce6f77be3..00f2ec769e 100755 --- a/tests/qemu-iotests/265 +++ b/tests/qemu-iotests/265 @@ -41,7 +41,7 @@ _supported_os Linux echo '--- Writing to the image ---' =20 # Reduce cluster size so we get more and quicker I/O -IMGOPTS=3D'cluster_size=3D4096' _make_test_img 1M +_make_test_img -o 'cluster_size=3D4096' 1M (for ((kb =3D 1024 - 4; kb >=3D 0; kb -=3D 4)); do \ echo "aio_write -P 42 $((kb + 1))k 2k"; \ done) \ --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323321; cv=none; d=zohomail.com; s=zohoarc; b=OZWIrr6jLutIbdWuCR1rerIfXoc5IpeM2feTAgNHuMLumPrTcbmJDfGH1zE1v6/bO/er8ltn2dD23neohEVcUbf5Uf9T7IcI9Jd75rutPKqri5i4xbsS4GK5J+vIttIPSijf4YU1Qd6KYChVaZ5tBMQbpFV9abzmoLBFszRPvYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323321; 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=PAprYsSNKNWg+RLPE+Omr/EUEUPxWmJvi1bSvNCB3/8=; b=WOy1j5D+ytVIUyLiA5fhjHT5Cx5onuse9zFJNGXKZAsOKq96x1WhwSEIqucUAp4gUkF/VTBr6GZq/Yqil7W6+Db4Eyljq3cR9elwvuN+SgQKcxX7i4QRcKl5gs2fGp2E8rtKMV2FAvYak8S66ck8GxClvzAnHnh8jCubAK1y7rI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578323321566904.359298878727; Mon, 6 Jan 2020 07:08:41 -0800 (PST) Received: from localhost ([::1]:53160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTzk-0004y2-1e for importer@patchew.org; Mon, 06 Jan 2020 10:08:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43879) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbG-0006mg-9h for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbF-0000Wg-0V for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:22 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:57544 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 1ioTbE-0000Vh-S3 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-32-MG5gnB3gNA2MwQN6JcMdGQ-1; Mon, 06 Jan 2020 09:43:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1938E1089E03; Mon, 6 Jan 2020 14:43:13 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B22E2100164D; Mon, 6 Jan 2020 14:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321800; 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=PAprYsSNKNWg+RLPE+Omr/EUEUPxWmJvi1bSvNCB3/8=; b=HCR0XwBrNiG2MiL38Wg/FjeYNNGy/DgIQml3Um7EWGtiBrd8IeF6EQh7RNVYqpL7MU7+/u oAT69F+nT+QDNhtUZgWneIdhKkMvQkQD3mEX2BpiS5QhQR5E8KEiNuFe6hnXCaNacqVIdc 6+A8I1w7IzDRXEch8vx+VbSG1zDjOcc= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 19/34] iotests: Replace IMGOPTS='' by --no-opts Date: Mon, 6 Jan 2020 15:41:51 +0100 Message-Id: <20200106144206.698920-20-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: MG5gnB3gNA2MwQN6JcMdGQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-13-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/071 | 4 ++-- tests/qemu-iotests/174 | 2 +- tests/qemu-iotests/178 | 4 ++-- tests/qemu-iotests/197 | 4 ++-- tests/qemu-iotests/215 | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071 index fab526666b..4e31943244 100755 --- a/tests/qemu-iotests/071 +++ b/tests/qemu-iotests/071 @@ -58,7 +58,7 @@ echo echo "=3D=3D=3D Testing blkverify through filename =3D=3D=3D" echo =20 -TEST_IMG=3D"$TEST_IMG.base" IMGOPTS=3D"" IMGFMT=3D"raw" _make_test_img $IM= G_SIZE |\ +TEST_IMG=3D"$TEST_IMG.base" IMGFMT=3D"raw" _make_test_img --no-opts $IMG_S= IZE |\ _filter_imgfmt _make_test_img $IMG_SIZE $QEMU_IO -c "open -o driver=3Draw,file.driver=3Dblkverify,file.raw.filenam= e=3D$TEST_IMG.base $TEST_IMG" \ @@ -73,7 +73,7 @@ echo echo "=3D=3D=3D Testing blkverify through file blockref =3D=3D=3D" echo =20 -TEST_IMG=3D"$TEST_IMG.base" IMGOPTS=3D"" IMGFMT=3D"raw" _make_test_img $IM= G_SIZE |\ +TEST_IMG=3D"$TEST_IMG.base" IMGFMT=3D"raw" _make_test_img --no-opts $IMG_S= IZE |\ _filter_imgfmt _make_test_img $IMG_SIZE $QEMU_IO -c "open -o driver=3Draw,file.driver=3Dblkverify,file.raw.filenam= e=3D$TEST_IMG.base,file.test.driver=3D$IMGFMT,file.test.file.filename=3D$TE= ST_IMG" \ diff --git a/tests/qemu-iotests/174 b/tests/qemu-iotests/174 index 0a952a73fd..e2f14a38c6 100755 --- a/tests/qemu-iotests/174 +++ b/tests/qemu-iotests/174 @@ -40,7 +40,7 @@ _unsupported_fmt raw =20 =20 size=3D256K -IMGFMT=3Draw IMGKEYSECRET=3D IMGOPTS=3D _make_test_img $size | _filter_img= fmt +IMGFMT=3Draw IMGKEYSECRET=3D _make_test_img --no-opts $size | _filter_imgf= mt =20 echo echo "=3D=3D reading wrong format should fail =3D=3D" diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178 index 21231cadd3..75b5e8f314 100755 --- a/tests/qemu-iotests/178 +++ b/tests/qemu-iotests/178 @@ -62,8 +62,8 @@ $QEMU_IMG measure -O foo "$TEST_IMG" # unknown image file= format =20 make_test_img_with_fmt() { # Shadow global variables within this function - local IMGFMT=3D"$1" IMGOPTS=3D"" - _make_test_img "$2" + local IMGFMT=3D"$1" + _make_test_img --no-opts "$2" } =20 qemu_io_with_fmt() { diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197 index 1d4f6786db..4d3d08ad6f 100755 --- a/tests/qemu-iotests/197 +++ b/tests/qemu-iotests/197 @@ -66,8 +66,8 @@ if [ "$IMGFMT" =3D "vpc" ]; then fi _make_test_img 4G $QEMU_IO -c "write -P 55 3G 1k" "$TEST_IMG" | _filter_qemu_io -IMGPROTO=3Dfile IMGFMT=3Dqcow2 IMGOPTS=3D TEST_IMG_FILE=3D"$TEST_WRAP" \ - _make_test_img -F "$IMGFMT" -b "$TEST_IMG" | _filter_img_create +IMGPROTO=3Dfile IMGFMT=3Dqcow2 TEST_IMG_FILE=3D"$TEST_WRAP" \ + _make_test_img --no-opts -F "$IMGFMT" -b "$TEST_IMG" | _filter_img_cre= ate $QEMU_IO -f qcow2 -c "write -z -u 1M 64k" "$TEST_WRAP" | _filter_qemu_io =20 # Ensure that a read of two clusters, but where one is already allocated, diff --git a/tests/qemu-iotests/215 b/tests/qemu-iotests/215 index 2eb377d682..55a1874dcd 100755 --- a/tests/qemu-iotests/215 +++ b/tests/qemu-iotests/215 @@ -63,8 +63,8 @@ if [ "$IMGFMT" =3D "vpc" ]; then fi _make_test_img 4G $QEMU_IO -c "write -P 55 3G 1k" "$TEST_IMG" | _filter_qemu_io -IMGPROTO=3Dfile IMGFMT=3Dqcow2 IMGOPTS=3D TEST_IMG_FILE=3D"$TEST_WRAP" \ - _make_test_img -F "$IMGFMT" -b "$TEST_IMG" | _filter_img_create +IMGPROTO=3Dfile IMGFMT=3Dqcow2 TEST_IMG_FILE=3D"$TEST_WRAP" \ + _make_test_img --no-opts -F "$IMGFMT" -b "$TEST_IMG" | _filter_img_cre= ate $QEMU_IO -f qcow2 -c "write -z -u 1M 64k" "$TEST_WRAP" | _filter_qemu_io =20 # Ensure that a read of two clusters, but where one is already allocated, --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322166; cv=none; d=zohomail.com; s=zohoarc; b=iSaqlEMfD6h/0er3XsfNyXB57dpIto4aFh6r6TEX0mrUW5Pao5R1zHhbLpHt5om3RnT4tmYNBlSEqC6qeRSFBnrRSEyLSjEawh0RhZWTyDwsSxAEPl3rXJ9lDPLo6lrKTZs5Lj4K8rwL/m6J6R54WGPDJdCOlabLIXwt5s+fXGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322166; 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=bLiYj6BXkPYmDRDPIGzY1HHWOR+4yjYppQp72ysdNJc=; b=SavGJNAhhdS/+OSM8cqu1GTmNK/bbG1e5NQR15EMTM82sp+08BGvGr8U0BMmTrT+zfnA9onOZGNZ/sWIBnWW8YeXu0mPetYYdSu65jR794QgFePYGQ2H4u1cPxzA/qso/yuyWeDf2mi7aBvq1brMfxumcsfF5TgKraKzo5IiL74= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157832216643688.70941813847082; Mon, 6 Jan 2020 06:49:26 -0800 (PST) Received: from localhost ([::1]:52870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTh6-0004wd-Pw for importer@patchew.org; Mon, 06 Jan 2020 09:49:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43841) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbE-0006jT-52 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbD-0000U6-0b for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:19 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:40901 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 1ioTbC-0000Tp-Sl for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-132-Xss0MI4xOBKUcOEtrf1LtA-1; Mon, 06 Jan 2020 09:43:17 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 06BF55B37C; Mon, 6 Jan 2020 14:43:16 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A067210840F1; Mon, 6 Jan 2020 14:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321798; 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=bLiYj6BXkPYmDRDPIGzY1HHWOR+4yjYppQp72ysdNJc=; b=hREzr7g8YRtA36wgPaJqJadIadogcjQhRUW8gSPeYmiBXYG7lYe4JQD77pVZKFooTnZqvY cy8648csVktpVlA5bDsX9wDLGVSktwzo4YwylSvl4+ScvC8EX9mX72SeIXvlWOkDil2xis j8Szj5o5IX1DZkR8yji8gIsUiejm3z8= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 20/34] iotests: Drop IMGOPTS use in 267 Date: Mon, 6 Jan 2020 15:41:52 +0100 Message-Id: <20200106144206.698920-21-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: Xss0MI4xOBKUcOEtrf1LtA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Overwriting IMGOPTS means ignoring all user-supplied options, which is not what we want. Replace the current IMGOPTS use by a new BACKING_FILE variable. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-14-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/267 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/267 b/tests/qemu-iotests/267 index b823668e29..bd9a5c5524 100755 --- a/tests/qemu-iotests/267 +++ b/tests/qemu-iotests/267 @@ -69,7 +69,11 @@ size=3D128M =20 run_test() { - _make_test_img $size + if [ -n "$BACKING_FILE" ]; then + _make_test_img -b "$BACKING_FILE" $size + else + _make_test_img $size + fi printf "savevm snap0\ninfo snapshots\nloadvm snap0\n" | run_qemu "$@" = | _filter_date } =20 @@ -120,12 +124,12 @@ echo =20 TEST_IMG=3D"$TEST_IMG.base" _make_test_img $size =20 -IMGOPTS=3D"backing_file=3D$TEST_IMG.base" \ +BACKING_FILE=3D"$TEST_IMG.base" \ run_test -blockdev driver=3Dfile,filename=3D"$TEST_IMG.base",node-name=3Db= acking-file \ -blockdev driver=3Dfile,filename=3D"$TEST_IMG",node-name=3Dfile \ -blockdev driver=3D$IMGFMT,file=3Dfile,backing=3Dbacking-file,nod= e-name=3Dfmt =20 -IMGOPTS=3D"backing_file=3D$TEST_IMG.base" \ +BACKING_FILE=3D"$TEST_IMG.base" \ run_test -blockdev driver=3Dfile,filename=3D"$TEST_IMG.base",node-name=3Db= acking-file \ -blockdev driver=3D$IMGFMT,file=3Dbacking-file,node-name=3Dbackin= g-fmt \ -blockdev driver=3Dfile,filename=3D"$TEST_IMG",node-name=3Dfile \ @@ -142,7 +146,7 @@ echo echo "=3D=3D=3D -blockdev with NBD server on the backing file =3D=3D=3D" echo =20 -IMGOPTS=3D"backing_file=3D$TEST_IMG.base" _make_test_img $size +_make_test_img -b "$TEST_IMG.base" $size cat < (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 15783234187251.8610571189535676; Mon, 6 Jan 2020 07:10:18 -0800 (PST) Received: from localhost ([::1]:53196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioU1J-00075Q-3p for importer@patchew.org; Mon, 06 Jan 2020 10:10:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43940) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbI-0006qT-Se for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbH-0000ZH-Hf for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:24 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:28722 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 1ioTbH-0000Ys-Ea for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:23 -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-265-zxsGfi1kP32qTrhBFcDqXQ-1; Mon, 06 Jan 2020 09:43:19 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B624B19057D1; Mon, 6 Jan 2020 14:43:18 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FD0E100164D; Mon, 6 Jan 2020 14:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321803; 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=3gHujdJjM41RdpbjEmSonadhyx8lYjVR+tHuzN4sg8Y=; b=bXi1GkUdTHkCHsjAveD7Uj7BhXrz/V3fKeXVWKP/ARXucDT2HZzQOoP7bgGFn5dGxOJrqZ 77JJmm61T3d1s7aJTbTkJyegEuybu31JFKzZm9USYCYtFfbkgaKQpHhSe/yFRjcD1hRsx9 SzTplj2QqcqG9kjYZ97BSwUu43bbyWA= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 21/34] iotests: Avoid qemu-img create Date: Mon, 6 Jan 2020 15:41:53 +0100 Message-Id: <20200106144206.698920-22-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: zxsGfi1kP32qTrhBFcDqXQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Use _make_test_img whenever possible. This way, we will not ignore user-specified image options. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-15-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/094 | 2 +- tests/qemu-iotests/111 | 3 +-- tests/qemu-iotests/123 | 2 +- tests/qemu-iotests/153 | 2 +- tests/qemu-iotests/200 | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094 index 9343e09492..d645952d54 100755 --- a/tests/qemu-iotests/094 +++ b/tests/qemu-iotests/094 @@ -45,7 +45,7 @@ _supported_proto nbd _unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" =20 _make_test_img 64M -$QEMU_IMG create -f $IMGFMT "$TEST_DIR/source.$IMGFMT" 64M | _filter_img_c= reate +TEST_IMG_FILE=3D"$TEST_DIR/source.$IMGFMT" IMGPROTO=3Dfile _make_test_img = 64M =20 _launch_qemu -drive if=3Dnone,id=3Dsrc,file=3D"$TEST_DIR/source.$IMGFMT",f= ormat=3Draw \ -nodefaults diff --git a/tests/qemu-iotests/111 b/tests/qemu-iotests/111 index 490a5bbcb5..3b43d1bd83 100755 --- a/tests/qemu-iotests/111 +++ b/tests/qemu-iotests/111 @@ -41,8 +41,7 @@ _supported_fmt qed qcow qcow2 vmdk _supported_proto file _unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" =20 -$QEMU_IMG create -f $IMGFMT -b "$TEST_IMG.inexistent" "$TEST_IMG" 2>&1 \ - | _filter_testdir | _filter_imgfmt +_make_test_img -b "$TEST_IMG.inexistent" =20 # success, all done echo '*** done' diff --git a/tests/qemu-iotests/123 b/tests/qemu-iotests/123 index d33950eb54..74d40d0478 100755 --- a/tests/qemu-iotests/123 +++ b/tests/qemu-iotests/123 @@ -44,7 +44,7 @@ _supported_os Linux SRC_IMG=3D"$TEST_DIR/source.$IMGFMT" =20 _make_test_img 1M -$QEMU_IMG create -f $IMGFMT "$SRC_IMG" 1M | _filter_img_create +TEST_IMG_FILE=3D$SRC_IMG IMGPROTO=3Dfile _make_test_img 1M =20 $QEMU_IO -c 'write -P 42 0 1M' "$SRC_IMG" | _filter_qemu_io =20 diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153 index c969a1a16f..e59090259c 100755 --- a/tests/qemu-iotests/153 +++ b/tests/qemu-iotests/153 @@ -98,7 +98,7 @@ for opts1 in "" "read-only=3Don" "read-only=3Don,force-sh= are=3Don"; do =20 echo echo "=3D=3D Creating test image =3D=3D" - $QEMU_IMG create -f $IMGFMT "${TEST_IMG}" -b ${TEST_IMG}.base | _filte= r_img_create + _make_test_img -b "${TEST_IMG}.base" =20 echo echo "=3D=3D Launching QEMU, opts: '$opts1' =3D=3D" diff --git a/tests/qemu-iotests/200 b/tests/qemu-iotests/200 index 72d431f251..d904885136 100755 --- a/tests/qemu-iotests/200 +++ b/tests/qemu-iotests/200 @@ -46,8 +46,8 @@ _supported_proto file BACKING_IMG=3D"${TEST_DIR}/backing.img" TEST_IMG=3D"${TEST_DIR}/test.img" =20 -${QEMU_IMG} create -f $IMGFMT "${BACKING_IMG}" 512M | _filter_img_create -${QEMU_IMG} create -f $IMGFMT -F $IMGFMT "${TEST_IMG}" -b "${BACKING_IMG}"= 512M | _filter_img_create +TEST_IMG=3D"$BACKING_IMG" _make_test_img 512M +_make_test_img -F $IMGFMT -b "$BACKING_IMG" 512M =20 ${QEMU_IO} -c "write -P 0xa5 512 300M" "${BACKING_IMG}" | _filter_qemu_io =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322506; cv=none; d=zohomail.com; s=zohoarc; b=PqCZNipEAnQvWGuPuktx+RXk+31O66WCk1y7cNDl8QWnsSf4G7iNIh1pT/QiB7wuQxqzQfpf9s01AtHvDZmhZJpRZiT2k1k15FKfE1lUCIK5ZjBmYN1Q6GO32zoSw2cP4pNuQcex0pS9E5Nyodk7+y9BgrQGGxIKePf3Vxd79t8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322506; 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=ydHodHcPXKVD8l+3vB8THE4MyuiO+iOusk6YJY9EJqg=; b=NAyViHsaxnJ+4TrdVzuPB11ZORKTm25Umo2+wCcAJUKXa81WwVOM0inQFX4DdZFooUY0IC1Uzh3sPEJwv39qLv2VZ16/2FCO6TUZhzxy/5+vIN/rUaZ9QMSfmKnifsR9Y47QjBQT4Aak+Cb9zlWQF+UU7gOoUi09FizPWe97zN4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322506378325.0727112142906; Mon, 6 Jan 2020 06:55:06 -0800 (PST) Received: from localhost ([::1]:52962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTma-0004t4-QS for importer@patchew.org; Mon, 06 Jan 2020 09:55:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44000) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbP-0006y6-8Y for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbL-0000cz-3n for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:31 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:39859 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 1ioTbK-0000cc-Vu for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-421-joUmEvrNNQK4qxrr9FgErQ-1; Mon, 06 Jan 2020 09:43:23 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D4CB8DB4FD; Mon, 6 Jan 2020 14:43:22 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E64D858A2; Mon, 6 Jan 2020 14:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321806; 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=ydHodHcPXKVD8l+3vB8THE4MyuiO+iOusk6YJY9EJqg=; b=Leb2tS2uU1o6hdYPmzTGosE1u2Ie0ifW+OA27YuublBlMzPb89Acl7KvGAxk4QLRSM0KdC 4Nco5oZUAEnyLZM8UsfSS5c3emSMgsHPRcdR+82ozEZpKI0EEvSOsudlaq8uHP5+hNXfj5 P8Fx+X8rqbwN5ScZx+Qsx1lpAW4WAJc= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 22/34] iotests: Use _rm_test_img for deleting test images Date: Mon, 6 Jan 2020 15:41:54 +0100 Message-Id: <20200106144206.698920-23-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: joUmEvrNNQK4qxrr9FgErQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Just rm will not delete external data files. Use _rm_test_img every time we delete a test image. (In the process, clean up the indentation of every _cleanup() this patch touches.) ((Also, use quotes consistently. I am happy to see unquoted instances like "rm -rf $TEST_DIR/..." go.)) Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-16-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/019 | 6 +++--- tests/qemu-iotests/020 | 6 +++--- tests/qemu-iotests/024 | 10 +++++----- tests/qemu-iotests/028 | 2 +- tests/qemu-iotests/029 | 2 +- tests/qemu-iotests/043 | 4 +++- tests/qemu-iotests/048 | 2 +- tests/qemu-iotests/050 | 4 ++-- tests/qemu-iotests/053 | 4 ++-- tests/qemu-iotests/058 | 2 +- tests/qemu-iotests/059 | 2 +- tests/qemu-iotests/061 | 2 +- tests/qemu-iotests/063 | 6 ++++-- tests/qemu-iotests/069 | 2 +- tests/qemu-iotests/074 | 2 +- tests/qemu-iotests/080 | 2 +- tests/qemu-iotests/081 | 6 +++--- tests/qemu-iotests/085 | 9 ++++++--- tests/qemu-iotests/088 | 2 +- tests/qemu-iotests/092 | 2 +- tests/qemu-iotests/094 | 2 +- tests/qemu-iotests/095 | 5 +++-- tests/qemu-iotests/099 | 7 ++++--- tests/qemu-iotests/109 | 4 ++-- tests/qemu-iotests/110 | 4 ++-- tests/qemu-iotests/122 | 6 ++++-- tests/qemu-iotests/123 | 2 +- tests/qemu-iotests/141 | 4 +++- tests/qemu-iotests/142 | 2 +- tests/qemu-iotests/144 | 4 +++- tests/qemu-iotests/153 | 10 +++------- tests/qemu-iotests/156 | 8 ++++++-- tests/qemu-iotests/159 | 2 +- tests/qemu-iotests/160 | 3 ++- tests/qemu-iotests/161 | 4 ++-- tests/qemu-iotests/170 | 2 +- tests/qemu-iotests/172 | 6 +++--- tests/qemu-iotests/173 | 3 ++- tests/qemu-iotests/178 | 2 +- tests/qemu-iotests/182 | 2 +- tests/qemu-iotests/183 | 2 +- tests/qemu-iotests/185 | 4 ++-- tests/qemu-iotests/187 | 6 +++--- tests/qemu-iotests/190 | 2 +- tests/qemu-iotests/191 | 6 +++--- tests/qemu-iotests/195 | 2 +- tests/qemu-iotests/197 | 2 +- tests/qemu-iotests/200 | 3 ++- tests/qemu-iotests/215 | 2 +- tests/qemu-iotests/225 | 2 +- tests/qemu-iotests/229 | 3 ++- tests/qemu-iotests/232 | 4 +++- tests/qemu-iotests/243 | 2 +- tests/qemu-iotests/244 | 4 ++-- tests/qemu-iotests/247 | 4 +++- tests/qemu-iotests/249 | 4 ++-- tests/qemu-iotests/252 | 2 +- 57 files changed, 118 insertions(+), 95 deletions(-) diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019 index b4f5234609..813a84acac 100755 --- a/tests/qemu-iotests/019 +++ b/tests/qemu-iotests/019 @@ -30,9 +30,9 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img - rm -f "$TEST_IMG.base" - rm -f "$TEST_IMG.orig" + _cleanup_test_img + _rm_test_img "$TEST_IMG.base" + _rm_test_img "$TEST_IMG.orig" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 index f41b92f35f..20f8f185d0 100755 --- a/tests/qemu-iotests/020 +++ b/tests/qemu-iotests/020 @@ -28,9 +28,9 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img - rm -f "$TEST_IMG.base" - rm -f "$TEST_IMG.orig" + _cleanup_test_img + _rm_test_img "$TEST_IMG.base" + _rm_test_img "$TEST_IMG.orig" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024 index 23298c6f59..e2e766241e 100755 --- a/tests/qemu-iotests/024 +++ b/tests/qemu-iotests/024 @@ -29,12 +29,12 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_DIR/t.$IMGFMT.base_old" - rm -f "$TEST_DIR/t.$IMGFMT.base_new" + _rm_test_img "$TEST_DIR/t.$IMGFMT.base_old" + _rm_test_img "$TEST_DIR/t.$IMGFMT.base_new" =20 - rm -f "$TEST_DIR/subdir/t.$IMGFMT" - rm -f "$TEST_DIR/subdir/t.$IMGFMT.base_old" - rm -f "$TEST_DIR/subdir/t.$IMGFMT.base_new" + _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT" + _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT.base_old" + _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT.base_new" rmdir "$TEST_DIR/subdir" 2> /dev/null } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028 index bba1ee59ae..e2556d8e57 100755 --- a/tests/qemu-iotests/028 +++ b/tests/qemu-iotests/028 @@ -32,7 +32,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "${TEST_IMG}.copy" + _rm_test_img "${TEST_IMG}.copy" _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029 index 94c2713132..9254ede5e5 100755 --- a/tests/qemu-iotests/029 +++ b/tests/qemu-iotests/029 @@ -28,7 +28,7 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f $TEST_IMG.snap + _rm_test_img "$TEST_IMG.snap" _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043 index 67cc7e74c2..b102e49208 100755 --- a/tests/qemu-iotests/043 +++ b/tests/qemu-iotests/043 @@ -29,7 +29,9 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG".[123].base + for img in "$TEST_IMG".[123].base; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048 index bde408ca92..a8feb76184 100755 --- a/tests/qemu-iotests/048 +++ b/tests/qemu-iotests/048 @@ -31,7 +31,7 @@ _cleanup() { echo "Cleanup" _cleanup_test_img - rm "${TEST_IMG_FILE2}" + _rm_test_img "${TEST_IMG_FILE2}" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050 index 272ecab195..cdc5356541 100755 --- a/tests/qemu-iotests/050 +++ b/tests/qemu-iotests/050 @@ -29,8 +29,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.old" - rm -f "$TEST_IMG.new" + _rm_test_img "$TEST_IMG.old" + _rm_test_img "$TEST_IMG.new" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/053 b/tests/qemu-iotests/053 index e82bb69881..71d299c4f9 100755 --- a/tests/qemu-iotests/053 +++ b/tests/qemu-iotests/053 @@ -28,8 +28,8 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f "$TEST_IMG.orig" - _cleanup_test_img + _rm_test_img "$TEST_IMG.orig" + _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058 index 8c3212a72f..ed01115fa3 100755 --- a/tests/qemu-iotests/058 +++ b/tests/qemu-iotests/058 @@ -42,7 +42,7 @@ _cleanup() { nbd_server_stop _cleanup_test_img - rm -f "$converted_image" + _rm_test_img "$converted_image" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 3941c3f0c2..5438025285 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.qcow2" + IMGFMT=3Dqcow2 _rm_test_img "$TEST_IMG.qcow2" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index 2818c6a4a3..aad6b72d8a 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f $TEST_IMG.data + _rm_test_img "$TEST_IMG.data" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063 index 7cf0427af4..eef2b8a534 100755 --- a/tests/qemu-iotests/063 +++ b/tests/qemu-iotests/063 @@ -29,8 +29,10 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img - rm -f "$TEST_IMG.orig" "$TEST_IMG.raw1" "$TEST_IMG.raw2" + _cleanup_test_img + for img in "$TEST_IMG".{orig,raw1,raw2,target}; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/069 b/tests/qemu-iotests/069 index 3974714852..b997b127f0 100755 --- a/tests/qemu-iotests/069 +++ b/tests/qemu-iotests/069 @@ -47,7 +47,7 @@ echo "=3D=3D=3D Creating an image with a backing file and= deleting that file =3D=3D=3D" echo TEST_IMG=3D"$TEST_IMG.base" _make_test_img $IMG_SIZE _make_test_img -b "$TEST_IMG.base" $IMG_SIZE -rm -f "$TEST_IMG.base" +_rm_test_img "$TEST_IMG.base" # Just open the image and close it right again (this should print an error= message) $QEMU_IO -c quit "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt =20 diff --git a/tests/qemu-iotests/074 b/tests/qemu-iotests/074 index bb4ad1cc08..62be89a0d9 100755 --- a/tests/qemu-iotests/074 +++ b/tests/qemu-iotests/074 @@ -31,7 +31,7 @@ _cleanup() { echo "Cleanup" _cleanup_test_img - rm "${TEST_IMG2}" + _rm_test_img "${TEST_IMG2}" rm -f "$TEST_DIR/blkdebug.conf" } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080 index 4bcb5021e8..b1ecafb41e 100755 --- a/tests/qemu-iotests/080 +++ b/tests/qemu-iotests/080 @@ -28,7 +28,7 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f $TEST_IMG.snap + _rm_test_img "$TEST_IMG.snap" _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index 85acdf76d4..537d40dfd5 100755 --- a/tests/qemu-iotests/081 +++ b/tests/qemu-iotests/081 @@ -28,9 +28,9 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -rf $TEST_DIR/1.raw - rm -rf $TEST_DIR/2.raw - rm -rf $TEST_DIR/3.raw + _rm_test_img "$TEST_DIR/1.raw" + _rm_test_img "$TEST_DIR/2.raw" + _rm_test_img "$TEST_DIR/3.raw" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085 index d40fdab542..bbea1252d2 100755 --- a/tests/qemu-iotests/085 +++ b/tests/qemu-iotests/085 @@ -41,10 +41,13 @@ _cleanup() _cleanup_qemu for i in $(seq 1 ${SNAPSHOTS}) do - rm -f "${TEST_DIR}/${i}-${snapshot_virt0}" - rm -f "${TEST_DIR}/${i}-${snapshot_virt1}" + _rm_test_img "${TEST_DIR}/${i}-${snapshot_virt0}" + _rm_test_img "${TEST_DIR}/${i}-${snapshot_virt1}" + done + for img in "${TEST_IMG}".{1,2,base} + do + _rm_test_img "$img" done - rm -f "${TEST_IMG}" "${TEST_IMG}.1" "${TEST_IMG}.2" "${TEST_IMG}.base" =20 } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/088 b/tests/qemu-iotests/088 index b44edd0cf9..ef1163346c 100755 --- a/tests/qemu-iotests/088 +++ b/tests/qemu-iotests/088 @@ -28,7 +28,7 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f $TEST_IMG.snap + _rm_test_img "$TEST_IMG.snap" _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/092 b/tests/qemu-iotests/092 index e2e0726de1..40ec62b6f1 100755 --- a/tests/qemu-iotests/092 +++ b/tests/qemu-iotests/092 @@ -28,7 +28,7 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f $TEST_IMG.snap + _rm_test_img "$TEST_IMG.snap" _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094 index d645952d54..2d3e1004d3 100755 --- a/tests/qemu-iotests/094 +++ b/tests/qemu-iotests/094 @@ -30,7 +30,7 @@ _cleanup() { _cleanup_qemu _cleanup_test_img - rm -f "$TEST_DIR/source.$IMGFMT" + _rm_test_img "$TEST_DIR/source.$IMGFMT" } =20 trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/095 b/tests/qemu-iotests/095 index 58fe174b5e..155ae86aa7 100755 --- a/tests/qemu-iotests/095 +++ b/tests/qemu-iotests/095 @@ -32,8 +32,9 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "${TEST_IMG}.base" "${TEST_IMG}.snp1" - _cleanup_test_img + _rm_test_img "${TEST_IMG}.base" + _rm_test_img "${TEST_IMG}.snp1" + _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099 index c3cf66798a..b383c11e6a 100755 --- a/tests/qemu-iotests/099 +++ b/tests/qemu-iotests/099 @@ -29,7 +29,10 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img + _cleanup_test_img + _rm_test_img "$TEST_IMG.compare" + rm -f "$TEST_DIR/blkdebug.conf" + } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 @@ -121,8 +124,6 @@ echo test_qemu "file.driver=3Dblkdebug,file.image.filename=3D$TEST_IMG" =20 =20 -rm -f "$TEST_IMG.compare" "$TEST_DIR/blkdebug.conf" - # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109 index 9897ceb6cd..ba638db11f 100755 --- a/tests/qemu-iotests/109 +++ b/tests/qemu-iotests/109 @@ -29,8 +29,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f $TEST_IMG.src - _cleanup_test_img + _rm_test_img "$TEST_IMG.src" + _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110 index 2ef516baf1..f78df0e6e1 100755 --- a/tests/qemu-iotests/110 +++ b/tests/qemu-iotests/110 @@ -28,8 +28,8 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img - rm -f "$TEST_IMG.copy" + _cleanup_test_img + _rm_test_img "$TEST_IMG.copy" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index 059011ebb1..dfa350936f 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qemu-iotests/122 @@ -28,8 +28,10 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f "$TEST_IMG".[123] - _cleanup_test_img + for img in "$TEST_IMG".[123]; do + _rm_test_img "$img" + done + _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/123 b/tests/qemu-iotests/123 index 74d40d0478..01b771c76e 100755 --- a/tests/qemu-iotests/123 +++ b/tests/qemu-iotests/123 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$SRC_IMG" + _rm_test_img "$SRC_IMG" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141 index 8c2ae79f2b..5192d256e3 100755 --- a/tests/qemu-iotests/141 +++ b/tests/qemu-iotests/141 @@ -30,7 +30,9 @@ _cleanup() { _cleanup_qemu _cleanup_test_img - rm -f "$TEST_DIR"/{b,m,o}.$IMGFMT + for img in "$TEST_DIR"/{b,m,o}.$IMGFMT; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142 index 6b62271876..daefcbaa58 100755 --- a/tests/qemu-iotests/142 +++ b/tests/qemu-iotests/142 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f $TEST_IMG.snap + _rm_test_img "$TEST_IMG.snap" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/144 b/tests/qemu-iotests/144 index 011ed4f2bc..4569ac0b4b 100755 --- a/tests/qemu-iotests/144 +++ b/tests/qemu-iotests/144 @@ -34,7 +34,9 @@ TMP_SNAP2=3D${TEST_DIR}/tmp2.qcow2 _cleanup() { _cleanup_qemu - rm -f "${TEST_IMG}" "${TMP_SNAP1}" "${TMP_SNAP2}" + for img in "${TEST_IMG}" "${TMP_SNAP1}" "${TMP_SNAP2}"; do + _rm_test_img "$img" + done } =20 trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153 index e59090259c..2b13111768 100755 --- a/tests/qemu-iotests/153 +++ b/tests/qemu-iotests/153 @@ -30,13 +30,9 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "${TEST_IMG}.base" - rm -f "${TEST_IMG}.overlay" - rm -f "${TEST_IMG}.convert" - rm -f "${TEST_IMG}.a" - rm -f "${TEST_IMG}.b" - rm -f "${TEST_IMG}.c" - rm -f "${TEST_IMG}.lnk" + for img in "${TEST_IMG}".{base,overlay,convert,a,b,c,lnk}; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 index 2ffa3ca942..3f27db71f2 100755 --- a/tests/qemu-iotests/156 +++ b/tests/qemu-iotests/156 @@ -37,7 +37,9 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "$TEST_IMG"{,.target}{,.backing,.overlay} + for img in "$TEST_IMG"{,.target}{,.backing,.overlay}; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 @@ -120,7 +122,9 @@ _send_qemu_cmd $QEMU_HANDLE \ '"status": "null"' =20 # Remove the source images -rm -f "$TEST_IMG{,.backing,.overlay}" +for img in "$TEST_IMG{,.backing,.overlay}"; do + _rm_test_img "$img" +done =20 echo =20 diff --git a/tests/qemu-iotests/159 b/tests/qemu-iotests/159 index 2557140ac2..f9690053a2 100755 --- a/tests/qemu-iotests/159 +++ b/tests/qemu-iotests/159 @@ -28,7 +28,7 @@ status=3D1 _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.out" + _rm_test_img "$TEST_IMG.out" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/160 b/tests/qemu-iotests/160 index df89d3864b..0572b5ae9a 100755 --- a/tests/qemu-iotests/160 +++ b/tests/qemu-iotests/160 @@ -28,7 +28,8 @@ status=3D1 _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.out" "$TEST_IMG.out.dd" + _rm_test_img "$TEST_IMG.out" + _rm_test_img "$TEST_IMG.out.dd" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/161 b/tests/qemu-iotests/161 index 456a4bd8c4..f572a19af2 100755 --- a/tests/qemu-iotests/161 +++ b/tests/qemu-iotests/161 @@ -30,8 +30,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.base" - rm -f "$TEST_IMG.int" + _rm_test_img "$TEST_IMG.base" + _rm_test_img "$TEST_IMG.int" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/170 b/tests/qemu-iotests/170 index 05dd6ed6c3..6c8f0e8085 100755 --- a/tests/qemu-iotests/170 +++ b/tests/qemu-iotests/170 @@ -28,7 +28,7 @@ status=3D1 _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.out" + _rm_test_img "$TEST_IMG.out" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/172 b/tests/qemu-iotests/172 index d67997e5f6..7195fb895a 100755 --- a/tests/qemu-iotests/172 +++ b/tests/qemu-iotests/172 @@ -28,9 +28,9 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img - rm -f "$TEST_IMG.2" - rm -f "$TEST_IMG.3" + _cleanup_test_img + _rm_test_img "$TEST_IMG.2" + _rm_test_img "$TEST_IMG.3" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/173 b/tests/qemu-iotests/173 index 29dcaa1960..ec6d1705e5 100755 --- a/tests/qemu-iotests/173 +++ b/tests/qemu-iotests/173 @@ -29,7 +29,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "${QEMU_TEST_DIR}/image.base" "${QEMU_TEST_DIR}/image.snp1" + _rm_test_img "${TEST_DIR}/image.base" + _rm_test_img "${TEST_DIR}/image.snp1" _cleanup_test_img } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178 index 75b5e8f314..51a70fe669 100755 --- a/tests/qemu-iotests/178 +++ b/tests/qemu-iotests/178 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.converted" + _rm_test_img "$TEST_IMG.converted" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182 index 1ccb850055..56a2dd58e6 100755 --- a/tests/qemu-iotests/182 +++ b/tests/qemu-iotests/182 @@ -30,7 +30,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.overlay" + _rm_test_img "$TEST_IMG.overlay" rm -f "$SOCK_DIR/nbd.socket" } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/183 b/tests/qemu-iotests/183 index bced83fae0..3f74b9f62d 100755 --- a/tests/qemu-iotests/183 +++ b/tests/qemu-iotests/183 @@ -31,7 +31,7 @@ MIG_SOCKET=3D"${SOCK_DIR}/migrate" _cleanup() { rm -f "${MIG_SOCKET}" - rm -f "${TEST_IMG}.dest" + _rm_test_img "${TEST_IMG}.dest" _cleanup_test_img _cleanup_qemu } diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185 index 454ff600cc..e50f19ebf0 100755 --- a/tests/qemu-iotests/185 +++ b/tests/qemu-iotests/185 @@ -28,8 +28,8 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f "${TEST_IMG}.mid" - rm -f "${TEST_IMG}.copy" + _rm_test_img "${TEST_IMG}.mid" + _rm_test_img "${TEST_IMG}.copy" _cleanup_test_img _cleanup_qemu } diff --git a/tests/qemu-iotests/187 b/tests/qemu-iotests/187 index 2fcef9e2bd..c6e1dc57a0 100755 --- a/tests/qemu-iotests/187 +++ b/tests/qemu-iotests/187 @@ -28,9 +28,9 @@ status=3D1 # failure is the default! =20 _cleanup() { - _cleanup_test_img - rm -f "$TEST_IMG.2" - rm -f "$TEST_IMG.3" + _cleanup_test_img + _rm_test_img "$TEST_IMG.2" + _rm_test_img "$TEST_IMG.3" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/190 b/tests/qemu-iotests/190 index 5890ff9cfc..6d41650438 100755 --- a/tests/qemu-iotests/190 +++ b/tests/qemu-iotests/190 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.converted" + _rm_test_img "$TEST_IMG.converted" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191 index 21c16a32cb..23ab0ce899 100755 --- a/tests/qemu-iotests/191 +++ b/tests/qemu-iotests/191 @@ -28,9 +28,9 @@ status=3D1 # failure is the default! =20 _cleanup() { - rm -f "${TEST_IMG}.mid" - rm -f "${TEST_IMG}.ovl2" - rm -f "${TEST_IMG}.ovl3" + _rm_test_img "${TEST_IMG}.mid" + _rm_test_img "${TEST_IMG}.ovl2" + _rm_test_img "${TEST_IMG}.ovl3" _cleanup_test_img _cleanup_qemu } diff --git a/tests/qemu-iotests/195 b/tests/qemu-iotests/195 index ef7b9a94e2..48984b7ac1 100755 --- a/tests/qemu-iotests/195 +++ b/tests/qemu-iotests/195 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.mid" + _rm_test_img "$TEST_IMG.mid" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197 index 4d3d08ad6f..95f05b0e34 100755 --- a/tests/qemu-iotests/197 +++ b/tests/qemu-iotests/197 @@ -43,7 +43,7 @@ esac _cleanup() { _cleanup_test_img - rm -f "$TEST_WRAP" + _rm_test_img "$TEST_WRAP" rm -f "$BLKDBG_CONF" } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/200 b/tests/qemu-iotests/200 index d904885136..a2cdd7f83d 100755 --- a/tests/qemu-iotests/200 +++ b/tests/qemu-iotests/200 @@ -31,7 +31,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_qemu - rm -f "${TEST_IMG}" "${BACKING_IMG}" + _rm_test_img "${TEST_IMG}" + _rm_test_img "${BACKING_IMG}" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/215 b/tests/qemu-iotests/215 index 55a1874dcd..f99bae78c7 100755 --- a/tests/qemu-iotests/215 +++ b/tests/qemu-iotests/215 @@ -40,7 +40,7 @@ esac _cleanup() { _cleanup_test_img - rm -f "$TEST_WRAP" + _rm_test_img "$TEST_WRAP" rm -f "$BLKDBG_CONF" } trap "_cleanup; exit \$status" 0 1 2 3 15 diff --git a/tests/qemu-iotests/225 b/tests/qemu-iotests/225 index fbd7404791..c9a334c7e9 100755 --- a/tests/qemu-iotests/225 +++ b/tests/qemu-iotests/225 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.not_base" + _rm_test_img "$TEST_IMG.not_base" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/229 b/tests/qemu-iotests/229 index e18a464fe0..866168b236 100755 --- a/tests/qemu-iotests/229 +++ b/tests/qemu-iotests/229 @@ -31,7 +31,8 @@ _cleanup() { _cleanup_qemu _cleanup_test_img - rm -f "$TEST_IMG" "$DEST_IMG" + _rm_test_img "$TEST_IMG" + _rm_test_img "$DEST_IMG" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232 index 65b0e42063..685356ac3b 100755 --- a/tests/qemu-iotests/232 +++ b/tests/qemu-iotests/232 @@ -29,7 +29,9 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f $TEST_IMG.[01234] + for img in "$TEST_IMG".[01234]; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243 index 2b84b896db..3dc3b6a711 100755 --- a/tests/qemu-iotests/243 +++ b/tests/qemu-iotests/243 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f $TEST_IMG.data + _rm_test_img "$TEST_IMG.data" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244 index 0375bc12d4..13263292b0 100755 --- a/tests/qemu-iotests/244 +++ b/tests/qemu-iotests/244 @@ -29,8 +29,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f $TEST_IMG.data - rm -f $TEST_IMG.src + _rm_test_img "$TEST_IMG.data" + _rm_test_img "$TEST_IMG.src" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/247 b/tests/qemu-iotests/247 index c853b73819..87e37b39e2 100755 --- a/tests/qemu-iotests/247 +++ b/tests/qemu-iotests/247 @@ -29,7 +29,9 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f $TEST_IMG.[01234] + for img in "$TEST_IMG".[01234]; do + _rm_test_img "$img" + done } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249 index e4650ecf6b..2b99c9789e 100755 --- a/tests/qemu-iotests/249 +++ b/tests/qemu-iotests/249 @@ -30,8 +30,8 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.base" - rm -f "$TEST_IMG.int" + _rm_test_img "$TEST_IMG.base" + _rm_test_img "$TEST_IMG.int" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 diff --git a/tests/qemu-iotests/252 b/tests/qemu-iotests/252 index f6c8f71444..83280c1715 100755 --- a/tests/qemu-iotests/252 +++ b/tests/qemu-iotests/252 @@ -29,7 +29,7 @@ status=3D1 # failure is the default! _cleanup() { _cleanup_test_img - rm -f "$TEST_IMG.base_new" + _rm_test_img "$TEST_IMG.base_new" } trap "_cleanup; exit \$status" 0 1 2 3 15 =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322341; cv=none; d=zohomail.com; s=zohoarc; b=Tu0zpFPzyNJUM6c0FJASleoeqbEUs7k7QhSFxW30/bSojVZwSalnIz6sy+a027dcpDewk0qH6Aab172BzThKfzPbQXWRJGZZr7oq6Ooz8EGXUly0DIZ9AEbwHubwumPADU9QOQZBi+RfyOJ6Z8VlrOc2/8D+/H6gdTcZtj0l9AQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322341; 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=Cex0cH8xqddNwDBn535rXugzXDBq8I+lv7lkuANFmIE=; b=F53LiEOVByau+zs+CBNReQ1+ljhIpR9SKRjeTKoy5ZDrXcXeUm9Q4HSiPQLOGEXn6Lbq4sKrPgGtucVej2bjahWFEqS0xAw4OkH7CpnrKmRSBgbCcRRzMR7TcoK+wZbfsBLFS1Thj6rET7Lu0+aF3p+OWWuu/mkEAxg02oWmK0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322341441405.2822926840611; Mon, 6 Jan 2020 06:52:21 -0800 (PST) Received: from localhost ([::1]:52916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTjv-00005B-PQ for importer@patchew.org; Mon, 06 Jan 2020 09:52:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44026) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbQ-0006zI-LH for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbP-0000fH-6l for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:32 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21149 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 1ioTbN-0000eI-UH for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:30 -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-116-0jSSK_4-N4-READAREShMA-1; Mon, 06 Jan 2020 09:43:26 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F00E3108BD0C; Mon, 6 Jan 2020 14:43:24 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C3ED691AD; Mon, 6 Jan 2020 14:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321809; 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=Cex0cH8xqddNwDBn535rXugzXDBq8I+lv7lkuANFmIE=; b=H5PjjW7zLhGHBMS94UVD8CIWosbh6TxkDb2eTVowS3KLGEd2ClfX+TXw1LXSUac0eRAgdQ 1iLactZEOpF/vZlxOcD3TdQdyD9Pqh915OLnvv0Cq3Igg0jnY79G1x9P/3RfvAn4s8/puj NPlV1UFiQnuH3NkwnlYFuC1fx67vpaU= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 23/34] iotests: Avoid cp/mv of test images Date: Mon, 6 Jan 2020 15:41:55 +0100 Message-Id: <20200106144206.698920-24-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 0jSSK_4-N4-READAREShMA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This will not work with external data files, so try to get tests working without it as far as possible. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-17-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/063 | 12 ++++-------- tests/qemu-iotests/063.out | 3 ++- tests/qemu-iotests/085 | 9 +++------ tests/qemu-iotests/085.out | 8 ++++---- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063 index eef2b8a534..c750b3806e 100755 --- a/tests/qemu-iotests/063 +++ b/tests/qemu-iotests/063 @@ -51,15 +51,13 @@ _unsupported_imgopts "subformat=3DmonolithicFlat" \ _make_test_img 4M =20 echo "=3D=3D Testing conversion with -n fails with no target file =3D=3D" -# check .orig file does not exist -rm -f "$TEST_IMG.orig" if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig"= >/dev/null 2>&1; then exit 1 fi =20 echo "=3D=3D Testing conversion with -n succeeds with a target file =3D=3D" -rm -f "$TEST_IMG.orig" -cp "$TEST_IMG" "$TEST_IMG.orig" +_rm_test_img "$TEST_IMG.orig" +TEST_IMG=3D"$TEST_IMG.orig" _make_test_img 4M if ! $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.ori= g" ; then exit 1 fi @@ -85,10 +83,8 @@ fi _check_test_img =20 echo "=3D=3D Testing conversion to a smaller file fails =3D=3D" -rm -f "$TEST_IMG.orig" -mv "$TEST_IMG" "$TEST_IMG.orig" -_make_test_img 2M -if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG.orig" "$TEST_IMG"= >/dev/null 2>&1; then +TEST_IMG=3D"$TEST_IMG.target" _make_test_img 2M +if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.targe= t" >/dev/null 2>&1; then exit 1 fi =20 diff --git a/tests/qemu-iotests/063.out b/tests/qemu-iotests/063.out index 7b691b2c9e..890b719bf0 100644 --- a/tests/qemu-iotests/063.out +++ b/tests/qemu-iotests/063.out @@ -2,11 +2,12 @@ QA output created by 063 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D4194304 =3D=3D Testing conversion with -n fails with no target file =3D=3D =3D=3D Testing conversion with -n succeeds with a target file =3D=3D +Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D4194304 =3D=3D Testing conversion to raw is the same after conversion with -n =3D= =3D =3D=3D Testing conversion back to original format =3D=3D No errors were found on the image. =3D=3D Testing conversion to a smaller file fails =3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2097152 +Formatting 'TEST_DIR/t.IMGFMT.target', fmt=3DIMGFMT size=3D2097152 =3D=3D Regression testing for copy offloading bug =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 Formatting 'TEST_DIR/t.IMGFMT.target', fmt=3DIMGFMT size=3D1048576 diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085 index bbea1252d2..46981dbb64 100755 --- a/tests/qemu-iotests/085 +++ b/tests/qemu-iotests/085 @@ -105,8 +105,7 @@ add_snapshot_image() { base_image=3D"${TEST_DIR}/$((${1}-1))-${snapshot_virt0}" snapshot_file=3D"${TEST_DIR}/${1}-${snapshot_virt0}" - _make_test_img -u -b "${base_image}" "$size" - mv "${TEST_IMG}" "${snapshot_file}" + TEST_IMG=3D$snapshot_file _make_test_img -u -b "${base_image}" "$size" do_blockdev_add "$1" "'backing': null, " "${snapshot_file}" } =20 @@ -122,10 +121,8 @@ blockdev_snapshot() =20 size=3D128M =20 -_make_test_img $size -mv "${TEST_IMG}" "${TEST_IMG}.1" -_make_test_img $size -mv "${TEST_IMG}" "${TEST_IMG}.2" +TEST_IMG=3D"$TEST_IMG.1" _make_test_img $size +TEST_IMG=3D"$TEST_IMG.2" _make_test_img $size =20 echo echo =3D=3D=3D Running QEMU =3D=3D=3D diff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out index bb50227b82..d94ad22f70 100644 --- a/tests/qemu-iotests/085.out +++ b/tests/qemu-iotests/085.out @@ -1,6 +1,6 @@ QA output created by 085 -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 +Formatting 'TEST_DIR/t.IMGFMT.1', fmt=3DIMGFMT size=3D134217728 +Formatting 'TEST_DIR/t.IMGFMT.2', fmt=3DIMGFMT size=3D134217728 =20 =3D=3D=3D Running QEMU =3D=3D=3D =20 @@ -68,12 +68,12 @@ Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=3Dqcow2= size=3D134217728 backing_fil =20 =3D=3D=3D Create a couple of snapshots using blockdev-snapshot =3D=3D=3D =20 -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/10-snapshot-v0.IMGFMT +Formatting 'TEST_DIR/11-snapshot-v0.IMGFMT', fmt=3DIMGFMT size=3D134217728= backing_file=3DTEST_DIR/10-snapshot-v0.IMGFMT { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name= ': 'snap_11', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TES= T_DIR/11-snapshot-v0.IMGFMT', 'node-name': 'file_11' } } } {"return": {}} { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_11' } } {"return": {}} -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 backing_file= =3DTEST_DIR/11-snapshot-v0.IMGFMT +Formatting 'TEST_DIR/12-snapshot-v0.IMGFMT', fmt=3DIMGFMT size=3D134217728= backing_file=3DTEST_DIR/11-snapshot-v0.IMGFMT { 'execute': 'blockdev-add', 'arguments': { 'driver': 'IMGFMT', 'node-name= ': 'snap_12', 'backing': null, 'file': { 'driver': 'file', 'filename': 'TES= T_DIR/12-snapshot-v0.IMGFMT', 'node-name': 'file_12' } } } {"return": {}} { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overl= ay':'snap_12' } } --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322472; cv=none; d=zohomail.com; s=zohoarc; b=T4irCVd2sJXqc8T7H6Lwks33ZzSi5EMhjlwtFmH0CUKayc2LIIy57nVw111P7GuXIjEEhjA58SrHQl0ZYjctnud6WWIbYsNoj7PGQGHvq5vBOGW2jl2LCQwD54rsQ1/5EcfMs23goIZ1MxBKKuHg4h/4UnjPQ2nN0qab75diZYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322472; 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=s82BuCk3tx2ruVJGHJbAYGdvIqL16IjCtGpYp+Ky8nE=; b=nOe1Q3VizURf7JgbqyW804rAKNUxqRtD5JcoD9cna7RNfMJUsJdYqZQXtoBk/B2lJxZVwQYaQx+bb+PXjGK9HyU07ckQFHEjI+SYnzpWCYMWYQXMnvHSEQkOx42Xl+BiPno3ukLWYS77La768U+OlSkLTey0LcG+ODddJLrg/8Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322472022924.9223412461726; Mon, 6 Jan 2020 06:54:32 -0800 (PST) Received: from localhost ([::1]:52950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTm2-0003jh-24 for importer@patchew.org; Mon, 06 Jan 2020 09:54:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44074) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbT-00072s-2b for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbS-0000ir-0P for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:34 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42678 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 1ioTbR-0000iM-Rt for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-259-mOru9p5NMxq8hfoKkDVW5A-1; Mon, 06 Jan 2020 09:43: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 E8793941BD; Mon, 6 Jan 2020 14:43:27 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 65B057DB3E; Mon, 6 Jan 2020 14:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321813; 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=s82BuCk3tx2ruVJGHJbAYGdvIqL16IjCtGpYp+Ky8nE=; b=XxpUZBtjqHpZxcvielTynLojgThCzV90ZQVibbT/01wfXXXXLgvVSOXNCSGcdo60jSFyHv bUO69OV5Dyow4ahQ9jfgLN/t9dP0iESH+P63si0srYeQeutlTnoGuJrsucK3z+K1RhXMuW hBCtDB8Hz70rwmDcpj4YTzM46NYVZCE= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 24/34] iotests: Make 091 work with data_file Date: Mon, 6 Jan 2020 15:41:56 +0100 Message-Id: <20200106144206.698920-25-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: mOru9p5NMxq8hfoKkDVW5A-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The image end offset as reported by qemu-img check is different when using an external data file; we do not care about its value here, so we can just filter it. Incidentally, common.rc already has _check_test_img for us which does exactly that. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-18-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/091 | 2 +- tests/qemu-iotests/091.out | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091 index f4b44659ae..0874fa84c8 100755 --- a/tests/qemu-iotests/091 +++ b/tests/qemu-iotests/091 @@ -101,7 +101,7 @@ echo "Check image pattern" ${QEMU_IO} -c "read -P 0x22 0 4M" "${TEST_IMG}" | _filter_testdir | _filte= r_qemu_io =20 echo "Running 'qemu-img check -r all \$TEST_IMG'" -"${QEMU_IMG}" check -r all "${TEST_IMG}" 2>&1 | _filter_testdir | _filter_= qemu +_check_test_img -r all =20 echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/091.out b/tests/qemu-iotests/091.out index 5017f8c2d9..5ec7b00f13 100644 --- a/tests/qemu-iotests/091.out +++ b/tests/qemu-iotests/091.out @@ -23,6 +23,4 @@ read 4194304/4194304 bytes at offset 0 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Running 'qemu-img check -r all $TEST_IMG' No errors were found on the image. -80/16384 =3D 0.49% allocated, 0.00% fragmented, 0.00% compressed clusters -Image end offset: 5570560 *** done --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323520; cv=none; d=zohomail.com; s=zohoarc; b=gydZnwp4SUU+NH2UPSmMKNzcrRhwNkA0crq+CC3z4VpuEIITHEeJmlfNrNsjypX75JLadjN6rwkLdd5/4+4Vn84kOgJ8gllH1jhuOyw343ffSpHvDCQ4ixCr2D6SdT8/tS09CsuGckNxFhLgTc/Jh6UiDWMuAGVKh7IJZEnSkwg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323520; 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=fsW9A/KuWJzfMXhzNLmReZ4zVfg0ysO1L/7uPXDRxUE=; b=jwr/ZnUChBw9UnUxU9s4ru8XNqr8BaZJ7i7n58R+klu3mjkwIV/CT83e6hBHo8kTcm7+I5wLLreyxm31HAXQMcegw0Jr4FS1QfzRVumbW/4narYIWMWrBzj2ndHxn+LU2CAj6gqEIkK3Vg5KJns3Z39fTtuFVTTgghgolK323qA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157832352008261.65747468409768; Mon, 6 Jan 2020 07:12:00 -0800 (PST) Received: from localhost ([::1]:53228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioU2w-0000ww-D3 for importer@patchew.org; Mon, 06 Jan 2020 10:11:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44114) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbU-00076X-U1 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbT-0000k4-HN for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:36 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:54607 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 1ioTbT-0000jf-Dl for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-280-9Dmy-FBQOk2lD5sfMK30sg-1; Mon, 06 Jan 2020 09:43:31 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B53A5802C81; Mon, 6 Jan 2020 14:43:30 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AC9A5D9E1; Mon, 6 Jan 2020 14:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321815; 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=fsW9A/KuWJzfMXhzNLmReZ4zVfg0ysO1L/7uPXDRxUE=; b=fAnWiCRT2kU1ajTJA4NJMQzzz+Ihv/sIrJ2qMHUVhS9y+BxFYt3ByPaVqa9yK16Wg4uTHT jMBcMaFyQtYmSsOS5WC3nQPviKC9fb951cb7tD5vM7cecI1WD/0tg9B2sES1hcDMKg57iI jRHQjDM4YFwu34BkhDRjW8O9XOq2Zsk= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 25/34] iotests: Make 110 work with data_file Date: Mon, 6 Jan 2020 15:41:57 +0100 Message-Id: <20200106144206.698920-26-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: 9Dmy-FBQOk2lD5sfMK30sg-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The only difference is that the json:{} filename of the image looks different. We actually do not care about that filename in this test, we are only interested in (1) that there is a json:{} filename, and (2) whether the backing filename can be constructed. So just filter out the json:{} data, thus making this test pass both with and without data_file. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-19-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/110 | 7 +++++-- tests/qemu-iotests/110.out | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110 index f78df0e6e1..139c02c2cf 100755 --- a/tests/qemu-iotests/110 +++ b/tests/qemu-iotests/110 @@ -67,6 +67,7 @@ echo # Across blkdebug without a config file, you cannot reconstruct filenames,= so # qemu is incapable of knowing the directory of the top image from the fil= ename # alone. However, using bdrv_dirname(), it should still work. +# (Filter out the json:{} filename so this test works with external data f= iles) TEST_IMG=3D"json:{ 'driver': '$IMGFMT', 'file': { @@ -82,7 +83,8 @@ TEST_IMG=3D"json:{ } ] } -}" _img_info | _filter_img_info | grep -v 'backing file format' +}" _img_info | _filter_img_info | grep -v 'backing file format' \ + | _filter_json_filename =20 echo echo '=3D=3D=3D Backing name is always relative to the backed image =3D=3D= =3D' @@ -114,7 +116,8 @@ TEST_IMG=3D"json:{ } ] } -}" _img_info | _filter_img_info | grep -v 'backing file format' +}" _img_info | _filter_img_info | grep -v 'backing file format' \ + | _filter_json_filename =20 =20 # success, all done diff --git a/tests/qemu-iotests/110.out b/tests/qemu-iotests/110.out index f60b26390e..f835553a99 100644 --- a/tests/qemu-iotests/110.out +++ b/tests/qemu-iotests/110.out @@ -11,7 +11,7 @@ backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGF= MT.base) =20 =3D=3D=3D Non-reconstructable filename =3D=3D=3D =20 -image: json:{"driver": "IMGFMT", "file": {"set-state.0.event": "read_aio",= "image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "driver": "b= lkdebug", "set-state.0.new_state": 42}} +image: json:{ /* filtered */ } file format: IMGFMT virtual size: 64 MiB (67108864 bytes) backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGFMT.base) @@ -22,7 +22,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108= 864 backing_file=3Dt.IMGFMT.b =20 =3D=3D=3D Nodes without a common directory =3D=3D=3D =20 -image: json:{"driver": "IMGFMT", "file": {"children": [{"driver": "file", = "filename": "TEST_DIR/t.IMGFMT"}, {"driver": "file", "filename": "TEST_DIR/= t.IMGFMT.copy"}], "driver": "quorum", "vote-threshold": 1}} +image: json:{ /* filtered */ } file format: IMGFMT virtual size: 64 MiB (67108864 bytes) backing file: t.IMGFMT.base (cannot determine actual path) --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322617; cv=none; d=zohomail.com; s=zohoarc; b=ktWtZMOA7Uzo0S+RuzVBPoSLQRNiKhBLhtjHTPdzanoTIoJv9a4jAc1NnP3hfIRfcfE5qBbCQqvqQveLhiZ4xfWsE5eLpXXzOZPgd8jmFtN1MZLF95DqtxpNawIF8YdZpHBT2BfZPxo+/YhAyREvIhuclIfuqDoFZMYZ2pDxxdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322617; 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=nig+3laE/ZHq5msk6s+ae2OgPY+P7khyKOhHy12rGi4=; b=ZdUX/RY5MykshBD8avCO6vIfK45bCpK1s1U9EG7u9UTCINhR0TI6pxvik3VX6Nr2pGAUsqmHk3XYBuswIO2ZErCKvMT95/K8Vx6klhEczMIAJpShMxQOv5mKe8TtrHmDwx+JI8tFGdRrsHIdSi5VN+eEJLGfwKHgG34X7SiAbeU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157832261774583.34593690567124; Mon, 6 Jan 2020 06:56:57 -0800 (PST) Received: from localhost ([::1]:52996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioToO-0007eE-6i for importer@patchew.org; Mon, 06 Jan 2020 09:56:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44148) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbX-0007AP-AS for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbV-0000lz-V9 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:39 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:39362 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 1ioTbV-0000lC-RO for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:37 -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-276-Ip6_iSiIPsqVB3jROVsXEA-1; Mon, 06 Jan 2020 09:43:34 -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 2F0E3107B784; Mon, 6 Jan 2020 14:43:33 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC8157DB58; Mon, 6 Jan 2020 14:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321817; 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=nig+3laE/ZHq5msk6s+ae2OgPY+P7khyKOhHy12rGi4=; b=XiFcfTSuPAqsAstGyWa2EBAkmOohSHkiGl65I/Lr+aB1692Fzk7hXs8ZHXr3k0jfgq98ZM 89VP5WoHkoTV4n0xMVnCoxfGC5pbxEXBpGqLwB8m5v+Cp5Cwb6r/Vi1aYixi7+CQYfempt NRUrrSZM0ggvFtuU992FdViTfog5QGk= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 26/34] iotests: Make 137 work with data_file Date: Mon, 6 Jan 2020 15:41:58 +0100 Message-Id: <20200106144206.698920-27-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: Ip6_iSiIPsqVB3jROVsXEA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When using an external data file, there are no refcounts for data clusters. We thus have to adjust the corruption test in this patch to not be based around a data cluster allocation, but the L2 table allocation (L2 tables are still refcounted with external data files). Furthermore, we should not print qcow2.py's list of incompatible features because it differs depending on whether there is an external data file or not. With those two changes, the test will work both with and without external data files (once that options works with the iotests at all). Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-20-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/137 | 15 +++++++++++---- tests/qemu-iotests/137.out | 6 ++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 index 6cf2997577..7ae86892f7 100755 --- a/tests/qemu-iotests/137 +++ b/tests/qemu-iotests/137 @@ -138,14 +138,21 @@ $QEMU_IO \ "$TEST_IMG" 2>&1 | _filter_qemu_io =20 # The dirty bit must not be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +# (Filter the external data file bit) +if $PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features \ + | grep -q '\<0\>' +then + echo 'ERROR: Dirty bit set' +else + echo 'OK: Dirty bit not set' +fi =20 # Similarly we can test whether corruption detection has been enabled: -# Create L1/L2, overwrite first entry in refcount block, allocate somethin= g. +# Create L1, overwrite refcounts, force allocation of L2 by writing +# data. # Disabling the checks should fail, so the corruption must be detected. _make_test_img 64M -$QEMU_IO -c "write 0 64k" "$TEST_IMG" | _filter_qemu_io -poke_file "$TEST_IMG" "$((0x20000))" "\x00\x00" +poke_file "$TEST_IMG" "$((0x20000))" "\x00\x00\x00\x00\x00\x00\x00\x00" $QEMU_IO \ -c "reopen -o overlap-check=3Dnone,lazy-refcounts=3D42" \ -c "write 64k 64k" \ diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out index bd4523a853..86377c80cd 100644 --- a/tests/qemu-iotests/137.out +++ b/tests/qemu-iotests/137.out @@ -36,11 +36,9 @@ qemu-io: Unsupported value 'blubb' for qcow2 option 'ove= rlap-check'. Allowed are wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( VALGRIND_QEMU=3D"${VALGRIND_QEMU_IO= }" _qemu_proc_exec "${VALGRIND_LOGFILE}" "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"= ) -incompatible_features [] +OK: Dirty bit not set Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -wrote 65536/65536 bytes at offset 0 -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) qemu-io: Parameter 'lazy-refcounts' expects 'on' or 'off' -qcow2: Marking image as corrupt: Preventing invalid write on metadata (ove= rlaps with qcow2_header); further corruption events will be suppressed +qcow2: Marking image as corrupt: Preventing invalid allocation of L2 table= at offset 0; further corruption events will be suppressed write failed: Input/output error *** done --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322692; cv=none; d=zohomail.com; s=zohoarc; b=m7NgUiKlm8tG30XcBFAetBMKnmpzvo9YCxXS6bqj/6OCEsGbfYFxIatVYopfWdBSQwaAQkuYm42v9XtMmMB9uWi2bo3N/vI8NrVu+xfDgZceF/KeqgrfKX4Rdx3BPzBr1YEeuyjkwVhIQkW+EI22Dov8XE4wq7CgBLdUNkIY+B8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322692; 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=nrG6GNGLQzaRBSYfvM/1ebCsTH7JsuVYluuZv1OBM5E=; b=dY+LWFTcvKrk/ntvy+1U11E8isifRcp5sKN3IMiELP9231/fE9VDPmZdwUq089uj3JQYuatxebR/eHbePCd4Sp32XMYVcrY9+q7OY1Zd5vtQL7/M/dKQngOCPzu3WDd5S+ULja36y5jPNCM6G8eOKa9C/OY016Pb3PpqItXYaDw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322692988383.2903840423073; Mon, 6 Jan 2020 06:58:12 -0800 (PST) Received: from localhost ([::1]:53012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTpb-0000q6-NE for importer@patchew.org; Mon, 06 Jan 2020 09:58:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44183) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbZ-0007DT-1b for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbX-0000nZ-M0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:40 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21546 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 1ioTbX-0000mw-3T for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:39 -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-O2O729uaM82ZhebG0a4rAQ-1; Mon, 06 Jan 2020 09:43:37 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 030A4107B79C; Mon, 6 Jan 2020 14:43:36 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EE225D9D6; Mon, 6 Jan 2020 14:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321818; 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=nrG6GNGLQzaRBSYfvM/1ebCsTH7JsuVYluuZv1OBM5E=; b=FCML64GuhzNq2jVq0MAv4SnKunHFH/Ri6aIrJ7c/niSF8HlpGwISSeq5+GDF2MS6YCYBdC KqDSBZCBxjstr7UqSPfWrHbSubjygdpg8HLwxOEOl1Cc4DJMnXVst6T6SHx8K8IhBpP5rP GXclo5uwL6i6DRNqRpZhCG16L9nKQww= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 27/34] iotests: Make 198 work with data_file Date: Mon, 6 Jan 2020 15:41:59 +0100 Message-Id: <20200106144206.698920-28-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: O2O729uaM82ZhebG0a4rAQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We do not care about the json:{} filenames here, so we can just filter them out and thus make the test work both with and without external data files. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-21-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/198 | 6 ++++-- tests/qemu-iotests/198.out | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/198 b/tests/qemu-iotests/198 index c8f824cfae..fb0d5a29d3 100755 --- a/tests/qemu-iotests/198 +++ b/tests/qemu-iotests/198 @@ -92,13 +92,15 @@ echo echo "=3D=3D checking image base =3D=3D" $QEMU_IMG info --image-opts $IMGSPECBASE | _filter_img_info --format-speci= fic \ | sed -e "/^disk size:/ D" -e '/refcount bits:/ D' -e '/compat:/ D' \ - -e '/lazy refcounts:/ D' -e '/corrupt:/ D' + -e '/lazy refcounts:/ D' -e '/corrupt:/ D' -e '/^\s*data file/ D= ' \ + | _filter_json_filename =20 echo echo "=3D=3D checking image layer =3D=3D" $QEMU_IMG info --image-opts $IMGSPECLAYER | _filter_img_info --format-spec= ific \ | sed -e "/^disk size:/ D" -e '/refcount bits:/ D' -e '/compat:/ D' \ - -e '/lazy refcounts:/ D' -e '/corrupt:/ D' + -e '/lazy refcounts:/ D' -e '/corrupt:/ D' -e '/^\s*data file/ D= ' \ + | _filter_json_filename =20 =20 # success, all done diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out index e86b175e39..831ce3a289 100644 --- a/tests/qemu-iotests/198.out +++ b/tests/qemu-iotests/198.out @@ -32,7 +32,7 @@ read 16777216/16777216 bytes at offset 0 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D checking image base =3D=3D -image: json:{"encrypt.key-secret": "sec0", "driver": "IMGFMT", "file": {"d= river": "file", "filename": "TEST_DIR/t.IMGFMT.base"}} +image: json:{ /* filtered */ } file format: IMGFMT virtual size: 16 MiB (16777216 bytes) Format specific information: @@ -74,7 +74,7 @@ Format specific information: master key iters: 1024 =20 =3D=3D checking image layer =3D=3D -image: json:{"encrypt.key-secret": "sec1", "driver": "IMGFMT", "file": {"d= river": "file", "filename": "TEST_DIR/t.IMGFMT"}} +image: json:{ /* filtered */ } file format: IMGFMT virtual size: 16 MiB (16777216 bytes) backing file: TEST_DIR/t.IMGFMT.base --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322837; cv=none; d=zohomail.com; s=zohoarc; b=j7dloRiv63U5cef5d1gkJ+H2Cxzku7c/uAc98sfw9KpyroO2NbxjcGmizfsp6A9B1rdmfqI1ro+AUWA4ni6qv8vXJXGFP8rIH1zVOi9oBfcrnDhd8D+ne3lMBZUuMLEoWQ9R/McpEk+tl1YqMNSpdQH9EvxqxEhEiSLg/8wDowU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322837; 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=CugtdPlV3P6ys0x+ESsYl6QadaILtmI+aVl7Yj5Jbyo=; b=fpurVFzynW/X7Anbr9FpTkh/wFdFJnNOPq7xexsc95BtP1w8JuYQi0GveOFzHS0w2iZwAsiRtucR2xN/UAX9RyZ5G2TyWxJXnP65ri6p/GtnInB9ntJYrgeBiAYS1bAH300X6o3eOvSPlMULdcEjMxO2Vb02g/VkHcj0Imi+FZQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322837128204.69261439103116; Mon, 6 Jan 2020 07:00:37 -0800 (PST) Received: from localhost ([::1]:53044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTrv-0004OX-Qv for importer@patchew.org; Mon, 06 Jan 2020 10:00:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44289) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbg-0007OR-5h for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbc-0000s1-Jx for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:48 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:20564 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 1ioTbc-0000rs-FC for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:44 -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-28-LASyD0DIPgmK8C6pAnSZpA-1; Mon, 06 Jan 2020 09:43:40 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7926A8C4400; Mon, 6 Jan 2020 14:43:39 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4065F100164D; Mon, 6 Jan 2020 14:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321824; 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=CugtdPlV3P6ys0x+ESsYl6QadaILtmI+aVl7Yj5Jbyo=; b=cGQkjJp/sCHiQOlJ1L/VJSr9hLi+b5RQGVhDBGS5fiGL6s36iK+cqFJxgvZut629WnFGhy OsjtOjL+DUG5e0Oyeo2AI/HaYxVYN5mF32VlA2GgBFN4dclaZ4d5vxnBoy3T/g7aXdEsEN FJw6twduxi9EU8vNX+tRQn+iJAMa+ow= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 28/34] iotests: Disable data_file where it cannot be used Date: Mon, 6 Jan 2020 15:42:00 +0100 Message-Id: <20200106144206.698920-29-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: LASyD0DIPgmK8C6pAnSZpA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Max Reitz Message-id: 20191107163708.833192-22-mreitz@redhat.com [mreitz: Also disable 273] Signed-off-by: Max Reitz --- tests/qemu-iotests/007 | 5 +++-- tests/qemu-iotests/014 | 2 ++ tests/qemu-iotests/015 | 5 +++-- tests/qemu-iotests/026 | 5 ++++- tests/qemu-iotests/029 | 5 +++-- tests/qemu-iotests/031 | 6 +++--- tests/qemu-iotests/036 | 5 +++-- tests/qemu-iotests/039 | 3 +++ tests/qemu-iotests/046 | 2 ++ tests/qemu-iotests/048 | 2 ++ tests/qemu-iotests/051 | 5 +++-- tests/qemu-iotests/058 | 5 +++-- tests/qemu-iotests/060 | 6 ++++-- tests/qemu-iotests/061 | 6 ++++-- tests/qemu-iotests/062 | 2 +- tests/qemu-iotests/066 | 4 +++- tests/qemu-iotests/067 | 6 ++++-- tests/qemu-iotests/068 | 5 +++-- tests/qemu-iotests/071 | 3 +++ tests/qemu-iotests/073 | 4 ++++ tests/qemu-iotests/074 | 2 ++ tests/qemu-iotests/080 | 5 +++-- tests/qemu-iotests/090 | 2 ++ tests/qemu-iotests/098 | 6 ++++-- tests/qemu-iotests/099 | 3 ++- tests/qemu-iotests/103 | 5 +++-- tests/qemu-iotests/108 | 6 ++++-- tests/qemu-iotests/112 | 5 +++-- tests/qemu-iotests/114 | 2 ++ tests/qemu-iotests/121 | 3 +++ tests/qemu-iotests/138 | 3 +++ tests/qemu-iotests/156 | 2 ++ tests/qemu-iotests/176 | 7 +++++-- tests/qemu-iotests/191 | 2 ++ tests/qemu-iotests/201 | 6 +++--- tests/qemu-iotests/214 | 3 ++- tests/qemu-iotests/217 | 3 ++- tests/qemu-iotests/220 | 5 +++-- tests/qemu-iotests/243 | 6 ++++-- tests/qemu-iotests/244 | 5 +++-- tests/qemu-iotests/250 | 2 ++ tests/qemu-iotests/261 | 3 ++- tests/qemu-iotests/267 | 5 +++-- tests/qemu-iotests/273 | 3 +++ 44 files changed, 127 insertions(+), 53 deletions(-) diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007 index 7d3544b479..160683adf8 100755 --- a/tests/qemu-iotests/007 +++ b/tests/qemu-iotests/007 @@ -41,8 +41,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto generic # refcount_bits must be at least 4 so we can create ten internal snapshots -# (1 bit supports none, 2 bits support two, 4 bits support 14) -_unsupported_imgopts 'refcount_bits=3D\(1\|2\)[^0-9]' +# (1 bit supports none, 2 bits support two, 4 bits support 14); +# snapshot are generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D\(1\|2\)[^0-9]' data_file =20 echo echo "creating image" diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014 index 2f728a1956..e1221c0fff 100755 --- a/tests/qemu-iotests/014 +++ b/tests/qemu-iotests/014 @@ -43,6 +43,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# Compression and snapshots do not work with external data files +_unsupported_imgopts data_file =20 TEST_OFFSETS=3D"0 4294967296" TEST_OPS=3D"writev read write readv" diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015 index eec5387f3d..4d8effd0ae 100755 --- a/tests/qemu-iotests/015 +++ b/tests/qemu-iotests/015 @@ -40,8 +40,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # actually any format that supports snapshots _supported_fmt qcow2 _supported_proto generic -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 echo echo "creating image" diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026 index 3430029ed6..a4aa74764f 100755 --- a/tests/qemu-iotests/026 +++ b/tests/qemu-iotests/026 @@ -49,7 +49,10 @@ _supported_cache_modes writethrough none # 32 and 64 bits do not work either, however, due to different leaked clus= ter # count on error. # Thus, the only remaining option is refcount_bits=3D16. -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# +# As for data_file, none of the refcount tests can work for it. +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' \ + data_file =20 echo "Errors while writing 128 kB" echo diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029 index 9254ede5e5..2161a4b87a 100755 --- a/tests/qemu-iotests/029 +++ b/tests/qemu-iotests/029 @@ -42,8 +42,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto generic _unsupported_proto vxhs -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 offset_size=3D24 offset_l1_size=3D36 diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031 index c44fcf91bb..646ecd593f 100755 --- a/tests/qemu-iotests/031 +++ b/tests/qemu-iotests/031 @@ -40,9 +40,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file -# We want to test compat=3D0.10, which does not support refcount widths -# other than 16 -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# We want to test compat=3D0.10, which does not support external data +# files or refcount widths other than 16 +_unsupported_imgopts data_file 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' =20 CLUSTER_SIZE=3D65536 =20 diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036 index bbaf0ef45b..512598421c 100755 --- a/tests/qemu-iotests/036 +++ b/tests/qemu-iotests/036 @@ -43,8 +43,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto file -# Only qcow2v3 and later supports feature bits -_unsupported_imgopts 'compat=3D0.10' +# Only qcow2v3 and later supports feature bits; +# qcow2.py does not support external data files +_unsupported_imgopts 'compat=3D0.10' data_file =20 echo echo =3D=3D=3D Image with unknown incompatible feature bit =3D=3D=3D diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 99563bf126..ddce48ab47 100755 --- a/tests/qemu-iotests/039 +++ b/tests/qemu-iotests/039 @@ -44,6 +44,9 @@ _supported_proto file _supported_os Linux _default_cache_mode writethrough _supported_cache_modes writethrough +# Some of these test cases expect no external data file so that all +# clusters are part of the qcow2 image and refcounted +_unsupported_imgopts data_file =20 size=3D128M =20 diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046 index 4e03ead7b1..a066eec605 100755 --- a/tests/qemu-iotests/046 +++ b/tests/qemu-iotests/046 @@ -38,6 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file +# data_file does not support compressed clusters +_unsupported_imgopts data_file =20 CLUSTER_SIZE=3D64k size=3D128M diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048 index a8feb76184..2af6b74b41 100755 --- a/tests/qemu-iotests/048 +++ b/tests/qemu-iotests/048 @@ -49,6 +49,8 @@ _compare() _supported_fmt raw qcow2 qed luks _supported_proto file _supported_os Linux +# Using 'cp' is incompatible with external data files +_unsupported_imgopts data_file =20 # Remove once all tests are fixed to use TEST_IMG_FILE # correctly and common.rc sets it unconditionally diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index d7294d80d9..034d3a3250 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -39,8 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _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]\|$\)\)' +# other than refcount_bits=3D16; +# it also will not support an external data file +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file _require_drivers nbd =20 do_run_qemu() diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058 index ed01115fa3..d5304bb404 100755 --- a/tests/qemu-iotests/058 +++ b/tests/qemu-iotests/058 @@ -56,8 +56,9 @@ _supported_fmt qcow2 _supported_proto file _supported_os Linux _require_command QEMU_NBD -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 nbd_snapshot_img=3D"nbd:unix:$nbd_unix_socket" =20 diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index 1411781618..043f12904a 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -48,8 +48,10 @@ _filter_io_error() _supported_fmt qcow2 _supported_proto file _supported_os Linux -# These tests only work for compat=3D1.1 images with refcount_bits=3D16 -_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D\([^1]\|.\([^6]\|$\)= \)' +# These tests only work for compat=3D1.1 images without an external +# data file with refcount_bits=3D16 +_unsupported_imgopts 'compat=3D0.10' data_file \ + 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' =20 # The repair process will create a large file - so check for availability = first _require_large_file 64G diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index aad6b72d8a..36b040491f 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -42,8 +42,10 @@ _supported_fmt qcow2 _supported_proto file _supported_os Linux # Conversion between different compat versions can only really work -# with refcount_bits=3D16 -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# with refcount_bits=3D16; +# we have explicit tests for data_file here, but the whole test does +# not work with it +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file =20 echo echo "=3D=3D=3D Testing version downgrade with zero expansion =3D=3D=3D" diff --git a/tests/qemu-iotests/062 b/tests/qemu-iotests/062 index 0df8667e5a..f26b88df9d 100755 --- a/tests/qemu-iotests/062 +++ b/tests/qemu-iotests/062 @@ -41,7 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto generic # We need zero clusters and snapshots -_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' data_file =20 IMG_SIZE=3D64M =20 diff --git a/tests/qemu-iotests/066 b/tests/qemu-iotests/066 index 71e8df598a..a4ac613f8e 100755 --- a/tests/qemu-iotests/066 +++ b/tests/qemu-iotests/066 @@ -40,7 +40,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto generic # We need zero clusters and snapshots -_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' +# (TODO: Consider splitting the snapshot part into a separate test +# file, so this one runs with refcount_bits=3D1 and data_file) +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' data_file =20 # Intentionally create an unaligned image IMG_SIZE=3D$((64 * 1024 * 1024 + 512)) diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067 index 926c79b37c..a63be9cabf 100755 --- a/tests/qemu-iotests/067 +++ b/tests/qemu-iotests/067 @@ -32,8 +32,10 @@ status=3D1 # failure is the default! =20 _supported_fmt qcow2 _supported_proto file -# Because anything other than 16 would change the output of query-block -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# Because anything other than 16 would change the output of query-block, +# and external data files would change the output of +# query-named-block-nodes +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file =20 do_run_qemu() { diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index fe9d7ae1be..ccd1a9f1db 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -39,8 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This tests qcow2-specific low-level functionality _supported_fmt qcow2 _supported_proto generic -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'compat=3D0.10' 'refcount_bits=3D1[^0-9]' data_file =20 IMG_SIZE=3D128K =20 diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071 index 4e31943244..88faebcc1d 100755 --- a/tests/qemu-iotests/071 +++ b/tests/qemu-iotests/071 @@ -39,6 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _require_drivers blkdebug blkverify +# blkdebug can only inject errors on bs->file, not on the data_file, +# so thie test does not work with external data files +_unsupported_imgopts data_file =20 do_run_qemu() { diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073 index e684b1b780..23a1bdf890 100755 --- a/tests/qemu-iotests/073 +++ b/tests/qemu-iotests/073 @@ -39,6 +39,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto generic _unsupported_proto vxhs +# External data files do not support compressed clusters +# (TODO: Consider writing a version for external data files that does +# not test compressed clusters) +_unsupported_imgopts data_file =20 CLUSTER_SIZE=3D64k size=3D128M diff --git a/tests/qemu-iotests/074 b/tests/qemu-iotests/074 index 62be89a0d9..db03edf0b0 100755 --- a/tests/qemu-iotests/074 +++ b/tests/qemu-iotests/074 @@ -50,6 +50,8 @@ _compare() _supported_fmt qcow2 _supported_proto file _supported_os Linux +# blkdebug can only inject errors on bs->file +_unsupported_imgopts data_file =20 # Setup test basic parameters TEST_IMG2=3D$TEST_IMG.2 diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080 index b1ecafb41e..a3d13c414e 100755 --- a/tests/qemu-iotests/080 +++ b/tests/qemu-iotests/080 @@ -40,9 +40,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# - Internal snapshots are (currently) impossible with refcount_bits=3D1 +# - Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files # - This is generally a test for compat=3D1.1 images -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' 'compat=3D0.10' +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file 'compat=3D0.10' =20 header_size=3D104 =20 diff --git a/tests/qemu-iotests/090 b/tests/qemu-iotests/090 index 9f8cfbb80f..1246e4f910 100755 --- a/tests/qemu-iotests/090 +++ b/tests/qemu-iotests/090 @@ -38,6 +38,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file nfs +# External data files do not support compressed clusters +_unsupported_imgopts data_file =20 IMG_SIZE=3D128K =20 diff --git a/tests/qemu-iotests/098 b/tests/qemu-iotests/098 index 700068b328..1e29d96b3d 100755 --- a/tests/qemu-iotests/098 +++ b/tests/qemu-iotests/098 @@ -40,8 +40,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file -# The code path we want to test here only works for compat=3D1.1 images -_unsupported_imgopts 'compat=3D0.10' +# The code path we want to test here only works for compat=3D1.1 images; +# blkdebug can only inject errors on bs->file, so external data files +# do not work with this test +_unsupported_imgopts 'compat=3D0.10' data_file =20 for event in l1_update empty_image_prepare reftable_update refblock_alloc;= do =20 diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099 index b383c11e6a..65e8e92572 100755 --- a/tests/qemu-iotests/099 +++ b/tests/qemu-iotests/099 @@ -46,8 +46,9 @@ _supported_fmt qcow qcow2 qed vdi vhdx vmdk vpc _supported_proto file _supported_os Linux _require_drivers blkdebug blkverify +# data_file would change the json:{} filenames _unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" data_file =20 do_run_qemu() { diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103 index 554b9de054..8c1ebe0443 100755 --- a/tests/qemu-iotests/103 +++ b/tests/qemu-iotests/103 @@ -38,8 +38,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file nfs -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 IMG_SIZE=3D64K =20 diff --git a/tests/qemu-iotests/108 b/tests/qemu-iotests/108 index 3324c86b5f..5f7076fba4 100755 --- a/tests/qemu-iotests/108 +++ b/tests/qemu-iotests/108 @@ -41,8 +41,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# This test directly modifies a refblock so it relies on refcount_bits bei= ng 16 -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# This test directly modifies a refblock so it relies on refcount_bits bei= ng 16; +# and the low-level modification it performs are not tuned for external da= ta +# files +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file =20 echo echo '=3D=3D=3D Repairing an image without any refcount table =3D=3D=3D' diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112 index 6850225939..20ff5c224a 100755 --- a/tests/qemu-iotests/112 +++ b/tests/qemu-iotests/112 @@ -40,8 +40,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file # This test will set refcount_bits on its own which would conflict with the -# manual setting; compat will be overridden as well -_unsupported_imgopts refcount_bits 'compat=3D0.10' +# manual setting; compat will be overridden as well; +# and external data files do not work well with our refcount testing +_unsupported_imgopts refcount_bits 'compat=3D0.10' data_file =20 print_refcount_bits() { diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114 index f90a744fc0..26104fff6c 100755 --- a/tests/qemu-iotests/114 +++ b/tests/qemu-iotests/114 @@ -39,6 +39,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto generic _unsupported_proto vxhs +# qcow2.py does not work too well with external data files +_unsupported_imgopts data_file =20 =20 TEST_IMG=3D"$TEST_IMG.base" _make_test_img 64M diff --git a/tests/qemu-iotests/121 b/tests/qemu-iotests/121 index 10db813d94..90ea0db737 100755 --- a/tests/qemu-iotests/121 +++ b/tests/qemu-iotests/121 @@ -39,6 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# Refcount structures are used much differently with external data +# files +_unsupported_imgopts data_file =20 echo echo '=3D=3D=3D New refcount structures may not conflict with existing str= uctures =3D=3D=3D' diff --git a/tests/qemu-iotests/138 b/tests/qemu-iotests/138 index 26d18ac8b6..54b01046ad 100755 --- a/tests/qemu-iotests/138 +++ b/tests/qemu-iotests/138 @@ -40,6 +40,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# With an external data file, data clusters are not refcounted +# (and so qemu-img check does not check their refcount) +_unsupported_imgopts data_file =20 echo echo '=3D=3D=3D Check on an image with a multiple of 2^32 clusters =3D=3D= =3D' diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 index 3f27db71f2..5559df63a5 100755 --- a/tests/qemu-iotests/156 +++ b/tests/qemu-iotests/156 @@ -51,6 +51,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 qed _supported_proto generic _unsupported_proto vxhs +# Copying files around with cp does not work with external data files +_unsupported_imgopts data_file =20 # Create source disk TEST_IMG=3D"$TEST_IMG.backing" _make_test_img 1M diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176 index 50df4c00fa..117c8b6954 100755 --- a/tests/qemu-iotests/176 +++ b/tests/qemu-iotests/176 @@ -47,8 +47,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# Persistent dirty bitmaps require compat=3D1.1 -_unsupported_imgopts 'compat=3D0.10' +# Persistent dirty bitmaps require compat=3D1.1; +# Internal snapshots forbid using an external data file +# (they work with refcount_bits=3D1 here, though, because there actually +# is no data when creating the snapshot) +_unsupported_imgopts 'compat=3D0.10' data_file =20 run_qemu() { diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191 index 23ab0ce899..b05db68141 100755 --- a/tests/qemu-iotests/191 +++ b/tests/qemu-iotests/191 @@ -43,6 +43,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file +# An external data file would change the query-named-block-nodes output +_unsupported_imgopts data_file =20 size=3D64M =20 diff --git a/tests/qemu-iotests/201 b/tests/qemu-iotests/201 index 86fa37e714..133ba9f03e 100755 --- a/tests/qemu-iotests/201 +++ b/tests/qemu-iotests/201 @@ -43,9 +43,9 @@ _supported_fmt qcow2 _supported_proto generic _supported_os Linux =20 -# Internal snapshots are (currently) impossible with refcount_bits=3D1 -# This was taken from test 080 -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 size=3D64M _make_test_img $size diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214 index 21ec8a2ad8..0f2e61280a 100755 --- a/tests/qemu-iotests/214 +++ b/tests/qemu-iotests/214 @@ -39,7 +39,8 @@ _supported_proto file =20 # Repairing the corrupted image requires qemu-img check to store a # refcount up to 3, which requires at least two refcount bits. -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# External data files do not support compressed clusters. +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 =20 echo diff --git a/tests/qemu-iotests/217 b/tests/qemu-iotests/217 index 58a78a6098..d89116ccad 100755 --- a/tests/qemu-iotests/217 +++ b/tests/qemu-iotests/217 @@ -40,7 +40,8 @@ _supported_proto file =20 # This test needs clusters with at least a refcount of 2 so that # OFLAG_COPIED is not set. refcount_bits=3D1 is therefore unsupported. -_unsupported_imgopts 'refcount_bits=3D1[^0-9]' +# (As are external data files.) +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 echo echo '=3D=3D=3D Simulating an I/O error during snapshot deletion =3D=3D=3D' diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220 index 3f86f24c4d..a9259b7127 100755 --- a/tests/qemu-iotests/220 +++ b/tests/qemu-iotests/220 @@ -37,8 +37,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# To use a different refcount width but 16 bits we need compat=3D1.1 -_unsupported_imgopts 'compat=3D0.10' +# To use a different refcount width but 16 bits we need compat=3D1.1, +# and external data files do not support compressed clusters. +_unsupported_imgopts 'compat=3D0.10' data_file =20 echo "=3D=3D Creating huge file =3D=3D" =20 diff --git a/tests/qemu-iotests/243 b/tests/qemu-iotests/243 index 3dc3b6a711..a61852f6d9 100755 --- a/tests/qemu-iotests/243 +++ b/tests/qemu-iotests/243 @@ -40,8 +40,10 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# External data files do not work with compat=3D0.10 -_unsupported_imgopts 'compat=3D0.10' +# External data files do not work with compat=3D0.10, and because there +# is an explicit case for external data files here, we cannot allow +# the user to specify whether to use one +_unsupported_imgopts 'compat=3D0.10' data_file =20 for mode in off metadata falloc full; do =20 diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244 index 13263292b0..0d1efee6ef 100755 --- a/tests/qemu-iotests/244 +++ b/tests/qemu-iotests/244 @@ -41,8 +41,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -# External data files do not work with compat=3D0.10 -_unsupported_imgopts 'compat=3D0.10' +# External data files do not work with compat=3D0.10, and because we use +# our own external data file, we cannot let the user specify one +_unsupported_imgopts 'compat=3D0.10' data_file =20 echo echo "=3D=3D=3D Create and open image with external data file =3D=3D=3D" diff --git a/tests/qemu-iotests/250 b/tests/qemu-iotests/250 index 670cf19076..9bb6b94d74 100755 --- a/tests/qemu-iotests/250 +++ b/tests/qemu-iotests/250 @@ -39,6 +39,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# This test does not make much sense with external data files +_unsupported_imgopts data_file =20 # This test checks that qcow2_process_discards does not truncate a discard # request > 2G. diff --git a/tests/qemu-iotests/261 b/tests/qemu-iotests/261 index 9f2817251f..ddcb04f285 100755 --- a/tests/qemu-iotests/261 +++ b/tests/qemu-iotests/261 @@ -47,7 +47,8 @@ _supported_os Linux # (1) We create a v2 image that supports nothing but refcount_bits=3D16 # (2) We do some refcount management on our own which expects # refcount_bits=3D16 -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# As for data files, they do not support snapshots at all. +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file =20 # Parameters: # $1: image filename diff --git a/tests/qemu-iotests/267 b/tests/qemu-iotests/267 index bd9a5c5524..c296877168 100755 --- a/tests/qemu-iotests/267 +++ b/tests/qemu-iotests/267 @@ -42,8 +42,9 @@ _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]' +# Internal snapshots are (currently) impossible with refcount_bits=3D1, +# and generally impossible with external data files +_unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file =20 do_run_qemu() { diff --git a/tests/qemu-iotests/273 b/tests/qemu-iotests/273 index d598c47d9b..00ff79bcf8 100755 --- a/tests/qemu-iotests/273 +++ b/tests/qemu-iotests/273 @@ -37,6 +37,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux +# External data files would add nodes to the block graph, so it would +# not match the reference output +_unsupported_imgopts data_file =20 do_run_qemu() { --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578322877; cv=none; d=zohomail.com; s=zohoarc; b=Fvo0pRd44ofZt7r5YC9ijPK1UkEZw/3nrnGwhDf1dIOCV+xtK+ZOV7YPLPUY1AF3nf5ToFn5Px7NLi0+UTNnZJAimhtvxrkMOwfym4FF3nXJGyPxJh+GDXipWAgFiyf6Wq+5DAZQ1Tw4CpDwTE9aYy/N5Kmmzfadg57b7hP31Fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578322877; 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=8OTAklieXOLYX/lSCA2VGvy3up9ymC7jLemk1W5qafU=; b=gPTedCyILWSKHGWZmcTKM5Ug8hgJCAgzuHjbBrPhVLVDK3/WOUKVQWg9hFt6bYNkQoRZNykar6kmiB3rFYKNUDyCTXE/EYt1A1CxwIeeEJauQmwQJTczOFeHIEb4CRmR95zeIC+lO3xTpsRoOljrJ4nAc9gqYJXJyZQ8/uGPqlc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578322877286127.17316724958971; Mon, 6 Jan 2020 07:01:17 -0800 (PST) Received: from localhost ([::1]:53052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTsZ-0004fL-F5 for importer@patchew.org; Mon, 06 Jan 2020 10:01:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44319) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbh-0007Qs-N7 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbg-0000vK-Az for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:49 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:44007 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 1ioTbg-0000us-6u for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:48 -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-306-LdKWTsz5P1qS13ynVnC4hA-1; Mon, 06 Jan 2020 09:43:43 -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 7066219586E0; Mon, 6 Jan 2020 14:43:42 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDD2250A8F; Mon, 6 Jan 2020 14:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321827; 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=8OTAklieXOLYX/lSCA2VGvy3up9ymC7jLemk1W5qafU=; b=KJ3GsCvn41cjFuP/j3tKp5jn9MVL6ktIU+zKEdAwlElirQhoNFT9J4Si1GViRiYJjh47Cx IV6ebl2sBgqOVjok2/vogCcaSYB5khXpU6adVJcz/tZqWBzeZpQtP4CrM4ZHtrCOwMDzdz u+JaFYs34B4W00F4s84kP0jcpr0KxKE= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 29/34] iotests: Allow check -o data_file Date: Mon, 6 Jan 2020 15:42:01 +0100 Message-Id: <20200106144206.698920-30-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: LdKWTsz5P1qS13ynVnC4hA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The problem with allowing the data_file option is that you want to use a different data file per image used in the test. Therefore, we need to allow patterns like -o data_file=3D'$TEST_IMG.data_file'. Then, we need to filter it out from qemu-img map, qemu-img create, and remove the data file in _rm_test_img. Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-id: 20191107163708.833192-23-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/common.filter | 23 +++++++++++++++++++++-- tests/qemu-iotests/common.rc | 22 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 116cc8a840..3f8ee3e5f7 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -122,7 +122,13 @@ _filter_actual_image_size() # replace driver-specific options in the "Formatting..." line _filter_img_create() { - $SED -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \ + data_file_filter=3D() + if data_file=3D$(_get_data_file "$TEST_IMG"); then + data_file_filter=3D(-e "s# data_file=3D$data_file##") + fi + + $SED "${data_file_filter[@]}" \ + -e "s#$REMOTE_TEST_DIR#TEST_DIR#g" \ -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$SOCK_DIR#SOCK_DIR#g" \ @@ -209,9 +215,22 @@ _filter_img_info() # human and json output _filter_qemu_img_map() { + # Assuming the data_file value in $IMGOPTS contains a '$TEST_IMG', + # create a filter that replaces the data file name by $TEST_IMG. + # Example: + # In $IMGOPTS: 'data_file=3D$TEST_IMG.data_file' + # Then data_file_pattern =3D=3D '\(.*\).data_file' + # And data_file_filter =3D=3D -e 's#\(.*\).data_file#\1# + data_file_filter=3D() + if data_file_pattern=3D$(_get_data_file '\\(.*\\)'); then + data_file_filter=3D(-e "s#$data_file_pattern#\\1#") + fi + $SED -e 's/\([0-9a-fx]* *[0-9a-fx]* *\)[0-9a-fx]* */\1/g' \ -e 's/"offset": [0-9]\+/"offset": OFFSET/g' \ - -e 's/Mapped to *//' | _filter_testdir | _filter_imgfmt + -e 's/Mapped to *//' \ + "${data_file_filter[@]}" \ + | _filter_testdir | _filter_imgfmt } =20 _filter_nbd() diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 7d704f9573..d088392ab6 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -298,6 +298,20 @@ _stop_nbd_server() fi } =20 +# Gets the data_file value from IMGOPTS and replaces the '$TEST_IMG' +# pattern by '$1' +# Caution: The replacement is done with sed, so $1 must be escaped +# properly. (The delimiter is '#'.) +_get_data_file() +{ + if ! echo "$IMGOPTS" | grep -q 'data_file=3D'; then + return 1 + fi + + echo "$IMGOPTS" | sed -e 's/.*data_file=3D\([^,]*\).*/\1/' \ + | sed -e "s#\\\$TEST_IMG#$1#" +} + _make_test_img() { # extra qemu-img options can be added by tests @@ -318,7 +332,8 @@ _make_test_img() fi =20 if [ -n "$IMGOPTS" ]; then - optstr=3D$(_optstr_add "$optstr" "$IMGOPTS") + imgopts_expanded=3D$(echo "$IMGOPTS" | sed -e "s#\\\$TEST_IMG#$img= _name#") + optstr=3D$(_optstr_add "$optstr" "$imgopts_expanded") fi if [ -n "$IMGKEYSECRET" ]; then object_options=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEYSECRE= T" @@ -400,6 +415,11 @@ _rm_test_img() # Remove all the extents for vmdk "$QEMU_IMG" info "$img" 2>/dev/null | grep 'filename:' | cut -f 2 = -d: \ | xargs -I {} rm -f "{}" + elif [ "$IMGFMT" =3D "qcow2" ]; then + # Remove external data file + if data_file=3D$(_get_data_file "$img"); then + rm -f "$data_file" + fi fi rm -f "$img" } --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323109; cv=none; d=zohomail.com; s=zohoarc; b=UhPZg/t1o138fGpR0aIdz1C6kTLFKwIO0hFcqgPx5L6q1lKfEUnqufmdG80d+aZ9yhyDZkeV5J2MXlgx18OQkqsu3bpXvEI7d6U7BzMxpnEb3I0pK/D5jgaqBqoOQrkiVqfE++ZVx+A7Pwulm5UutqqrwRdj2xAT8YagRfrCxQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323109; 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=ALrgf1ejh1uyRY0B/Cnfkz3HYp0WNNSyUUF0a8TRbWI=; b=DRFfkWNBCQGKLXK5q5qq1rp0uOwvo+qO3tAFT4pZMYsECksgbfyNO5QctS67yA7IeFczX2F++tcQRzj4ukBUD3WTU79KExmADsPiNVIsa/COw7dBDFlXUVS363i+5E+M+osSNxflByx+5HjD5weHzig6a7OP/j55sSc1rPAT/qk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578323109294875.8088593856187; Mon, 6 Jan 2020 07:05:09 -0800 (PST) Received: from localhost ([::1]:53110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTwJ-00008j-N2 for importer@patchew.org; Mon, 06 Jan 2020 10:05:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44371) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbk-0007Uu-7X for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbi-0000wl-9O for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:52 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58844 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 1ioTbi-0000wM-5K for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:50 -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-389-LI9gq9H9P9GZYo67oqi6Lw-1; Mon, 06 Jan 2020 09:43:46 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B953805141; Mon, 6 Jan 2020 14:43:45 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99F91691AD; Mon, 6 Jan 2020 14:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321829; 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=ALrgf1ejh1uyRY0B/Cnfkz3HYp0WNNSyUUF0a8TRbWI=; b=d4Sgx+G4qMJMH9JJIUJkOmaoxqmrWH+ngnEs/oGVfZhhATVBh8x9tv2ConIEidAzDQGCf4 T9U7lT26FBb1O/pQN8kMdi+GHUGm37uaLuAM+omnBqVxWcFy9Swyi/vePmRQbpuzgndaLW 9lUygPVNXBwMCBNNWlSlt9D2eD+B4O4= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 30/34] block: introduce compress filter driver Date: Mon, 6 Jan 2020 15:42:02 +0100 Message-Id: <20200106144206.698920-31-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: LI9gq9H9P9GZYo67oqi6Lw-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Andrey Shinkevich Allow writing all the data compressed through the filter driver. The written data will be aligned by the cluster size. Based on the QEMU current implementation, that data can be written to unallocated clusters only. May be used for a backup job. Suggested-by: Max Reitz Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 1575288906-551879-2-git-send-email-andrey.shinkevich@virtuozzo.= com [mreitz: Replace NULL bdrv_get_format_name() by "(no format)"] Signed-off-by: Max Reitz --- block/Makefile.objs | 1 + block/filter-compress.c | 168 ++++++++++++++++++++++++++++++++++++++++ qapi/block-core.json | 10 ++- 3 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 block/filter-compress.c diff --git a/block/Makefile.objs b/block/Makefile.objs index e394fe0b6c..330529b0b7 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -43,6 +43,7 @@ block-obj-y +=3D crypto.o =20 block-obj-y +=3D aio_task.o block-obj-y +=3D backup-top.o +block-obj-y +=3D filter-compress.o =20 common-obj-y +=3D stream.o =20 diff --git a/block/filter-compress.c b/block/filter-compress.c new file mode 100644 index 0000000000..60137fb680 --- /dev/null +++ b/block/filter-compress.c @@ -0,0 +1,168 @@ +/* + * Compress filter block driver + * + * Copyright (c) 2019 Virtuozzo International GmbH + * + * Author: + * Andrey Shinkevich + * (based on block/copy-on-read.c by Max Reitz) + * + * 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 or + * (at your option) any later version of the License. + * + * 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 . + */ + +#include "qemu/osdep.h" +#include "block/block_int.h" +#include "qemu/module.h" +#include "qapi/error.h" + + +static int compress_open(BlockDriverState *bs, QDict *options, int flags, + Error **errp) +{ + bs->file =3D bdrv_open_child(NULL, options, "file", bs, &child_file, f= alse, + errp); + if (!bs->file) { + return -EINVAL; + } + + if (!bs->file->bs->drv || !block_driver_can_compress(bs->file->bs->drv= )) { + error_setg(errp, + "Compression is not supported for underlying format: %s= ", + bdrv_get_format_name(bs->file->bs) ?: "(no format)"); + + return -ENOTSUP; + } + + bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | + (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); + + bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & + bs->file->bs->supported_zero_flags); + + return 0; +} + + +static int64_t compress_getlength(BlockDriverState *bs) +{ + return bdrv_getlength(bs->file->bs); +} + + +static int coroutine_fn compress_co_preadv_part(BlockDriverState *bs, + uint64_t offset, uint64_t = bytes, + QEMUIOVector *qiov, + size_t qiov_offset, + int flags) +{ + return bdrv_co_preadv_part(bs->file, offset, bytes, qiov, qiov_offset, + flags); +} + + +static int coroutine_fn compress_co_pwritev_part(BlockDriverState *bs, + uint64_t offset, + uint64_t bytes, + QEMUIOVector *qiov, + size_t qiov_offset, int f= lags) +{ + return bdrv_co_pwritev_part(bs->file, offset, bytes, qiov, qiov_offset, + flags | BDRV_REQ_WRITE_COMPRESSED); +} + + +static int coroutine_fn compress_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, int byte= s, + BdrvRequestFlags flags) +{ + return bdrv_co_pwrite_zeroes(bs->file, offset, bytes, flags); +} + + +static int coroutine_fn compress_co_pdiscard(BlockDriverState *bs, + int64_t offset, int bytes) +{ + return bdrv_co_pdiscard(bs->file, offset, bytes); +} + + +static void compress_refresh_limits(BlockDriverState *bs, Error **errp) +{ + BlockDriverInfo bdi; + int ret; + + if (!bs->file) { + return; + } + + ret =3D bdrv_get_info(bs->file->bs, &bdi); + if (ret < 0 || bdi.cluster_size =3D=3D 0) { + return; + } + + bs->bl.request_alignment =3D bdi.cluster_size; +} + + +static void compress_eject(BlockDriverState *bs, bool eject_flag) +{ + bdrv_eject(bs->file->bs, eject_flag); +} + + +static void compress_lock_medium(BlockDriverState *bs, bool locked) +{ + bdrv_lock_medium(bs->file->bs, locked); +} + + +static bool compress_recurse_is_first_non_filter(BlockDriverState *bs, + BlockDriverState *candida= te) +{ + return bdrv_recurse_is_first_non_filter(bs->file->bs, candidate); +} + + +static BlockDriver bdrv_compress =3D { + .format_name =3D "compress", + + .bdrv_open =3D compress_open, + .bdrv_child_perm =3D bdrv_filter_default_perms, + + .bdrv_getlength =3D compress_getlength, + + .bdrv_co_preadv_part =3D compress_co_preadv_part, + .bdrv_co_pwritev_part =3D compress_co_pwritev_part, + .bdrv_co_pwrite_zeroes =3D compress_co_pwrite_zeroes, + .bdrv_co_pdiscard =3D compress_co_pdiscard, + .bdrv_refresh_limits =3D compress_refresh_limits, + + .bdrv_eject =3D compress_eject, + .bdrv_lock_medium =3D compress_lock_medium, + + .bdrv_co_block_status =3D bdrv_co_block_status_from_file, + + .bdrv_recurse_is_first_non_filter =3D compress_recurse_is_first_non_= filter, + + .has_variable_length =3D true, + .is_filter =3D true, +}; + +static void bdrv_compress_init(void) +{ + bdrv_register(&bdrv_compress); +} + +block_init(bdrv_compress_init); diff --git a/qapi/block-core.json b/qapi/block-core.json index 839b10b3f0..7ff5e5edaf 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2884,15 +2884,16 @@ # @copy-on-read: Since 3.0 # @blklogwrites: Since 3.0 # @blkreplay: Since 4.2 +# @compress: Since 5.0 # # Since: 2.9 ## { 'enum': 'BlockdevDriver', 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs', - 'cloop', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps', 'gluste= r', - 'host_cdrom', 'host_device', 'http', 'https', 'iscsi', 'luks', - 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'qco= w', - 'qcow2', 'qed', 'quorum', 'raw', 'rbd', + 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ft= ps', + 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscs= i', + 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallel= s', + 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' }, 'sheepdog', 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxh= s' ] } @@ -4060,6 +4061,7 @@ 'blkreplay': 'BlockdevOptionsBlkreplay', 'bochs': 'BlockdevOptionsGenericFormat', 'cloop': 'BlockdevOptionsGenericFormat', + 'compress': 'BlockdevOptionsGenericFormat', 'copy-on-read':'BlockdevOptionsGenericFormat', 'dmg': 'BlockdevOptionsGenericFormat', 'file': 'BlockdevOptionsFile', --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323727; cv=none; d=zohomail.com; s=zohoarc; b=Oy5uu0jMVtOUVTTNc13/svTafHfrnQRYAe7wI3c24kYHzWBxmBYhJvBjRc4nAqQn9elfdpNdS/VyYEexMVoxpysB1LKU3/39tz9g+X38xB/TtIdMrXXqVqxXjlLjsjWEuz4MkBWGJHsGC7YO3PnLn7VOaLQWZGuqx1sgwkuoDXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323727; 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=Hm6QfIxR3LaHwtOs1bSTrud2MauR+uxy3BxBrarzp/c=; b=BndWs9X2PhId2N2dfGUlxe8Hi7+Qg919YlML685/oVeupsTRFerI30weBRQbc8jG5kuITj+rz3oWj29Gbgwgp8DrA+sJziewpOMG0GRk9Gm+mCNe7qdT51Ex0TsKINUWMdGDCrR6cqVoYjj5iCaP1dAuSr7cq6onu0AUw2a7oG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157832372728496.94851969874821; Mon, 6 Jan 2020 07:15:27 -0800 (PST) Received: from localhost ([::1]:53280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioU6H-00052K-8s for importer@patchew.org; Mon, 06 Jan 2020 10:15:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44369) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbk-0007Uc-1x for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbi-0000ww-GE for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30320 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 1ioTbi-0000wP-CC for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:50 -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-1XabV9-wPWu4sIpw4fp7vQ-1; Mon, 06 Jan 2020 09:43:48 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78CB0107BAA9; Mon, 6 Jan 2020 14:43:47 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16433100164D; Mon, 6 Jan 2020 14:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321829; 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=Hm6QfIxR3LaHwtOs1bSTrud2MauR+uxy3BxBrarzp/c=; b=JZGB72tn2ZXQSHQo044AOgad0lwyUvHg1M5z6VZPHUebyVSPaBjIeUifjAjyHpG0q3zGpB lVQFXEwEGIKc/nThG1LUuwlSruxKeQtvM6NUUZreP5i7fIDSIF990p41qCSy3wGzXz/RWA BZdKl+S5NBHatJcesGf+ESCRaQCW6dI= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 31/34] qcow2: Allow writing compressed data of multiple clusters Date: Mon, 6 Jan 2020 15:42:03 +0100 Message-Id: <20200106144206.698920-32-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 1XabV9-wPWu4sIpw4fp7vQ-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Andrey Shinkevich QEMU currently supports writing compressed data of the size equal to one cluster. This patch allows writing QCOW2 compressed data that exceed one cluster. Now, we split buffered data into separate clusters and write them compressed using the block/aio_task API. Suggested-by: Pavel Butsykin Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 1575288906-551879-3-git-send-email-andrey.shinkevich@virtuozzo.= com Signed-off-by: Max Reitz --- block/qcow2.c | 102 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 27 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7fbaac8457..cef9d72b3a 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -4221,10 +4221,8 @@ fail: return ret; } =20 -/* XXX: put compressed sectors first, then all the cluster aligned - tables to avoid losing bytes in alignment */ static coroutine_fn int -qcow2_co_pwritev_compressed_part(BlockDriverState *bs, +qcow2_co_pwritev_compressed_task(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, size_t qiov_offset) { @@ -4234,32 +4232,11 @@ qcow2_co_pwritev_compressed_part(BlockDriverState *= bs, uint8_t *buf, *out_buf; uint64_t cluster_offset; =20 - if (has_data_file(bs)) { - return -ENOTSUP; - } - - if (bytes =3D=3D 0) { - /* align end of file to a sector boundary to ease reading with - sector based I/Os */ - int64_t len =3D bdrv_getlength(bs->file->bs); - if (len < 0) { - return len; - } - return bdrv_co_truncate(bs->file, len, false, PREALLOC_MODE_OFF, N= ULL); - } - - if (offset_into_cluster(s, offset)) { - return -EINVAL; - } + assert(bytes =3D=3D s->cluster_size || (bytes < s->cluster_size && + (offset + bytes =3D=3D bs->total_sectors << BDRV_SECTOR_BITS))); =20 buf =3D qemu_blockalign(bs, s->cluster_size); - if (bytes !=3D s->cluster_size) { - if (bytes > s->cluster_size || - offset + bytes !=3D bs->total_sectors << BDRV_SECTOR_BITS) - { - qemu_vfree(buf); - return -EINVAL; - } + if (bytes < s->cluster_size) { /* Zero-pad last write if image size is not cluster aligned */ memset(buf + bytes, 0, s->cluster_size - bytes); } @@ -4308,6 +4285,77 @@ fail: return ret; } =20 +static coroutine_fn int qcow2_co_pwritev_compressed_task_entry(AioTask *ta= sk) +{ + Qcow2AioTask *t =3D container_of(task, Qcow2AioTask, task); + + assert(!t->cluster_type && !t->l2meta); + + return qcow2_co_pwritev_compressed_task(t->bs, t->offset, t->bytes, t-= >qiov, + t->qiov_offset); +} + +/* + * XXX: put compressed sectors first, then all the cluster aligned + * tables to avoid losing bytes in alignment + */ +static coroutine_fn int +qcow2_co_pwritev_compressed_part(BlockDriverState *bs, + uint64_t offset, uint64_t bytes, + QEMUIOVector *qiov, size_t qiov_offset) +{ + BDRVQcow2State *s =3D bs->opaque; + AioTaskPool *aio =3D NULL; + int ret =3D 0; + + if (has_data_file(bs)) { + return -ENOTSUP; + } + + if (bytes =3D=3D 0) { + /* + * align end of file to a sector boundary to ease reading with + * sector based I/Os + */ + int64_t len =3D bdrv_getlength(bs->file->bs); + if (len < 0) { + return len; + } + return bdrv_co_truncate(bs->file, len, false, PREALLOC_MODE_OFF, N= ULL); + } + + if (offset_into_cluster(s, offset)) { + return -EINVAL; + } + + while (bytes && aio_task_pool_status(aio) =3D=3D 0) { + uint64_t chunk_size =3D MIN(bytes, s->cluster_size); + + if (!aio && chunk_size !=3D bytes) { + aio =3D aio_task_pool_new(QCOW2_MAX_WORKERS); + } + + ret =3D qcow2_add_task(bs, aio, qcow2_co_pwritev_compressed_task_e= ntry, + 0, 0, offset, chunk_size, qiov, qiov_offset, = NULL); + if (ret < 0) { + break; + } + qiov_offset +=3D chunk_size; + offset +=3D chunk_size; + bytes -=3D chunk_size; + } + + if (aio) { + aio_task_pool_wait_all(aio); + if (ret =3D=3D 0) { + ret =3D aio_task_pool_status(aio); + } + g_free(aio); + } + + return ret; +} + static int coroutine_fn qcow2_co_preadv_compressed(BlockDriverState *bs, uint64_t file_cluster_offset, --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323629; cv=none; d=zohomail.com; s=zohoarc; b=MpZi1VtZw7V76lOJerHfaFQUGh0RkZIZEf5VQXeAhBJovNIcSCyKbBsqO1OfisM6mhkq5wCu34CkHsnk6iFaCiZ30sVqfSAbbNuKUWDNBbDVMFQNx40aFM2CFfuCXSz5A0K74zMpfLGynqc0ZfYZO0bQ+7GAX7aZLN8lF0Q55/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323629; 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=1DeSUCviWHZQY9JorE/4l/D0VLkp714elLDjRGRsT3w=; b=K8XHzBeCn0JpZ2PVAX29dE3gM+TRvPo7zQK26mVQwPzUEPsO2nk8tYAdWq320xlIcZTatkdFpT7Vn77iZudRa2jtxJCVqBUUBY+9a/prWj6aTcXDcx/bNRcIPI3RFi798DQsQUnNvAVlhECIAaHaCs3bl2u8su2i20qb8Gfho9k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578323629888116.80847122755802; Mon, 6 Jan 2020 07:13:49 -0800 (PST) Received: from localhost ([::1]:53272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioU4i-0003Qa-C9 for importer@patchew.org; Mon, 06 Jan 2020 10:13:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbo-0007bc-F1 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbn-00010n-13 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:56 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46498 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 1ioTbm-00010K-Sa for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43: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-253-XLXAmsEmNLC_avfGINCcyg-1; Mon, 06 Jan 2020 09:43:51 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC8DA100F7E4; Mon, 6 Jan 2020 14:43:49 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F2D860C88; Mon, 6 Jan 2020 14:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321834; 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=1DeSUCviWHZQY9JorE/4l/D0VLkp714elLDjRGRsT3w=; b=IdoTCz0kaBaAlvQ/z2BfgTduJw8Os91+F2GcYWSGZCM9AFZzIQIuc4gTGNHbhRGOchWF4P dItZmF8KKWSCx34Lr25wuKeLTgcMIy394G5I4bymb7tr2G5+ME1359wL+PFbgvHtfWnrRH F7fU+ULe3BGPMRvfWw/cxkrnMj1JNjI= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 32/34] tests/qemu-iotests: add case to write compressed data of multiple clusters Date: Mon, 6 Jan 2020 15:42:04 +0100 Message-Id: <20200106144206.698920-33-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: XLXAmsEmNLC_avfGINCcyg-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Andrey Shinkevich Add the case to the iotest #214 that checks possibility of writing compressed data of more than one cluster size. The test case involves the compress filter driver showing a sample usage of that. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 1575288906-551879-4-git-send-email-andrey.shinkevich@virtuozzo.= com Signed-off-by: Max Reitz --- tests/qemu-iotests/214 | 43 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/214.out | 14 +++++++++++++ 2 files changed, 57 insertions(+) diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214 index 0f2e61280a..3500e0c47a 100755 --- a/tests/qemu-iotests/214 +++ b/tests/qemu-iotests/214 @@ -90,6 +90,49 @@ _check_test_img -r all $QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir $QEMU_IO -c "read -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir =20 +echo +echo "=3D=3D=3D Write compressed data of multiple clusters =3D=3D=3D" +echo +cluster_size=3D0x10000 +_make_test_img 2M -o cluster_size=3D$cluster_size + +echo "Write uncompressed data:" +let data_size=3D"8 * $cluster_size" +$QEMU_IO -c "write -P 0xaa 0 $data_size" "$TEST_IMG" \ + 2>&1 | _filter_qemu_io | _filter_testdir +sizeA=3D$($QEMU_IMG info --output=3Djson "$TEST_IMG" | + sed -n '/"actual-size":/ s/[^0-9]//gp') + +_make_test_img 2M -o cluster_size=3D$cluster_size +echo "Write compressed data:" +let data_size=3D"3 * $cluster_size + $cluster_size / 2" +# Set compress on. That will align the written data +# by the cluster size and will write them compressed. +QEMU_IO_OPTIONS=3D$QEMU_IO_OPTIONS_NO_FMT \ +$QEMU_IO -c "write -P 0xbb 0 $data_size" --image-opts \ + "driver=3Dcompress,file.driver=3D$IMGFMT,file.file.driver=3Dfile,= file.file.filename=3D$TEST_IMG" \ + 2>&1 | _filter_qemu_io | _filter_testdir + +let offset=3D"4 * $cluster_size + $cluster_size / 4" +QEMU_IO_OPTIONS=3D$QEMU_IO_OPTIONS_NO_FMT \ +$QEMU_IO -c "write -P 0xcc $offset $data_size" "json:{\ + 'driver': 'compress', + 'file': {'driver': '$IMGFMT', + 'file': {'driver': 'file', + 'filename': '$TEST_IMG'}}}" | \ + _filter_qemu_io | _filter_testdir + +sizeB=3D$($QEMU_IMG info --output=3Djson "$TEST_IMG" | + sed -n '/"actual-size":/ s/[^0-9]//gp') + +if [ $sizeA -le $sizeB ] +then + echo "Compression ERROR" +fi + +$QEMU_IMG check --output=3Djson "$TEST_IMG" | + sed -n 's/,$//; /"compressed-clusters":/ s/^ *//p' + # success, all done echo '*** done' rm -f $seq.full diff --git a/tests/qemu-iotests/214.out b/tests/qemu-iotests/214.out index 0fcd8dc051..9fc67287f8 100644 --- a/tests/qemu-iotests/214.out +++ b/tests/qemu-iotests/214.out @@ -32,4 +32,18 @@ read 4194304/4194304 bytes at offset 0 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 4194304/4194304 bytes at offset 4194304 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Write compressed data of multiple clusters =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2097152 +Write uncompressed data: +wrote 524288/524288 bytes at offset 0 +512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2097152 +Write compressed data: +wrote 229376/229376 bytes at offset 0 +224 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 229376/229376 bytes at offset 278528 +224 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +"compressed-clusters": 8 *** done --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323291; cv=none; d=zohomail.com; s=zohoarc; b=PGYQPzk54q0Gr6Xfx9u31bgtrTQO2kDYued/ZigXIDtgVs4mB05KwgBB9pDbmwL/WnviYpP7YkbPMzfOMJZXTH2Gq836Gr2+2gysrLfNADC7FzDGgN5dmbAlp0qsTlMxvRW6Cqeoer3M75w5cMbmUD8oWotki2X/b9xfqjxiKgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323291; 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=P7Akc2g6+ZtezNqGf6u4OHmfIRFxxk2IeHyU8NufqK0=; b=e+HEY5+cNPSf9YnBSxzIBtxiyRB8UI8Peg+fugfUBUHz/2EV3r6a0dsKhixyp2YRP8Lg8pRObdu9q5UOXobdMaX/+JFhIqkOYaiaH7ZsSubemJ4BqtizcideWKMdvOrNgI005Lokwz9Uo12CmJaaZfaBOETmaap4KPmSl7uIRHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15783232917771023.5952708023057; Mon, 6 Jan 2020 07:08:11 -0800 (PST) Received: from localhost ([::1]:53158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTzG-0004EI-Bj for importer@patchew.org; Mon, 06 Jan 2020 10:08:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44455) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbo-0007bs-K4 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbn-000110-Bo for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:56 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:24364 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 1ioTbn-00010b-7m for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:43:55 -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-297-gGjyLUidPF2vshOLloWtUA-1; Mon, 06 Jan 2020 09:43:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 382CC976E6; Mon, 6 Jan 2020 14:43:52 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0236100164D; Mon, 6 Jan 2020 14:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321834; 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=P7Akc2g6+ZtezNqGf6u4OHmfIRFxxk2IeHyU8NufqK0=; b=e43EX67ag8de1a1a4LkTXtPq07dSNAEgYDpgNWB5OZvVMD0IyMjHwXlcPM5eeXkNCEXQ8G VL1oM759bN6alDN9Gxh7HgjZtODbdSUULFhxBKTbGpz81n5PMvmNvOrdBWG11preREdyUP 1N4tB99o1B1NRH7RCtWWUCurMlPlaN0= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 33/34] tests/qemu-iotests: Update tests to recent desugarized -accel option Date: Mon, 6 Jan 2020 15:42:05 +0100 Message-Id: <20200106144206.698920-34-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: gGjyLUidPF2vshOLloWtUA-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Commit 6f6e1698a6 desugarized "-machine accel=3D" to a list of "-accel" options. Since now "-machine accel" and "-accel" became incompatible, update the iotests to the new format. Error reported here: https://gitlab.com/qemu-project/qemu/-/jobs/385801004#L3400 Reported-by: GitLab CI Fixes: 6f6e1698a6 (vl: configure accelerators from -accel options) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20200106130951.29873-1-philmd@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/235 | 2 +- tests/qemu-iotests/check | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/235 b/tests/qemu-iotests/235 index fedd111fd4..3d7533980d 100755 --- a/tests/qemu-iotests/235 +++ b/tests/qemu-iotests/235 @@ -49,7 +49,7 @@ qemu_img_create('-f', iotests.imgfmt, '-o', 'preallocatio= n=3Dmetadata', disk, str(size)) =20 vm =3D QEMUMachine(iotests.qemu_prog) -vm.add_args('-machine', 'accel=3Dkvm:tcg') +vm.add_args('-accel', 'kvm', '-accel', 'tcg') if iotests.qemu_default_machine =3D=3D 's390-ccw-virtio': vm.add_args('-no-shutdown') vm.add_args('-drive', 'id=3Dsrc,file=3D' + disk) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 90970b0549..2890785a10 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -587,13 +587,13 @@ export QEMU_PROG=3D"$(type -p "$QEMU_PROG")" =20 case "$QEMU_PROG" in *qemu-system-arm|*qemu-system-aarch64) - export QEMU_OPTIONS=3D"-nodefaults -display none -machine virt,acc= el=3Dqtest" + export QEMU_OPTIONS=3D"-nodefaults -display none -machine virt -ac= cel qtest" ;; *qemu-system-tricore) - export QEMU_OPTIONS=3D"-nodefaults -display none -machine tricore_= testboard,accel=3Dqtest" + export QEMU_OPTIONS=3D"-nodefaults -display none -machine tricore_= testboard -accel qtest" ;; *) - export QEMU_OPTIONS=3D"-nodefaults -display none -machine accel=3D= qtest" + export QEMU_OPTIONS=3D"-nodefaults -display none -accel qtest" ;; esac =20 --=20 2.24.1 From nobody Mon May 6 03:49:15 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=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578323853; cv=none; d=zohomail.com; s=zohoarc; b=VFYwQ/nAoWX1+ng1YIz32dn820ztV7dghgiq0akC6cN11OkjbF47xJgS3fYmjuOoujzvCcswRkgPIQFz5E+1uccUpFQvftkoY2RR2AohkccXeleYPr+l9O6SZY/7kZqpnDPrSELmvgjotMEabJDx4QWuSHctVkAaMy4rZaOzkAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578323853; 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=+G2RUZx0lySONatlvCEdCYt5JyxyNEJIdc3ZLiAijyY=; b=KbFR2m1pOlwjBqO/jMUBm5EAIjd9oXdQ9HZ8z9j0cioVbfc2Px8SLDPu4/bLmycFd5rqY2hPemDTWNFvR0+NF5cAoX2DsQVtRlOgZTU7s0QDvZ0ElYBG4RGXQvW48QlvIwFBP9lel9Lpsx1z/2h3H/y/RBU1ezK+cgpcXN8o9Bk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15783238539861005.0057230491071; Mon, 6 Jan 2020 07:17:33 -0800 (PST) Received: from localhost ([::1]:53328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioU8K-0007jr-2t for importer@patchew.org; Mon, 06 Jan 2020 10:17:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbw-0007nw-8N for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:44:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbv-00016U-37 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:44:04 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42534 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 1ioTbu-000166-W4 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:44: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-371-WCXvJLr8PZiNYHUZAkYJYg-1; Mon, 06 Jan 2020 09:43:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 150FB8024DE; Mon, 6 Jan 2020 14:43:55 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 872435D9D6; Mon, 6 Jan 2020 14:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321842; 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=+G2RUZx0lySONatlvCEdCYt5JyxyNEJIdc3ZLiAijyY=; b=PopviVM4vwMaqbRfvtgFlZO6kcAsULw74TgCWpFRPn9NTg5s5tnKHwj+VHBuTUc/noeU9J lt9AMpJMCMyYuZUv4jEO91xctHQEfJq40V6a0SjqcKPnDPEdwL+C9GKeGnOsdgKEvB5FPd kJtcRXBXw74SFHohZxt+Zz38+NkZDJk= From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 34/34] backup-top: Begin drain earlier Date: Mon, 6 Jan 2020 15:42:06 +0100 Message-Id: <20200106144206.698920-35-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: WCXvJLr8PZiNYHUZAkYJYg-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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When dropping backup-top, we need to drain the node before freeing the BlockCopyState. Otherwise, requests may still be in flight and then the assertion in shres_destroy() will fail. (This becomes visible in intermittent failure of 056.) Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Message-id: 20191219182638.104621-1-mreitz@redhat.com Signed-off-by: Max Reitz --- block/backup-top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/backup-top.c b/block/backup-top.c index 7cdb1f8eba..818d3f26b4 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -257,12 +257,12 @@ void bdrv_backup_top_drop(BlockDriverState *bs) BDRVBackupTopState *s =3D bs->opaque; AioContext *aio_context =3D bdrv_get_aio_context(bs); =20 - block_copy_state_free(s->bcs); - aio_context_acquire(aio_context); =20 bdrv_drained_begin(bs); =20 + block_copy_state_free(s->bcs); + s->active =3D false; bdrv_child_refresh_perms(bs, bs->backing, &error_abort); bdrv_replace_node(bs, backing_bs(bs), &error_abort); --=20 2.24.1