From patchwork Wed May 17 09:10:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 682917 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp252070wrt; Wed, 17 May 2023 02:15:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lpH+kfoxyGob57vvWNC8qpzaqNKRxeNSnP6n7PHoEDuH1ipC3/yVFJxeij4Oq1j0tfhiq X-Received: by 2002:ac8:4e87:0:b0:3f5:4900:eb6b with SMTP id 7-20020ac84e87000000b003f54900eb6bmr6411979qtp.28.1684314926423; Wed, 17 May 2023 02:15:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684314926; cv=none; d=google.com; s=arc-20160816; b=R/87ynFyvoPc54B5iQH/hRl9UP/4OtPDS2tbFNNbMYZnRsRnHRNuwhLFYSbBRa7QuG nYoqUKz50iicOYQY0DTYJ6fXUzuViq2wNOFWQ7eQbqo6K0zbUW3hDBH/xZ8GowcD0Anh Q6jsMHWzRn2F5EJgvB+fQAmKG4Ofa7NiQkwumtm0tg2AfHYFX5BQD7ZOgAkAUfuYKsW/ DQuAMorOhkTpI6La6/Y5f6LpsISL7bV+7NUSiijoRnXc0NBqm+UFxm696CD4UTYIaZyp BvXYM+NeBc42T9E9qD3VQHrXT6nJxyQagi1U3L2H18t+W2cvfvqAyws4wbHbGRteq/Qd qowA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=BhKQ/20WhmzvRFfzsDLoBiy2V0MtLmpu/3nEsCNZ4F0=; b=OJkrE4sue/6rb3UO9moA3zCXwhdyeQRXdSzQshcz3HYOYF63gVDP1ytM0DS5Miedp4 MqNc+5wEVBjCdeRCkr7kHjMSBpFyO0zj4wmxBeY81rk4/Xqtx/7ZeTcN8cuuX2G1w8lb EwTKKSunlgA4k+ncjuIidTCB6a1fX5WCWq7Hw495bDtT6Qq3CclJTBq0POPrvIvPgF9m TMgLIe/GkYzgRmQn1QDkHvAW9MB7AgBtLUjiKgrBwMFDvneV8gklhV3is/u1kg/srOSh 6sHBXS0FmP/0RavUnljy4lf6G8AiPuOFF2onfQ53QWR2wMAQgjAC7IMi6hY0fwReizuf MzQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c13-20020a05622a058d00b003f20e4f49cfsi12518350qtb.621.2023.05.17.02.15.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 May 2023 02:15:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzDBL-00006R-8K; Wed, 17 May 2023 05:10:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzDBI-0008U4-Rw; Wed, 17 May 2023 05:10:48 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzDBF-0006La-Ou; Wed, 17 May 2023 05:10:48 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 98CE2682A; Wed, 17 May 2023 12:10:43 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 034005EF6; Wed, 17 May 2023 12:10:43 +0300 (MSK) Received: (nullmailer pid 3626678 invoked by uid 1000); Wed, 17 May 2023 09:10:42 -0000 From: Michael Tokarev To: qemu-stable@nongnu.org Cc: qemu-devel@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , Markus Armbruster , Kevin Wolf Subject: [PATCH v7.2.3 04/30] qemu-options: finesse the recommendations around -blockdev Date: Wed, 17 May 2023 12:10:16 +0300 Message-Id: <20230517091042.3626593-4-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Alex Bennée We are a bit premature in recommending -blockdev/-device as the best way to configure block devices. It seems there are times the more human friendly -drive still makes sense especially when -snapshot is involved. Improve the language to hopefully make things clearer. Suggested-by: Michael Tokarev Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Cc: Markus Armbruster Cc: Kevin Wolf (cherry picked from commit c1654c3e37c31fb638597efedcd07d071837b78b) Signed-off-by: Michael Tokarev --- qemu-options.hx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 7f99d15b23..e52289479b 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1140,10 +1140,22 @@ have gone through several iterations as the feature set and complexity of the block layer have grown. Many online guides to QEMU often reference older and deprecated options, which can lead to confusion. -The recommended modern way to describe disks is to use a combination of +The most explicit way to describe disks is to use a combination of ``-device`` to specify the hardware device and ``-blockdev`` to describe the backend. The device defines what the guest sees and the -backend describes how QEMU handles the data. +backend describes how QEMU handles the data. It is the only guaranteed +stable interface for describing block devices and as such is +recommended for management tools and scripting. + +The ``-drive`` option combines the device and backend into a single +command line option which is a more human friendly. There is however no +interface stability guarantee although some older board models still +need updating to work with the modern blockdev forms. + +Older options like ``-hda`` are essentially macros which expand into +``-drive`` options for various drive interfaces. The original forms +bake in a lot of assumptions from the days when QEMU was emulating a +legacy PC, they are not recommended for modern configurations. ERST @@ -1636,6 +1648,14 @@ SRST the raw disk image you use is not written back. You can however force the write back by pressing C-a s (see the :ref:`disk images` chapter in the System Emulation Users Guide). + + .. warning:: + snapshot is incompatible with ``-blockdev`` (instead use qemu-img + to manually create snapshot images to attach to your blockdev). + If you have mixed ``-blockdev`` and ``-drive`` declarations you + can use the 'snapshot' property on your drive declarations + instead of this global option. + ERST DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,