diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-10-09 17:24:01 +0200 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2021-10-31 21:05:40 +0100 |
commit | 61848717d639446b58b069e480739a757d74813d (patch) | |
tree | e6b85f05d2491238732ab7b33b2156fa9c573231 /target/i386 | |
parent | af531756d25541a1b3b3d9a14e72e7fedd941a2e (diff) | |
download | qemu-61848717d639446b58b069e480739a757d74813d.zip qemu-61848717d639446b58b069e480739a757d74813d.tar.gz qemu-61848717d639446b58b069e480739a757d74813d.tar.bz2 |
monitor: Trim some trailing space from human-readable output
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Message-Id: <20211009152401.2982862-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'target/i386')
-rw-r--r-- | target/i386/cpu-dump.c | 4 | ||||
-rw-r--r-- | target/i386/cpu.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 02b635a..08ac957 100644 --- a/target/i386/cpu-dump.c +++ b/target/i386/cpu-dump.c @@ -464,13 +464,13 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags) snprintf(cc_op_name, sizeof(cc_op_name), "[%d]", env->cc_op); #ifdef TARGET_X86_64 if (env->hflags & HF_CS64_MASK) { - qemu_fprintf(f, "CCS=%016" PRIx64 " CCD=%016" PRIx64 " CCO=%-8s\n", + qemu_fprintf(f, "CCS=%016" PRIx64 " CCD=%016" PRIx64 " CCO=%s\n", env->cc_src, env->cc_dst, cc_op_name); } else #endif { - qemu_fprintf(f, "CCS=%08x CCD=%08x CCO=%-8s\n", + qemu_fprintf(f, "CCS=%08x CCD=%08x CCO=%s\n", (uint32_t)env->cc_src, (uint32_t)env->cc_dst, cc_op_name); } diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 598d451..c5744ce 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4878,7 +4878,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data) desc = g_strdup_printf("%s", model_id); } - qemu_printf("x86 %-20s %-58s\n", name, desc); + qemu_printf("x86 %-20s %s\n", name, desc); } /* list available CPU models and flags */ |