diff options
| author | Markus Armbruster <armbru@redhat.com> | 2019-04-17 21:18:00 +0200 |
|---|---|---|
| committer | Markus Armbruster <armbru@redhat.com> | 2019-04-18 22:18:59 +0200 |
| commit | 11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98 (patch) | |
| tree | 40fc2a77e515f2cb6f55bdf50305b1befeee6ad6 /qom/cpu.c | |
| parent | d3fd9e4b79f77afea17213a7b32ba9eda7fc59c1 (diff) | |
| download | focaccia-qemu-11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98.tar.gz focaccia-qemu-11cb6c152a52fdda6a7f5a8bb271344aaf0c2b98.zip | |
qom/cpu: Simplify how CPUClass::dump_statistics() prints
CPUClass method dump_statistics() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_cpustats() (via cpu_dump_statistics()) passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417191805.28198-13-armbru@redhat.com>
Diffstat (limited to 'qom/cpu.c')
| -rw-r--r-- | qom/cpu.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/qom/cpu.c b/qom/cpu.c index a8d2958956..029e7fe9b0 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -230,13 +230,12 @@ void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, } } -void cpu_dump_statistics(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, - int flags) +void cpu_dump_statistics(CPUState *cpu, int flags) { CPUClass *cc = CPU_GET_CLASS(cpu); if (cc->dump_statistics) { - cc->dump_statistics(cpu, f, cpu_fprintf, flags); + cc->dump_statistics(cpu, flags); } } |