On 10/15/2012 12:51 AM, Lei Li wrote: > On 10/12/2012 08:39 PM, Gerd Hoffmann wrote: >> This patch adds chardev_add and chardev_del monitor commands. >> >> chardev_del is pretty straight forward, it just takes an id argument and >> zaps the chardev specified. >> >> chardev_add is more tricky as there are tons of arguments for the >> different backends. The hmp version limited to the most common use >> cases, especially when it comes to sockets: You can only specify port >> (tcp) or path (unix) and qemu will create a listening socket. For >> example this ... >> >> (qemu) chardev_add foo socket 42 >> >> ... will do the same as ... >> >> -chardev socket,id=foo,port=42,server,nowait >> >> on the qemu command line. >> >> The qmp version has full support for everything the -chardev command >> line switch can handle. The implementation is pretty straight >> forward: It just puts all arguments it got into a QemuOpts, then goes >> call qemu_chr_new_from_opts(). >> >> Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
>> +++ b/qapi-schema.json >> @@ -2796,3 +2796,42 @@ >> # Since: 0.14.0 >> ## >> { 'command': 'screendump', 'data': {'filename': 'str'} } >> + >> +## >> +# @chardev_add: The QMP command should be named 'chardev-add'. >> +# >> +# Add a chardev >> +# >> +# @id: the chardev's ID, must be unique >> +# @backend: the chardev backend: "file", "socket", ... Rather than making this an open-coded string, should it instead be a QMP enum value? >> +## >> +# @chardev_del: And this should be 'chardev-del' or even 'chardev-remove', as QMP commands tend to favor legibility over abbreviations. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature