Skip to content

Commit

Permalink
hmp: Simplify how qmp_human_monitor_command() gets output
Browse files Browse the repository at this point in the history
Commit 48c043d "hmp: human-monitor-command: stop using the Memory
chardev driver" left us "if string is non-empty, duplicate it, else
duplicate the empty string".  Meh.  Duplicate it unconditionally.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-2-armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  • Loading branch information
Markus Armbruster committed Dec 19, 2020
1 parent 28f1c1f commit 436054e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions monitor/misc.c
Expand Up @@ -136,11 +136,7 @@ char *qmp_human_monitor_command(const char *command_line, bool has_cpu_index,
handle_hmp_command(&hmp, command_line);

WITH_QEMU_LOCK_GUARD(&hmp.common.mon_lock) {
if (qstring_get_length(hmp.common.outbuf) > 0) {
output = g_strdup(qstring_get_str(hmp.common.outbuf));
} else {
output = g_strdup("");
}
output = g_strdup(qstring_get_str(hmp.common.outbuf));
}

out:
Expand Down

0 comments on commit 436054e

Please sign in to comment.