qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in block


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add
Date: Mon, 14 Sep 2015 21:46:44 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 09/14/2015 08:27 PM, Wen Congyang wrote:
>> Building fails:
>>   GEN   qmp-commands.h
>> In file included from /work/src/qemu/qapi-schema.json:9:
>> In file included from /work/src/qemu/qapi/block.json:6:
>> /work/src/qemu/qapi/block-core.json:1844: Flat union 'BlockdevOptionsNBD' 
>> must have a string base field
>> Makefile:286: recipe for target 'qmp-commands.h' failed
>> make: *** [qmp-commands.h] Error 1

Yep, doesn't work until pending qapi patches land.

>>
>> What about this:
>> { 'struct': 'BlockdevOptionsNBDBase',
>>   'data': {  'transport': 'NBDTransport', 'export': 'str' } }
>> { 'union': 'BlockdevOptionsNBD',
>>   'base': 'BlockdevOptionsNBDBase',
>>   'discriminator': 'transport',
>>   'data': { 'unix': 'NBDUnix', 'tcp': 'NBDInet', 'udp': 'NBDInet' } }
> 
> Another problem:
> In file included from /work/src/qemu/qapi-schema.json:9:
> In file included from /work/src/qemu/qapi/block.json:6:
> /work/src/qemu/qapi/block-core.json:1866: Member 'nbd' of union 
> 'BlockdevOptions' cannot use union type 'BlockdevOptionsNBD'
> Makefile:286: recipe for target 'qmp-commands.h' failed

Yep. Artificial restriction; we hope to lift it soon, but don't have
enough qapi patches in place for that one yet (I have not posted my work
in progress to get us that far).

Possible workaround in the meantime - instead of trying to go with a
nice flat union (where all QMP keys are in the same {} level), we can
use nesting (structs that add another {} to include the unions).

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