[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/20] hmp: Simplify how qmp_human_monitor_command() gets out
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH 01/20] hmp: Simplify how qmp_human_monitor_command() gets output |
Date: |
Wed, 16 Dec 2020 18:53:50 +0000 |
User-agent: |
Mutt/1.14.6 (2020-07-11) |
* Markus Armbruster (armbru@redhat.com) wrote:
> 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>
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 398211a034..6c3e8506a9 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
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- [PATCH 09/20] qmp: Fix tracing of non-string command IDs, (continued)
- [PATCH 09/20] qmp: Fix tracing of non-string command IDs, Markus Armbruster, 2020/12/11
- [PATCH 03/20] qobject: Make qobject_to_json_pretty() take a pretty argument, Markus Armbruster, 2020/12/11
- [PATCH 07/20] hw/rdma: Replace QList by GQueue, Markus Armbruster, 2020/12/11
- [PATCH 10/20] block: Avoid qobject_get_try_str(), Markus Armbruster, 2020/12/11
- [PATCH 15/20] qobject: Factor JSON writer out of qobject_to_json(), Markus Armbruster, 2020/12/11
- [PATCH 20/20] qobject: Make QString immutable, Markus Armbruster, 2020/12/11
- [PATCH 18/20] keyval: Use GString to accumulate value strings, Markus Armbruster, 2020/12/11
- [PATCH 01/20] hmp: Simplify how qmp_human_monitor_command() gets output, Markus Armbruster, 2020/12/11
- Re: [PATCH 01/20] hmp: Simplify how qmp_human_monitor_command() gets output,
Dr. David Alan Gilbert <=
- [PATCH 11/20] Revert "qobject: let object_property_get_str() use new API", Markus Armbruster, 2020/12/11
- [PATCH 17/20] json: Use GString instead of QString to accumulate strings, Markus Armbruster, 2020/12/11
- [PATCH 13/20] qobject: Drop qstring_get_try_str(), Markus Armbruster, 2020/12/11
- [PATCH 16/20] migration: Replace migration's JSON writer by the general one, Markus Armbruster, 2020/12/11
- Re: [PATCH 00/20] Immutable QString, and also one JSON writer less, Paolo Bonzini, 2020/12/22