]> git.proxmox.com Git - mirror_qemu.git/commit - linux-user/cpu_loop-common.h
qom/cpu: Simplify how CPUClass:cpu_dump_state() prints
authorMarkus Armbruster <armbru@redhat.com>
Wed, 17 Apr 2019 19:18:02 +0000 (21:18 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 18 Apr 2019 20:18:59 +0000 (22:18 +0200)
commit90c84c56006747537e9e4240271523c4c3b7a481
tree7cb7cc06e9dfae5c89d0581e6b9458349ed82260
parent19aaa4c3fd15eeb82f10c35ffc7d53e103d10787
qom/cpu: Simplify how CPUClass:cpu_dump_state() prints

CPUClass method dump_statistics() takes an fprintf()-like callback and
a FILE * to pass to it.  Most callers pass fprintf() and stderr.
log_cpu_state() passes fprintf() and qemu_log_file.
hmp_info_registers() passes monitor_fprintf() and the current monitor
cast to FILE *.  monitor_fprintf() casts it right back, and is
otherwise identical to monitor_printf().

The callback gets passed around a lot, which is tiresome.  The
type-punning around monitor_fprintf() is ugly.

Drop the callback, and call qemu_fprintf() instead.  Also gets rid of
the type-punning, since qemu_fprintf() takes NULL instead of the
current monitor cast to FILE *.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190417191805.28198-15-armbru@redhat.com>
63 files changed:
accel/kvm/kvm-all.c
bsd-user/main.c
cpus.c
exec.c
include/exec/log.h
include/qom/cpu.h
linux-user/alpha/cpu_loop.c
linux-user/cpu_loop-common.h
linux-user/cris/cpu_loop.c
linux-user/microblaze/cpu_loop.c
linux-user/s390x/cpu_loop.c
linux-user/sh4/cpu_loop.c
linux-user/sparc/cpu_loop.c
monitor.c
qom/cpu.c
target/alpha/cpu.h
target/alpha/helper.c
target/arm/arm-semi.c
target/arm/cpu.h
target/arm/translate-a64.c
target/arm/translate.c
target/arm/translate.h
target/cris/cpu.h
target/cris/helper.c
target/cris/translate.c
target/hppa/cpu.h
target/hppa/helper.c
target/i386/cpu.h
target/i386/hax-all.c
target/i386/helper.c
target/lm32/cpu.h
target/lm32/translate.c
target/m68k/cpu.h
target/m68k/translate.c
target/microblaze/cpu.h
target/microblaze/helper.c
target/microblaze/translate.c
target/mips/internal.h
target/mips/translate.c
target/moxie/cpu.h
target/moxie/helper.c
target/moxie/translate.c
target/nios2/cpu.h
target/nios2/helper.c
target/nios2/translate.c
target/openrisc/cpu.h
target/openrisc/translate.c
target/ppc/cpu.h
target/ppc/translate.c
target/riscv/cpu.c
target/s390x/helper.c
target/s390x/internal.h
target/sh4/cpu.h
target/sh4/translate.c
target/sparc/cpu.c
target/sparc/cpu.h
target/tilegx/cpu.c
target/tricore/cpu.h
target/tricore/translate.c
target/unicore32/cpu.h
target/unicore32/translate.c
target/xtensa/cpu.h
target/xtensa/translate.c