From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xj4ml-0003fj-Np for qemu-devel@nongnu.org; Tue, 28 Oct 2014 07:18:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xj4mf-0003hD-IC for qemu-devel@nongnu.org; Tue, 28 Oct 2014 07:17:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xj4mf-0003h6-Br for qemu-devel@nongnu.org; Tue, 28 Oct 2014 07:17:53 -0400 Date: Tue, 28 Oct 2014 11:11:48 +0000 From: Stefan Hajnoczi Message-ID: <20141028111148.GF19211@stefanha-thinkpad.redhat.com> References: <1414256153-10148-1-git-send-email-pl@kamp.de> <1414256153-10148-4-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2FkSFaIQeDFoAt0B" Content-Disposition: inline In-Reply-To: <1414256153-10148-4-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [PATCHv3 3/6] block: add a knob to disable multiwrite_merge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net, armbru@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com --2FkSFaIQeDFoAt0B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 25, 2014 at 06:55:50PM +0200, Peter Lieven wrote: > diff --git a/block.c b/block.c > index f05ea0c..f3da5dd 100644 > --- a/block.c > +++ b/block.c > @@ -884,6 +884,10 @@ static QemuOptsList bdrv_runtime_opts =3D { > .name =3D "node-name", > .type =3D QEMU_OPT_STRING, > .help =3D "Node name of the block device node", > + },{ > + .name =3D "write-merging", > + .type =3D QEMU_OPT_BOOL, > + .help =3D "enable write merging (default: true)", QEMU_OPT_BOOL takes "on"/"off" instead of "true"/"false": s/true/on/ > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 2095f9e..74d1960 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -214,6 +214,8 @@ > # > # @detect_zeroes: detect and optimize zero writes (Since 2.1) > # > +# @write_merging: true if write merging is enabled (Since 2.2) > +# > # @bps: total throughput limit in bytes per second is specified > # > # @bps_rd: read throughput limit in bytes per second is specified > @@ -250,6 +252,7 @@ > '*backing_file': 'str', 'backing_file_depth': 'int', > 'encrypted': 'bool', 'encryption_key_missing': 'bool', > 'detect_zeroes': 'BlockdevDetectZeroesOptions', > + 'write_merging': 'bool', > 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', > 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', > 'image': 'ImageInfo', > @@ -1185,6 +1188,10 @@ > # (default: false) > # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1) > # (default: off) > +# @write-merging: #optional enable the merging of write requests > +# also known as multiwrite_merge (Since 2.2) > +# (default: true, but this might change in the future > +# depending on format/protocol/features used) > # > # Since: 1.7 > ## > @@ -1198,7 +1205,8 @@ > '*rerror': 'BlockdevOnError', > '*werror': 'BlockdevOnError', > '*read-only': 'bool', > - '*detect-zeroes': 'BlockdevDetectZeroesOptions' } } > + '*detect-zeroes': 'BlockdevDetectZeroesOptions', > + '*write-merging': 'bool' } } > =20 > ## > # @BlockdevOptionsFile > diff --git a/qemu-options.hx b/qemu-options.hx > index 22cf3b9..d2f756f 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -432,6 +432,7 @@ DEF("drive", HAS_ARG, QEMU_OPTION_drive, > " [,werror=3Dignore|stop|report|enospc][,id=3Dname][,aio=3Dthr= eads|native]\n" > " [,readonly=3Don|off][,copy-on-read=3Don|off]\n" > " [,discard=3Dignore|unmap][,detect-zeroes=3Don|off|unmap]\n" > + " [,write-merging=3Don|off]\n" > " [[,bps=3Db]|[[,bps_rd=3Dr][,bps_wr=3Dw]]]\n" > " [[,iops=3Di]|[[,iops_rd=3Dr][,iops_wr=3Dw]]]\n" > " [[,bps_max=3Dbm]|[[,bps_rd_max=3Drm][,bps_wr_max=3Dwm]]]\n" > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 1abd619..2c20207 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -2104,6 +2104,7 @@ Each json-object contain the following: > - "iops_size": I/O size when limiting by iops (json-int) > - "detect_zeroes": detect and optimize zero writing (json-strin= g) > - Possible values: "off", "on", "unmap" > + - "write_merging": enable merging of write requests (json-bool) > - "image": the detail of the image, it is a json-object contain= ing > the following: > - "filename": image file name (json-string) > @@ -2181,6 +2182,7 @@ Example: > "iops_wr_max": 0, > "iops_size": 0, > "detect_zeroes": "on", > + "write_merging": "true", > "image":{ > "filename":"disks/test.qcow2", > "format":"qcow2", The big question is whether these user-visible interfaces make sense if write merging will be moved from block.c into virtio-blk.c in the future. Once an interface has been added it cannot be removed. I think write merging in block.c is fine since other emulated storage controllers like virtio-scsi might also choose to use it. But I want to raise the point for discussion in case others have strong feelings. Stefan --2FkSFaIQeDFoAt0B Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUT3n0AAoJEJykq7OBq3PIpTwIAJgVAw97Snm4pfqpJt3e4n7B KfLETYT3yXHfRAMAAsA/oDHkOaymkhNn1Jyoxz7gfTuNJzZbE7bowQsjeQvCM2E5 +vPEy+f2G4J7mM5u/EGhGRwg7JlReTu8LJRyygmqegS9XM8Y9Km2SXEWbRzdBWaJ nC1c16VHxFWUQ7ByyaFo0BIhr+P865jgEDRLxNDA/yTaOkaVI6gRO6PAl8XZT3BD FFu1BgCgE61J51RPRtahW0A6+WkVWofYoZ6UBBQp6db/yRU5QHtzW5bEjXuc+gwa sXJy1XsHPFosF3qvf1Wmqb6Jg1CENW0shayiU7a0oMiU4u1oLVbe+iaqeBkdMVA= =MK4T -----END PGP SIGNATURE----- --2FkSFaIQeDFoAt0B--