From patchwork Fri Jul 5 15:28:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 11032923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23C6E138D for ; Fri, 5 Jul 2019 15:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D2B2834A for ; Fri, 5 Jul 2019 15:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 060A5283CA; Fri, 5 Jul 2019 15:29:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A61512834A for ; Fri, 5 Jul 2019 15:29:40 +0000 (UTC) Received: from localhost ([::1]:54176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjQ9b-0004RB-IW for patchwork-qemu-devel@patchwork.kernel.org; Fri, 05 Jul 2019 11:29:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33340) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjQ8Z-0003qr-P1 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 11:28:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjQ8V-0001Nz-RP for qemu-devel@nongnu.org; Fri, 05 Jul 2019 11:28:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27524) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hjQ8O-0000EP-FM; Fri, 05 Jul 2019 11:28:24 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id B1125330265; Fri, 5 Jul 2019 15:28:18 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-152.phx2.redhat.com [10.3.116.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B21A80A33; Fri, 5 Jul 2019 15:28:18 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 10:28:12 -0500 Message-Id: <20190705152812.26438-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 Jul 2019 15:28:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.1] qcow2: Allow -o compat=v3 during qemu-img amend 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 , "open list:qcow2" , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit b76b4f60 allowed '-o compat=v3' as an alias for the less-appealing '-o compat=1.1' for 'qemu-img create' since we want to use the QMP form as much as possible, but forgot to do likewise for qemu-img amend. Also, it doesn't help that '-o help' doesn't list our new preferred spellings. Signed-off-by: Eric Blake --- I'm arguing that the lack of consistency is a bug, even though the bug has been present since 2.12. block/qcow2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 2a59eb27febb..039bdc2f7e79 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -4823,9 +4823,9 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts, compat = qemu_opt_get(opts, BLOCK_OPT_COMPAT_LEVEL); if (!compat) { /* preserve default */ - } else if (!strcmp(compat, "0.10")) { + } else if (!strcmp(compat, "0.10") || !strcmp(compat, "v2")) { new_version = 2; - } else if (!strcmp(compat, "1.1")) { + } else if (!strcmp(compat, "1.1") || !strcmp(compat, "v3")) { new_version = 3; } else { error_setg(errp, "Unknown compatibility level %s", compat); @@ -5098,7 +5098,7 @@ static QemuOptsList qcow2_create_opts = { { .name = BLOCK_OPT_COMPAT_LEVEL, .type = QEMU_OPT_STRING, - .help = "Compatibility level (0.10 or 1.1)" + .help = "Compatibility level (v2 [0.10] or v3 [1.1])" }, { .name = BLOCK_OPT_BACKING_FILE,