From nobody Wed Dec 17 21:46:24 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498235380447669.8010744566644; Fri, 23 Jun 2017 09:29:40 -0700 (PDT) Received: from localhost ([::1]:36254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dORSk-00084W-PE for importer@patchew.org; Fri, 23 Jun 2017 12:29:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dORLh-0000eu-5z for qemu-devel@nongnu.org; Fri, 23 Jun 2017 12:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dORLf-0007Vr-M7 for qemu-devel@nongnu.org; Fri, 23 Jun 2017 12:22:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35078) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dORLb-0007Ti-Mm; Fri, 23 Jun 2017 12:22:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 858721E2EF; Fri, 23 Jun 2017 16:22:14 +0000 (UTC) Received: from noname.redhat.com (ovpn-117-196.ams2.redhat.com [10.36.117.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 851AA7E8E5; Fri, 23 Jun 2017 16:22:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 858721E2EF Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 858721E2EF From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 23 Jun 2017 18:21:07 +0200 Message-Id: <1498234919-27316-10-git-send-email-kwolf@redhat.com> In-Reply-To: <1498234919-27316-1-git-send-email-kwolf@redhat.com> References: <1498234919-27316-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Jun 2017 16:22:14 +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] [PULL 09/61] doc: Document driver-specific -blockdev options 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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This documents the driver-specific options for the raw, qcow2 and file block drivers for the man page. For everything else, we refer to the QAPI documentation. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- qemu-options.hx | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index db20866..896ff17 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -614,7 +614,18 @@ STEXI @item -blockdev @var{option}[,@var{option}[,@var{option}[,...]]] @findex -blockdev =20 -Define a new block driver node. +Define a new block driver node. Some of the options apply to all block dri= vers, +other options are only accepted for a specific block driver. See below for= a +list of generic options and options for the most common block drivers. + +Options that expect a reference to another node (e.g. @code{file}) can be +given in two ways. Either you specify the node name of an already existing= node +(file=3D@var{node-name}), or you define a new node inline, adding options +for the referenced node after a dot (file.filename=3D@var{path},file.aio= =3Dnative). + +A block driver node created with @option{-blockdev} can be used for a guest +device by specifying its node name for the @code{drive} property in a +@option{-device} argument that defines a block device. =20 @table @option @item Valid options for any block driver node: @@ -654,6 +665,108 @@ zero write commands. You may even choose "unmap" if @= var{discard} is set to "unmap" to allow a zero write to be converted to an @code{unmap} operat= ion. @end table =20 +@item Driver-specific options for @code{file} + +This is the protocol-level block driver for accessing regular files. + +@table @code +@item filename +The path to the image file in the local filesystem +@item aio +Specifies the AIO backend (threads/native, default: threads) +@end table +Example: +@example +-blockdev driver=3Dfile,node-name=3Ddisk,filename=3Ddisk.img +@end example + +@item Driver-specific options for @code{raw} + +This is the image format block driver for raw images. It is usually +stacked on top of a protocol level block driver such as @code{file}. + +@table @code +@item file +Reference to or definition of the data source block driver node +(e.g. a @code{file} driver node) +@end table +Example 1: +@example +-blockdev driver=3Dfile,node-name=3Ddisk_file,filename=3Ddisk.img +-blockdev driver=3Draw,node-name=3Ddisk,file=3Ddisk_file +@end example +Example 2: +@example +-blockdev driver=3Draw,node-name=3Ddisk,file.driver=3Dfile,file.filename= =3Ddisk.img +@end example + +@item Driver-specific options for @code{qcow2} + +This is the image format block driver for qcow2 images. It is usually +stacked on top of a protocol level block driver such as @code{file}. + +@table @code +@item file +Reference to or definition of the data source block driver node +(e.g. a @code{file} driver node) + +@item backing +Reference to or definition of the backing file block device (default is ta= ken +from the image file). It is allowed to pass an empty string here in order = to +disable the default backing file. + +@item lazy-refcounts +Whether to enable the lazy refcounts feature (on/off; default is taken fro= m the +image file) + +@item cache-size +The maximum total size of the L2 table and refcount block caches in bytes +(default: 1048576 bytes or 8 clusters, whichever is larger) + +@item l2-cache-size +The maximum size of the L2 table cache in bytes +(default: 4/5 of the total cache size) + +@item refcount-cache-size +The maximum size of the refcount block cache in bytes +(default: 1/5 of the total cache size) + +@item cache-clean-interval +Clean unused entries in the L2 and refcount caches. The interval is in sec= onds. +The default value is 0 and it disables this feature. + +@item pass-discard-request +Whether discard requests to the qcow2 device should be forwarded to the da= ta +source (on/off; default: on if discard=3Dunmap is specified, off otherwise) + +@item pass-discard-snapshot +Whether discard requests for the data source should be issued when a snaps= hot +operation (e.g. deleting a snapshot) frees clusters in the qcow2 file (on/= off; +default: on) + +@item pass-discard-other +Whether discard requests for the data source should be issued on other +occasions where a cluster gets freed (on/off; default: off) + +@item overlap-check +Which overlap checks to perform for writes to the image +(none/constant/cached/all; default: cached). For details or finer +granularity control refer to the QAPI documentation of @code{blockdev-add}. +@end table + +Example 1: +@example +-blockdev driver=3Dfile,node-name=3Dmy_file,filename=3D/tmp/disk.qcow2 +-blockdev driver=3Dqcow2,node-name=3Dhda,file=3Dmy_file,overlap-check=3Dno= ne,cache-size=3D16777216 +@end example +Example 2: +@example +-blockdev driver=3Dqcow2,node-name=3Ddisk,file.driver=3Dhttp,file.filename= =3Dhttp://example.com/image.qcow2 +@end example + +@item Driver-specific options for other drivers +Please refer to the QAPI documentation of the @code{blockdev-add} QMP comm= and. + @end table =20 ETEXI --=20 1.8.3.1