qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Trim some trailing space from human-readable output


From: Markus Armbruster
Subject: Re: [PATCH] Trim some trailing space from human-readable output
Date: Tue, 12 Oct 2021 06:48:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 10/9/21 17:24, Markus Armbruster wrote:
>> I noticed -cpu help printing enough trailing spaces to make the output
>> at least 84 characters wide.  Looks ugly unless the terminal is wider.
>> Ugly or not, trailing spaces are stupid.
>> 
>> The culprit is this line in x86_cpu_list_entry():
>> 
>>     qemu_printf("x86 %-20s  %-58s\n", name, desc);
>> 
>> This prints a string with minimum field left-justified right before a
>> newline.  Change it to
>> 
>>     qemu_printf("x86 %-20s  %s\n", name, desc);
>> 
>> which avoids the trailing spaces and is simpler to boot.
>> 
>> A search for the pattern with "git-grep -E '%-[0-9]+s\\n'" found a few
>> more instances.  Change them similarly.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  monitor/hmp-cmds.c         | 2 +-
>>  target/i386/cpu-dump.c     | 4 ++--
>>  target/i386/cpu.c          | 2 +-
>>  target/ppc/cpu_init.c      | 2 +-
>>  target/s390x/cpu_models.c  | 4 ++--
>>  target/xtensa/mmu_helper.c | 2 +-
>>  6 files changed, 8 insertions(+), 8 deletions(-)
>
> Nitpicking, do you mind prefixing the patch subject with 'monitor:'?

You're right, the code I patch is called from HMP commands, and probably
not from anywhere else.

> Otherwise:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]