From nobody Wed May 7 01:28:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=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=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> 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 <qemu-devel-bounces+importer=patchew.org@nongnu.org>) 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 <mreitz@redhat.com>) 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 <mreitz@redhat.com>) 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 <mreitz@redhat.com>) 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 <mreitz@redhat.com> 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Kevin Wolf <kwolf@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> 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 <mreitz@redhat.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Message-id: 20191107163708.833192-9-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com> --- 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