From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acxR4-0000Xs-MH for qemu-devel@nongnu.org; Mon, 07 Mar 2016 10:51:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acxR0-0006QC-Fe for qemu-devel@nongnu.org; Mon, 07 Mar 2016 10:51:06 -0500 References: <1457358136-22346-1-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <56DDA35F.2030308@redhat.com> Date: Mon, 7 Mar 2016 08:50:55 -0700 MIME-Version: 1.0 In-Reply-To: <1457358136-22346-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2sGHRBRhJafB3Wvo5i637wdemoP7grKPW" Subject: Re: [Qemu-devel] [PATCH] block: Fix cache mode defaults in bds_tree_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2sGHRBRhJafB3Wvo5i637wdemoP7grKPW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/07/2016 06:42 AM, Kevin Wolf wrote: > Without setting explicit defaults in the options, blockdev-add without > an ID ended up defaulting to writethrough. It should be writeback as > documented. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 Reviewed-by: Eric Blake > diff --git a/blockdev.c b/blockdev.c > index eecd78d..1824cae 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -675,6 +675,13 @@ static BlockDriverState *bds_tree_init(QDict *bs_o= pts, Error **errp) > goto fail; > } > =20 > + /* bdrv_open() defaults to the values in bdrv_flags (for compatibi= lity > + * with other callers) rather than what we want as the real defaul= ts. > + * Apply the defaults here instead. */ > + qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_WB, "on"); > + qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_DIRECT, "off"); > + qdict_set_default_str(bs_opts, BDRV_OPT_CACHE_NO_FLUSH, "off"); > + > if (runstate_check(RUN_STATE_INMIGRATE)) { > bdrv_flags |=3D BDRV_O_INACTIVE; > } >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2sGHRBRhJafB3Wvo5i637wdemoP7grKPW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW3aNfAAoJEKeha0olJ0NqjOkIAKXw4VaEM5pV6PNZLNDZT684 RsYt1T5Wd8Lq+Gbv9IQnjS8mypropHCVdcqexrjt4wxmHoGPi5M1E2sIkX1tDPNB dqZhvIjIhslP+vmw49JBGnjWLRKwKROVyyRoIGjHOA8/hR5slUd/Ttjcasx6VLJY jILS97zGhXbI7RnLGhG38itTYQ4BkR1dPARJTTLfBXbvqIgFIRP5UqqmUUPszZo+ Vp9owLMHmDGoPhlnAtHdcw9a34+pbzBfxoFAzv1j8TMKh3jSa9IxFC9XA+YUU2bw N8fED+Yab4rRQxDxAafSFTu9WW7AW4CFRSMj1QUjfLLfh9mDpyHXgr4VanPFKtw= =a5gE -----END PGP SIGNATURE----- --2sGHRBRhJafB3Wvo5i637wdemoP7grKPW--