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=off).
>>
>> 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 and
>> options, the options take precedence.
>>
>> Child node inherit cache modes as options now, they don't use flags any
>> more.
>>
>> Signed-off-by: Kevin Wolf <kw...@redhat.com>

>> +
>> +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));
> 
> 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).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to