qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.
Date: Fri, 14 Dec 2012 06:05:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/14/2012 05:17 AM, Paolo Bonzini wrote:
> Il 14/12/2012 10:38, Gerd Hoffmann ha scritto:
>> This patch adds chardev_add_file, chardev_add_tty and chardev_remove
>> monitor commands.
>>
>> chardev_add_file and chardev_add_tty expect an id and a path, they
>> create a file/tty chardev.
> 
> I'd rather avoid introducing this interface.  Using multiple commands is
> different from all previous examples, both HMP and QMP (including recent
> ones such as the NBD server).  It is also hard to extend, for example
> file descriptor passing is hard to retrofit.

File descriptor passing via magic /dev/fdset/nnn should probably already
work.  That said, a single command that uses a QAPI union, rather than
one command per source type, would be nicer from the UI perspective, and
it is the QMP UI perspective that libvirt is concerned about.

> 
> Perhaps you can define a QAPI union and slowly build it up?  Something
> that ultimately can become this:
> 
> { 'enum': 'ChardevFileMode', 'data':
>   # pty = console under Windows
>   # serial = tty under POSIX
>   [ 'file', 'pipe', 'parport', 'pty', 'serial' ] }
> 
> { 'enum: 'ChardevFileSource', 'data':
>   [ 'path', 'fd' ] }
> 
> { 'type': 'ChardevFile',
>   'data': {'source': 'string', 'source-type': 'ChardevFileSource',
>            'mode': 'ChardevFileMode'}}
> 
> { 'type': 'ChardevVC',
>   'data': {'width': 'int', 'height': 'int', '*characters': 'bool'}}
> 
> { 'type': 'ChardevSocket',
>   'data': {'addr': 'SocketAddress', '*server': 'bool',
>            '*wait': 'bool', '*nodelay': 'bool', '*telnet': 'bool'} }
> 
> # For future extensibility...
> { 'ChardevDummy', 'data': {} }
> 
> { 'union': 'ChardevBackend', 'data': {
>   'socket': 'ChardevSocket',
>   'udp': 'UDPSocketAddress',
>   'file': 'ChardevFile',
>   'null': 'ChardevDummy',
>   'msmouse': 'ChardevDummy',
>   'braille': 'ChardevDummy',
>   'stdio': 'ChardevDummy',
>   'vc': 'ChardevVC',
> 
>   # Solely for HMP usage.
>   'legacy': 'str'
> }
> 
> { 'command': 'chardev-add', 'data': {
>   'backend': 'ChardevBackend', 'id': 'str', '*mux': 'bool' } }

Yes, this looks nicer.

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