[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
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 27/34] block: Add infrastructure for option inheritance, (continued)
- [Qemu-devel] [PATCH 28/34] block: Introduce bs->explicit_options, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 29/34] qemu-iotests: Remove cache mode test without medium, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 30/34] block: reopen: Extract QemuOpts for generic block layer options, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 31/34] block: Move cache options into options QDict, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 32/34] qemu-iotests: Try setting cache mode for children, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 34/34] qemu-iotests: Test reopen with node-name/driver options, Kevin Wolf, 2015/05/08
- [Qemu-devel] [PATCH 33/34] qemu-iotests: Test cache mode option inheritance, Kevin Wolf, 2015/05/08