Received: from eggs.gnu.org ([2001:4830:134:3::10]:60428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnUKq-0001Nn-Mr for qemu-devel@nongnu.org; Fri, 23 Sep 2016 13:32:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnUKp-0000yT-54 for qemu-devel@nongnu.org; Fri, 23 Sep 2016 13:32:28 -0400 References: <1474646781-18951-1-git-send-email-kwolf@redhat.com> <1474646781-18951-4-git-send-email-kwolf@redhat.com> From: Max Reitz Message-ID: Date: Fri, 23 Sep 2016 19:32:16 +0200 MIME-Version: 1.0 In-Reply-To: <1474646781-18951-4-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tlv7QkhwpMfuRKoLK46qSi9dfRLToqHPE" Subject: Re: [Qemu-devel] [PATCH v2 3/3] doc: Document driver-specific -blockdev options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: eblake@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tlv7QkhwpMfuRKoLK46qSi9dfRLToqHPE From: Max Reitz To: Kevin Wolf , qemu-block@nongnu.org Cc: eblake@redhat.com, qemu-devel@nongnu.org Message-ID: Subject: Re: [PATCH v2 3/3] doc: Document driver-specific -blockdev options References: <1474646781-18951-1-git-send-email-kwolf@redhat.com> <1474646781-18951-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1474646781-18951-4-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 23.09.2016 18:06, Kevin Wolf wrote: > 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. >=20 > Signed-off-by: Kevin Wolf > --- > qemu-options.hx | 104 ++++++++++++++++++++++++++++++++++++++++++++++++= +++++++- > 1 file changed, 103 insertions(+), 1 deletion(-) >=20 > diff --git a/qemu-options.hx b/qemu-options.hx > index 8766589..9811370 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -522,7 +522,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= drivers, > +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= given > +given in two ways. Either you specify the node name of an already exis= ting node s/given given/be given/ > +(file=3D@var{node-name}), or you define a new node inline, adding opti= ons > +for the referenced node after a dot (file.filename=3D@var{path},file.a= io=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: > @@ -558,6 +569,97 @@ zero write commands. You may even choose "unmap" i= f @var{discard} is set > to "unmap" to allow a zero write to be converted to an UNMAP operation= =2E > @end table > =20 > +@item Driver-specific options for @code{file} I'd really like a short explanation of what this driver does here, really just a "This is a protocol-level block driver for reading normal files." because I don't think that is obvious to most users. > +@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} I think a "This is a format(-level) block driver for raw image files." could be useful here, too, although I can imagine that most people can guess that already. But it wouldn't hurt, I think. > +@table @code > +@item file > +Reference to or definition of the data source block driver ndoe s/ndoe/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.filena= me=3Ddisk.img > +@end example > + > +@item Driver-specific options for @code{qcow2} > +@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 (if missin= g, taken I'd use "not specified" or a plain "defaults to..." instead of "missing", because "missing" sounds like it's supposed to be specified. > +from the image file content). It is allowed to pass an empty string he= re 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 > +image file) > + > +@item cache-size > +The maximum total size of the L2 table and refcount block caches in by= tes > +(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= seconds. > +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 th= e data > +source (on/off; default: on if discard=3Dunmap is specified, off other= wise) > + > +@item pass-discard-snapshot > +Whether discard requests for the data source should be issued when a s= napshot > +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/cache/all; default: cached). For details or finer s/cache/cached/ Max > +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=3D= none,cache-size=3D16777216 > +@end example > +Example 2: > +@example > +-blockdev driver=3Dqcow2,node-name=3Ddisk,file.driver=3Dhttp,file.file= name=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 = command. > + > @end table > =20 > ETEXI >=20 --tlv7QkhwpMfuRKoLK46qSi9dfRLToqHPE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJX5WcgEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQH6p B/wI/yv5jrrtRL4eOAkXppuqNLNZw6hyPozerosHDoqB1nfTIT7mJd8HbHUVLwLc xNr+WMd+YHK2BnEKk15IHgSkn6wXctFpZwi8HEU6JJXE3aWX8WUH5LLvMb3fSHLP T4L3RMxoO0h8c9HTC6MNSUzIlL81dWHwKszqOrHhWc5BegDC52KgDFR80MRzOgRV ux3jQ4mosTC0vUybc3o8ZC4J6qsfQyvAZq+gHRbVi0Nzf2o0ZsG9Wf+YGxOumuz0 NeumTr+TSzxgcFJtn+DOlnRKydW8TqUoMLT7ix4HGns3Gmd4iVGiprquBruNrBex G///6K0qtXqIUxDys1k7KnIM =2+Gx -----END PGP SIGNATURE----- --tlv7QkhwpMfuRKoLK46qSi9dfRLToqHPE--