qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RfC 0/9] chardev hotplug


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH RfC 0/9] chardev hotplug
Date: Fri, 21 Dec 2012 13:17:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121116 Thunderbird/10.0.11

On 12/21/12 12:53, Paolo Bonzini wrote:
> Il 21/12/2012 12:45, Gerd Hoffmann ha scritto:
>> On 12/20/12 14:02, Gerd Hoffmann wrote:
>>>   Hi,
>>>
>>>> /me wades through the socket code (unix+tcp) right now, which needs some
>>>> refactoring to make it fly.
>>>
>>> Sneak preview attached.  Goes on top of the series.
>>> Compile tested only so far.
>>
>> Now that it comes to testing: how does the union look (in josn) at the wire?
> 
> Tests are your friends! (Especially qapi-schema-test.json and
> test-qmp-input-visitor.c).  Something like this:
> 
>   { 'type': 'UserDefA',
>     'data': { 'boolean': 'bool' } }
> 
>   { 'type': 'UserDefB',
>     'data': { 'integer': 'int' } }
> 
>   { 'union': 'UserDefUnion',
>     'data': { 'a' : 'UserDefA', 'b' : 'UserDefB' } }
> 
> looks like this:
> 
>   { 'type': 'b', 'data' : { 'integer': 42 } }

So ...

{ 'type': 'ChardevDummy', 'data': { } }

{ 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
                                       'port'   : 'ChardevPort',
                                       'socket' : 'ChardevSocket',
                                       'pty'    : 'ChardevDummy',
                                       'null'   : 'ChardevDummy' } }

{ 'command': 'chardev-add', 'data': {'id'      : 'str',
                                     'backend' : 'ChardevBackend' },

... should accept ...

{'id': 'test-null', 'backend': {'data': {}, 'type': 'null'}}

... as parameters for chardev-add, no?  But I get back ...

 {u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter
'backend'"}}

... and can't see what is wrong there ...

cheers,
  Gerd




reply via email to

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