On Wed, Aug 03, 2016 at 12:43:48PM +0200, Pavel Hrdina wrote: > On Wed, Aug 03, 2016 at 10:10:53AM +0200, Peter Krempa wrote: > > Rather than formating a string and splitting it back to a JSON object > > add API that will take a JSON object directly. > > --- > > src/qemu/qemu_monitor.c | 18 ++++++++++++++++++ > > src/qemu/qemu_monitor.h | 2 ++ > > src/qemu/qemu_monitor_json.c | 29 +++++++++++++++++++---------- > > src/qemu/qemu_monitor_json.h | 2 ++ > > 4 files changed, 41 insertions(+), 10 deletions(-) > > > > diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c > > index 58c04d5..b58c412 100644 > > --- a/src/qemu/qemu_monitor.c > > +++ b/src/qemu/qemu_monitor.c > > @@ -2771,6 +2771,24 @@ qemuMonitorAddDevice(qemuMonitorPtr mon, > > > > > > /** > > + * qemuMonitorAddDeviceArgs: > > + * @mon: monitor object > > + * @args: arguments for device add, consumed on success or failure > > + * > > + * Adds a device described by @args. Requires JSON monitor. > > + * Returns 0 on success -1 on error. > > + */ > > +int > > +qemuMonitorAddDeviceArgs(qemuMonitorPtr mon, > > + virJSONValuePtr args) > > +{ > > + QEMU_CHECK_MONITOR_JSON(mon); > > + > > + return qemuMonitorJSONAddDeviceArgs(mon, args); > > +} > > + > > + > > +/** > > * qemuMonitorAddObject: > > * @mon: Pointer to monitor object > > * @type: Type name of object to add > > diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h > > index ae0954d..805656b 100644 > > --- a/src/qemu/qemu_monitor.h > > +++ b/src/qemu/qemu_monitor.h > > @@ -685,6 +685,8 @@ int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon, > > const char *bus, > > virPCIDeviceAddress *guestAddr); > > > > +int qemuMonitorAddDeviceArgs(qemuMonitorPtr mon, > > + virJSONValuePtr args); I've missed this one, wrong indentation. -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list