From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtLXX-0005M4-IB for qemu-devel@nongnu.org; Fri, 15 May 2015 15:45:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtLXW-0002Pp-K7 for qemu-devel@nongnu.org; Fri, 15 May 2015 15:44:59 -0400 Message-ID: <55564CB6.1020602@redhat.com> Date: Fri, 15 May 2015 13:44:54 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431105726-3682-1-git-send-email-kwolf@redhat.com> <1431105726-3682-32-git-send-email-kwolf@redhat.com> <55563E3C.8040201@redhat.com> In-Reply-To: <55563E3C.8040201@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IQKGpXoXGbOTqdmtHIofJFItOkKcm60jQ" Subject: Re: [Qemu-devel] [PATCH 31/34] block: Move cache options into options QDict List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Kevin Wolf , qemu-block@nongnu.org Cc: armbru@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IQKGpXoXGbOTqdmtHIofJFItOkKcm60jQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/15/2015 12:43 PM, Max Reitz wrote: > On 08.05.2015 19:22, Kevin Wolf wrote: >> This adds the cache mode options to the QDict, so that they can be >> specified for child nodes (e.g. backing.cache.direct=3Doff). >> >> The cache modes are not removed from the flags at this point; instead,= >> options and flags are kept in sync. If the user specifies both flags a= nd >> options, the options take precedence. >> >> Child node inherit cache modes as options now, they don't use flags an= y >> more. >> >> Signed-off-by: Kevin Wolf >> + >> +static void update_options_from_flags(QDict *options, int flags) >> +{ >> + if (!qdict_haskey(options, BDRV_OPT_CACHE_WB)) { >> + qdict_put(options, BDRV_OPT_CACHE_WB, >> + qbool_from_int(flags & BDRV_O_CACHE_WB)); >=20 > Urgh, qbool_from_int() doesn't cast the int to bool? :-/ No, it's a horrible interface at the moment. But it's on my to-do plate to see how hard it would be to modernize a bit, since I've already been touching in that area (the recent addition of qnull copied heavily from qbool). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IQKGpXoXGbOTqdmtHIofJFItOkKcm60jQ 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/ iQEcBAEBCAAGBQJVVky2AAoJEKeha0olJ0NqclgH/1r3Be9GVaqOXT/EyiTz0+dB aNeeJHvY86DP8RN/L4+1/j5WidzH2qI8/38Yh82pbMK1QELEEtiwuiFtuz/qghSL G2BzdHr+GxBAjxCmYJKcNIGNK9143kK1Lh/DD5g5b3RPsIgIU3J2KNBR8ID47fMQ uEFW6hOoLp47dyqG1SPbK3rqf5gWdqPbJDDqrZ/oi4a6M1zSK7gF0+0H0eeCKGdl HtDk3tdcmQF/A48zZU+CaMEorRLHc8U1iw5iy3PPqCa2+VGpBZGhzAHxAH9nkKNV PS3+xttxGxz9LEQJnYCDcN2jUvZWnTxvQgX38kqCbHqjPjqHfMBkbtVrlquRbCY= =cnX6 -----END PGP SIGNATURE----- --IQKGpXoXGbOTqdmtHIofJFItOkKcm60jQ--