On 21 October 2015 at 17:48, Markus Armbruster <arm...@redhat.com> wrote: > Lluís Vilanova <vilan...@ac.upc.edu> writes: > >> Hi, >> >> I was wondering what is the proper way (or ways, depending on the subsystem) >> of >> reporting and signalling errors in QEMU. The coding style file does not seem >> to >> mention it, and the code uses all kinds of forms for that: >> >> * printf + exit(1) >> * fprintf(stderr) + exit(1) >> * error_report + exit(1) >> * cpu_abort >> * Some other I probably forgot > > cpu_abort() and hw_error() are fancy ways to abort(). Terminating with > abort() on "this can't be happening" conditions is perfectly sensible, > and doing it in fancy ways can be useful. For other errors, it's > inappropriate.
In particular, the fact that TCG will cpu_abort() if you try to generate code out of something that's not RAM is a perpetual source of confusion to users, because the usual reason it happens is not a QEMU bug but buggy guest code jumping off to a random address... -- PMM