From nobody Mon Feb 9 23:14:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594068022; cv=none; d=zohomail.com; s=zohoarc; b=FixqDNKbwIz1swd9W1CIZPcY8H3NRtWZEmzJ/sqjL0fTushCia4FYLJf6z7XarlVvXX9AUbHze2OCOd0bdtWAu3kvTQIq65cdy/O7yaW7YG+wE2aeIb4v4hANP0Jzrxhu0EbnW8eaEWZKGJyRPECeAAfFXIUM8XtCfFv/Us447Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594068022; 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=FMd2/ba9VVPZz6QMl3NG1Nf/5kpoc5P1u2WSfB4bIyw=; b=fb7qQga0QXxhuKiLrBkDjh6j1cjqC10W4w7glBAcwGCy9dKpsE2qsnGWq1tLT63nRO0pO/FGkRifuVB+55jWu/ek6n5zaVIBA35jMxDBdI8xaHYOa3YFj2kVJZ4vin0hy1iJatdk9bFdDZumefD7lPYFWajIrp6a3/Om3aSpXfs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594068022398216.32934922486368; Mon, 6 Jul 2020 13:40:22 -0700 (PDT) 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-99-U1unFqagM3uWbmi6yd2URg-1; Mon, 06 Jul 2020 16:40:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8D441404; Mon, 6 Jul 2020 20:40:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C84495C298; Mon, 6 Jul 2020 20:40:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 991A272F4D; Mon, 6 Jul 2020 20:40:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 066Ke9HW005149 for ; Mon, 6 Jul 2020 16:40:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 43F6C7B41F; Mon, 6 Jul 2020 20:40:09 +0000 (UTC) Received: from blue.redhat.com (ovpn-113-97.phx2.redhat.com [10.3.113.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E2227B400; Mon, 6 Jul 2020 20:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594068021; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FMd2/ba9VVPZz6QMl3NG1Nf/5kpoc5P1u2WSfB4bIyw=; b=IoaeCnmiaNkURAGiSM+ybdsZxIVIMdv2ptjWT5BLpH2FvjkMPUAKKP5pgkf9lO1YponOe1 L0tQqLfaDwyRLD5LzvjUe85tAcyqjmhT2YewNSWKUpb20uqrSiDNtJD6oTRC6DaKe4vDN6 /WOZKCapAteTi+bLlaB69BLgnyiyoFE= X-MC-Unique: U1unFqagM3uWbmi6yd2URg-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PATCH v6 02/10] block: Finish deprecation of 'qemu-img convert -n -o' Date: Mon, 6 Jul 2020 15:39:46 -0500 Message-Id: <20200706203954.341758-3-eblake@redhat.com> In-Reply-To: <20200706203954.341758-1-eblake@redhat.com> References: <20200706203954.341758-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, pkrempa@redhat.com, qemu-block@nongnu.org, libvir-list@redhat.com, mreitz@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" It's been two releases since we started warning; time to make the combination an error as promised. There was no iotest coverage, so add some. While touching the documentation, tweak another section heading for consistent style. Signed-off-by: Eric Blake --- docs/system/deprecated.rst | 18 ++++++++---------- qemu-img.c | 4 ++-- tests/qemu-iotests/122 | 7 +++++++ tests/qemu-iotests/122.out | 4 ++++ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 47f84be8e09f..73b9d9f37848 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -418,14 +418,6 @@ kernel in 2018, and has also been dropped from glibc. Related binaries ---------------- -``qemu-img convert -n -o`` (since 4.2.0) -'''''''''''''''''''''''''''''''''''''''' - -All options specified in ``-o`` are image creation options, so -they have no effect when used with ``-n`` to skip image creation. -Silently ignored options can be confusing, so this combination of -options will be made an error in future versions. - Backwards compatibility ----------------------- @@ -531,8 +523,8 @@ spec you can use the ``-cpu rv64gcsu,priv_spec=3Dv1.10.= 0`` command line argument. Related binaries ---------------- -``qemu-nbd --partition`` (removed in 5.0.0) -''''''''''''''''''''''''''''''''''''''''''' +``qemu-nbd --partition`` (removed in 5.0) +''''''''''''''''''''''''''''''''''''''''' The ``qemu-nbd --partition $digit`` code (also spelled ``-P``) could only handle MBR partitions, and never correctly handled logical @@ -548,6 +540,12 @@ can be rewritten as:: qemu-nbd -t --image-opts driver=3Draw,offset=3D1M,size=3D100M,file.drive= r=3Dqcow2,file.file.driver=3Dfile,file.file.filename=3Dfile.qcow2 +``qemu-img convert -n -o`` (removed in 5.1) +''''''''''''''''''''''''''''''''''''''''''' + +All options specified in ``-o`` are image creation options, so +they are now rejected when used with ``-n`` to skip image creation. + Command line options -------------------- diff --git a/qemu-img.c b/qemu-img.c index bdb9f6aa46a3..9efe1f13482b 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2369,8 +2369,8 @@ static int img_convert(int argc, char **argv) } if (skip_create && options) { - warn_report("-o has no effect when skipping image creation"); - warn_report("This will become an error in future QEMU versions."); + error_report("-o has no effect when skipping image creation"); + goto fail_getopt; } if (s.has_zero_init && !skip_create) { diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index f7a3ae684a7c..2dc16b2ca484 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qemu-iotests/122 @@ -290,6 +290,13 @@ TEST_IMG=3D"$TEST_IMG".orig _make_test_img 64M # backing file" $QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -n "$TEST_IMG" "$TEST_IMG= ".orig +echo +echo '=3D=3D=3D -n incompatible with -o =3D=3D=3D' +echo + +$QEMU_IMG convert -O $IMGFMT -o preallocation=3Dmetadata -n \ + "$TEST_IMG" "$TEST_IMG".orig && echo "unexpected success" + # success, all done echo '*** done' rm -f $seq.full diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out index 1a35951a80a8..c2e154a1e556 100644 --- a/tests/qemu-iotests/122.out +++ b/tests/qemu-iotests/122.out @@ -233,4 +233,8 @@ Images are identical. Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D67108864 Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=3DIMGFMT size=3D67108864 + +=3D=3D=3D -n incompatible with -o =3D=3D=3D + +qemu-img: -o has no effect when skipping image creation *** done --=20 2.27.0