diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 42 |
1 files changed, 32 insertions, 10 deletions
@@ -261,11 +261,30 @@ int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, } } +static gboolean monitor_unblocked(GIOChannel *chan, GIOCondition cond, + void *opaque) +{ + monitor_flush(opaque); + return FALSE; +} + void monitor_flush(Monitor *mon) { + int rc; + if (mon && mon->outbuf_index != 0 && !mon->mux_out) { - qemu_chr_fe_write(mon->chr, mon->outbuf, mon->outbuf_index); - mon->outbuf_index = 0; + rc = qemu_chr_fe_write(mon->chr, mon->outbuf, mon->outbuf_index); + if (rc == mon->outbuf_index) { + /* all flushed */ + mon->outbuf_index = 0; + return; + } + if (rc > 0) { + /* partinal write */ + memmove(mon->outbuf, mon->outbuf + rc, mon->outbuf_index - rc); + mon->outbuf_index -= rc; + } + qemu_chr_fe_add_watch(mon->chr, G_IO_OUT, monitor_unblocked, mon); } } @@ -2728,6 +2747,13 @@ static mon_cmd_t info_cmds[] = { .mhandler.cmd = hmp_info_tpm, }, { + .name = "cpu_max", + .args_type = "", + .params = "", + .help = "Get maximum number of VCPUs supported by machine", + .mhandler.cmd = hmp_query_cpu_max, + }, + { .name = NULL, }, }; @@ -2942,10 +2968,6 @@ static const MonitorDef monitor_defs[] = { { "xer", 0, &monitor_get_xer, }, { "tbu", 0, &monitor_get_tbu, }, { "tbl", 0, &monitor_get_tbl, }, -#if defined(TARGET_PPC64) - /* Address space register */ - { "asr", offsetof(CPUPPCState, asr) }, -#endif /* Segment registers */ { "sdr1", offsetof(CPUPPCState, spr[SPR_SDR1]) }, { "sr0", offsetof(CPUPPCState, sr[0]) }, @@ -3542,10 +3564,10 @@ static const mon_cmd_t *qmp_find_cmd(const char *cmdname) * If @cmdline is blank, return NULL. * If it can't be parsed, report to @mon, and return NULL. * Else, insert command arguments into @qdict, and return the command. - * If sub-command table exist, and if @cmdline contains addtional string for - * sub-command, this function will try search sub-command table. if no - * addtional string for sub-command exist, this function will return the found - * one in @table. + * If a sub-command table exists, and if @cmdline contains an additional string + * for a sub-command, this function will try to search the sub-command table. + * If no additional string for a sub-command is present, this function will + * return the command found in @table. * Do not assume the returned command points into @table! It doesn't * when the command is a sub-command. */ |