qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 31/34] block: Move cache options into options QD


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 31/34] block: Move cache options into options QDict
Date: Fri, 15 May 2015 13:44:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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 <address@hidden>

>> +
>> +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

[Prev in Thread] Current Thread [Next in Thread]