[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/33] hmp: Simplify how qmp_human_monitor_command() gets output
From: |
Markus Armbruster |
Subject: |
[PULL 14/33] hmp: Simplify how qmp_human_monitor_command() gets output |
Date: |
Sat, 19 Dec 2020 11:55:13 +0100 |
Commit 48c043d0d1 "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>
---
monitor/misc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/monitor/misc.c b/monitor/misc.c
index f2ee7cd77a..33d0dae2e8 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -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:
--
2.26.2
- [PULL 28/33] qobject: Factor JSON writer out of qobject_to_json(), (continued)
- [PULL 28/33] qobject: Factor JSON writer out of qobject_to_json(), Markus Armbruster, 2020/12/19
- [PULL 25/33] qobject: Drop qobject_get_try_str(), Markus Armbruster, 2020/12/19
- [PULL 30/33] json: Use GString instead of QString to accumulate strings, Markus Armbruster, 2020/12/19
- [PULL 31/33] keyval: Use GString to accumulate value strings, Markus Armbruster, 2020/12/19
- [PULL 18/33] qobject: Change qobject_to_json()'s value to GString, Markus Armbruster, 2020/12/19
- [PULL 33/33] qobject: Make QString immutable, Markus Armbruster, 2020/12/19
- [PULL 27/33] qobject: Factor quoted_str() out of to_json(), Markus Armbruster, 2020/12/19
- [PULL 29/33] migration: Replace migration's JSON writer by the general one, Markus Armbruster, 2020/12/19
- [PULL 32/33] block: Use GString instead of QString to build filenames, Markus Armbruster, 2020/12/19
- [PULL 21/33] qobject: Move internals to qobject-internal.h, Markus Armbruster, 2020/12/19
- [PULL 14/33] hmp: Simplify how qmp_human_monitor_command() gets output,
Markus Armbruster <=
- [PULL 17/33] qobject: Use GString instead of QString to accumulate JSON, Markus Armbruster, 2020/12/19
- [PULL 03/33] qapi: Use QAPI_LIST_PREPEND() where possible, Markus Armbruster, 2020/12/19
- [PULL 24/33] Revert "qobject: let object_property_get_str() use new API", Markus Armbruster, 2020/12/19
- Re: [PULL 00/33] QAPI patches patches for 2020-12-19, no-reply, 2020/12/19