[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/4] qtest: introduce qmp_exec_hmp_cmd()
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/4] qtest: introduce qmp_exec_hmp_cmd() |
Date: |
Fri, 6 Jun 2014 15:20:28 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Jun 06, 2014 at 09:11:58AM +0800, Amos Kong wrote:
> +void qmp_exec_hmp_cmd(const char *expected_ret, const char *fmt, ...)
> +{
> + va_list ap;
> + char cmd[1024];
> + char *escaped_cmd;
> + QDict *response;
> + const char *response_return;
> +
> + va_start(ap, fmt);
> + vsprintf(cmd, fmt, ap);
> + va_end(ap);
> +
> + escaped_cmd = g_strescape(cmd, NULL);
> + response = qmp("{\"execute\": \"human-monitor-command\","
> + " \"arguments\": {"
> + " \"command-line\": \"%s\""
> + "}}", escaped_cmd);
> + free(escaped_cmd);
glib uses g_malloc()/g_free() instead of malloc()/free(). Please use
g_free() since the string comes from g_strescape().
- [Qemu-devel] [PATCH v3 0/4] test virtio-blk hotplug, Amos Kong, 2014/06/05
- [Qemu-devel] [PATCH v3 1/4] virtio-blk-test.c: change pci_nop() to virtblk_init(), Amos Kong, 2014/06/05
- [Qemu-devel] [PATCH v3 2/4] qtest: introduce qmp_exec_hmp_cmd(), Amos Kong, 2014/06/05
- Re: [Qemu-devel] [PATCH v3 2/4] qtest: introduce qmp_exec_hmp_cmd(),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Amos Kong, 2014/06/05
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Gonglei (Arei), 2014/06/05
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Amos Kong, 2014/06/06
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Gonglei (Arei), 2014/06/06
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Amos Kong, 2014/06/06
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Gonglei (Arei), 2014/06/06
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Amos Kong, 2014/06/06
- Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Gonglei (Arei), 2014/06/06
Re: [Qemu-devel] [PATCH v3 3/4] virtio-blk-test.c: add hotplug subtest, Stefan Hajnoczi, 2014/06/06
[Qemu-devel] [PATCH v3 4/4] qtest: use qmp_exec_hmp_cmd() in blockdev-test, Amos Kong, 2014/06/05