From patchwork Fri Nov 10 22:13:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 10053877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B2E0603FA for ; Fri, 10 Nov 2017 22:15:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EBE62B493 for ; Fri, 10 Nov 2017 22:15:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51E4B2B497; Fri, 10 Nov 2017 22:15:06 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DD682B494 for ; Fri, 10 Nov 2017 22:15:05 +0000 (UTC) Received: from localhost ([::1]:43654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDHZo-0004sG-FY for patchwork-qemu-devel@patchwork.kernel.org; Fri, 10 Nov 2017 17:15:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDHYW-0004mq-81 for qemu-devel@nongnu.org; Fri, 10 Nov 2017 17:13:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDHYV-0005aD-0E for qemu-devel@nongnu.org; Fri, 10 Nov 2017 17:13:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39888) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eDHYS-0005Yv-Nf; Fri, 10 Nov 2017 17:13:40 -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 mx1.redhat.com (Postfix) with ESMTPS id D83368765E; Fri, 10 Nov 2017 22:13:39 +0000 (UTC) Received: from localhost (ovpn-204-126.brq.redhat.com [10.40.204.126]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6896F63620; Fri, 10 Nov 2017 22:13:39 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 10 Nov 2017 23:13:29 +0100 Message-Id: <20171110221329.24176-4-mreitz@redhat.com> In-Reply-To: <20171110221329.24176-1-mreitz@redhat.com> References: <20171110221329.24176-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 10 Nov 2017 22:13:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.12 3/3] block: Deprecate "backing": "" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We have a clear replacement, so let's deprecate it. Signed-off-by: Max Reitz Reviewed-by: Markus Armbruster --- qapi/block-core.json | 4 ++-- block.c | 4 ++++ qemu-doc.texi | 7 +++++++ qemu-options.hx | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 76bf50f813..dfe4d3650c 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1090,7 +1090,7 @@ # @overlay: reference to the existing block device that will become # the overlay of @node, as part of creating the snapshot. # It must not have a current backing file (this can be -# achieved by passing "backing": "" to blockdev-add). +# achieved by passing "backing": null to blockdev-add). # # Since: 2.5 ## @@ -1238,7 +1238,7 @@ # "node-name": "node1534", # "file": { "driver": "file", # "filename": "hd1.qcow2" }, -# "backing": "" } } +# "backing": null } } # # <- { "return": {} } # diff --git a/block.c b/block.c index bc92ddd5a0..463c4de25b 100644 --- a/block.c +++ b/block.c @@ -2559,6 +2559,10 @@ static BlockDriverState *bdrv_open_inherit(const char *filename, /* See cautionary note on accessing @options above */ backing = qdict_get_try_str(options, "backing"); if (qdict_is_qnull(options, "backing") || (backing && *backing == '\0')) { + if (backing) { + warn_report("Use of \"backing\": \"\" is deprecated; " + "use \"backing\": null instead"); + } flags |= BDRV_O_NO_BACKING; qdict_del(options, "backing"); } diff --git a/qemu-doc.texi b/qemu-doc.texi index 8c10956a66..8f57d9ad21 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2537,6 +2537,13 @@ or ``ivshmem-doorbell`` device types. The ``spapr-pci-vfio-host-bridge'' device type is replaced by the ``spapr-pci-host-bridge'' device type. +@section Block device options + +@subsection "backing": "" (since 2.12.0) + +In order to prevent QEMU from automatically opening an image's backing +chain, use ``"backing": null'' instead. + @node License @appendix License diff --git a/qemu-options.hx b/qemu-options.hx index 3728e9b4dd..0ee1a04d00 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -731,8 +731,8 @@ Reference to or definition of the data source block driver node @item backing Reference to or definition of the backing file block device (default is taken -from the image file). It is allowed to pass an empty string here in order to -disable the default backing file. +from the image file). It is allowed to pass @code{null} here in order to disable +the default backing file. @item lazy-refcounts Whether to enable the lazy refcounts feature (on/off; default is taken from the