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

Re: [libvirt] [PATCH 3/4] Update QEMU device_add command in JSON mode



On Thu, Apr 15, 2010 at 11:43:10AM +0100, Daniel P. Berrange wrote:
> The device_add command was added in JSON mode in a way I didn't
> expect. Instead of passing the normal device string to the JSON
> command:
> 
>     { "execute": "device_add", "arguments": { "device": "ne2k_pci,id=nic.1,netdev=net.1" } }
> 
> We need to split up the device string into a full JSON object
> 
>     { "execute": "device_add", "arguments": { "driver": "ne2k_pci", "id": "nic.1", "netdev": "net.1" } }

  haha, that explains some of the hotplug device bugs we got,

> * src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Rename the
>   qemuCommandLineParseKeywords method to qemuParseKeywords
>   and export it to monitor
> * src/qemu/qemu_monitor_json.c: Split up device string into
>   a JSON object for device_add command
> ---
>  src/qemu/qemu_conf.c         |   30 ++++++++--------
>  src/qemu/qemu_conf.h         |    6 +++
>  src/qemu/qemu_monitor_json.c |   78 +++++++++++++++++++++++++++++++++++++++--
>  3 files changed, 95 insertions(+), 19 deletions(-)
> 

ACK,

the parsing code is not trivial though,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


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