diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-02-06 21:27:15 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-06 16:35:17 -0600 |
commit | 3ab651fc819178cf6a518af5860cc49f42cff455 (patch) | |
tree | ff7e205ecb9e4ac0dc68fbf1c19d8b99e7c7ea54 /hmp.c | |
parent | 82e59a676c01b3df3b53998d428d0a64a55f2439 (diff) | |
download | qemu-3ab651fc819178cf6a518af5860cc49f42cff455.tar.gz qemu-3ab651fc819178cf6a518af5860cc49f42cff455.tar.bz2 qemu-3ab651fc819178cf6a518af5860cc49f42cff455.zip |
qmp: Clean up design of memchar-read
The data returned has a well-defined size, which makes the size
returned along with it redundant at best. Drop it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -677,21 +677,18 @@ void hmp_memchar_read(Monitor *mon, const QDict *qdict) { uint32_t size = qdict_get_int(qdict, "size"); const char *chardev = qdict_get_str(qdict, "device"); - MemCharRead *meminfo; + char *data; Error *errp = NULL; - meminfo = qmp_memchar_read(chardev, size, false, 0, &errp); + data = qmp_memchar_read(chardev, size, false, 0, &errp); if (errp) { monitor_printf(mon, "%s\n", error_get_pretty(errp)); error_free(errp); return; } - if (meminfo->count > 0) { - monitor_printf(mon, "%s\n", meminfo->data); - } - - qapi_free_MemCharRead(meminfo); + monitor_printf(mon, "%s\n", data); + g_free(data); } static void hmp_cont_cb(void *opaque, int err) |