Patchwork [RFC,2/4] monitor: Adjust qmp_human_monitor_command to new MemCharDriver

login
register
mail settings
Submitter Lei Li
Date Aug. 1, 2012, 9:48 a.m.
Message ID <1343814538-27591-3-git-send-email-lilei@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/174429/
State New
Headers show

Comments

Lei Li - Aug. 1, 2012, 9:48 a.m.
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
---
 monitor.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

Patch

diff --git a/monitor.c b/monitor.c
index 49dccfe..c1a4d81 100644
--- a/monitor.c
+++ b/monitor.c
@@ -645,7 +645,13 @@  char *qmp_human_monitor_command(const char *command_line, bool has_cpu_index,
     CharDriverState mchar;
 
     memset(&hmp, 0, sizeof(hmp));
-    qemu_chr_init_mem(&mchar);
+
+    /* Since the backend of MemCharDriver convert to a circular
+     * buffer with fixed size, so should indicate the init memory
+     * size.
+     *
+     * XXX:  is 4096 as init memory enough for this? */
+    qemu_chr_init_mem(&mchar, 4096);
     hmp.chr = &mchar;
 
     old_mon = cur_mon;