Re: [Qemu-devel] [PATCH v4 2/4] qtest: introduce qmp_exec_hmp_cmd()

2014-06-18 Thread Paolo Bonzini
Il 18/06/2014 08:29, Amos Kong ha scritto: > Instead of adding g_strescape everywhere, we should use json-parser's own > interpolation support. See this patch: > http://article.gmane.org/gmane.comp.emulators.qemu/279836 which also fixes a > leak as a bonus. > > Also, you can use ' instead of " i

Re: [Qemu-devel] [PATCH v4 2/4] qtest: introduce qmp_exec_hmp_cmd()

2014-06-17 Thread Amos Kong
On Tue, Jun 17, 2014 at 07:37:06PM +0200, Paolo Bonzini wrote: > Il 06/06/2014 16:33, Amos Kong ha scritto: > >+va_end(ap); > >+ > >+escaped_cmd = g_strescape(cmd, NULL); > >+response = qmp("{\"execute\": \"human-monitor-command\"," > >+ " \"arguments\": {" > >+

Re: [Qemu-devel] [PATCH v4 2/4] qtest: introduce qmp_exec_hmp_cmd()

2014-06-17 Thread Paolo Bonzini
Il 06/06/2014 16:33, Amos Kong ha scritto: +va_end(ap); + +escaped_cmd = g_strescape(cmd, NULL); +response = qmp("{\"execute\": \"human-monitor-command\"," + " \"arguments\": {" + " \"command-line\": \"%s\"" + "}}", escaped_cmd);

Re: [Qemu-devel] [PATCH v4 2/4] qtest: introduce qmp_exec_hmp_cmd()

2014-06-17 Thread Andreas Färber
Am 06.06.2014 16:33, schrieb Amos Kong: > This patch wraps a helper function to execute human command by > one QMP command (human-monitor-command). It also checks the return > string. > > Signed-off-by: Amos Kong Reviewed-by: Andreas Färber Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5,

[Qemu-devel] [PATCH v4 2/4] qtest: introduce qmp_exec_hmp_cmd()

2014-06-06 Thread Amos Kong
This patch wraps a helper function to execute human command by one QMP command (human-monitor-command). It also checks the return string. Signed-off-by: Amos Kong --- tests/libqtest.c | 26 ++ tests/libqtest.h | 9 + 2 files changed, 35 insertions(+) diff --git