qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH] exec: Move hw_error() to the CPU namespace
@ 2018-06-22 13:46 Philippe Mathieu-Daudé
  2018-06-22 14:32 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-06-22 13:46 UTC (permalink / raw)
  To: Paolo Bonzini, Richard Henderson, Thomas Huth
  Cc: Philippe Mathieu-Daudé, qemu-devel, Peter Crosthwaite

hw_error() is only meant for CPU errors (since it dumps the CPU state).

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Thomas, do you think this is the correct place for this function?

    $ git grep hw_error hw/ | wc -l
    145

work to do...

Patchew will throw many errors :)

Change suggested here:
http://lists.nongnu.org/archive/html/qemu-devel/2018-06/msg06478.html

 include/exec/cpu-all.h | 9 +++++++++
 include/hw/hw.h        | 2 --
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 7fa726b8e3..467026da1b 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -345,4 +345,13 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
 
 int cpu_exec(CPUState *cpu);
 
+/**
+ * hw_error:
+ * @fmt: printf-style format string
+ * @args: optional arguments for format string
+ *
+ * Report a CPU hardware error, dump the CPUs state, finally abort.
+ */
+void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
+
 #endif /* CPU_ALL_H */
diff --git a/include/hw/hw.h b/include/hw/hw.h
index ab4950c312..65fa6d32f8 100644
--- a/include/hw/hw.h
+++ b/include/hw/hw.h
@@ -15,6 +15,4 @@
 #include "qemu/module.h"
 #include "sysemu/reset.h"
 
-void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
-
 #endif
-- 
2.18.0.rc2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-23 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-22 13:46 [Qemu-devel] [RFC PATCH] exec: Move hw_error() to the CPU namespace Philippe Mathieu-Daudé
2018-06-22 14:32 ` Peter Maydell
2018-06-22 19:09   ` Thomas Huth
2018-06-23 16:03     ` Peter Maydell
2018-06-22 16:42 ` no-reply
2018-06-22 16:56 ` no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).