qemu/scsi
Christophe Fergeau f5852efa29 log: Make glib logging go through QEMU
This commit adds a error_init() helper which calls
g_log_set_default_handler() so that glib logs (g_log, g_warning, ...)
are handled similarly to other QEMU logs. This means they will get a
timestamp if timestamps are enabled, and they will go through the
HMP monitor if one is configured.

This commit also adds a call to error_init() to the binaries
installed by QEMU. Since error_init() also calls error_set_progname(),
this means that *-linux-user, *-bsd-user and qemu-pr-helper messages
output with error_report, info_report, ... will slightly change: they
will be prefixed by the binary name.

glib debug messages are enabled through G_MESSAGES_DEBUG similarly to
the glib default log handler.

At the moment, this change will mostly impact SPICE logging if your
spice version is >= 0.14.1. With older spice versions, this is not going
to work as expected, but will not have any ill effect, so this call is
not conditional on the SPICE version.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20190131164614.19209-3-cfergeau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2019-04-17 19:08:27 +02:00
..
Makefile.objs pr-manager: put stubs in .c file 2018-06-28 19:05:35 +02:00
pr-helper.h Clean up includes 2018-02-09 05:05:11 +01:00
pr-manager-helper.c qapi: Drop qapi_event_send_FOO()'s Error ** argument 2018-08-28 18:21:38 +02:00
pr-manager-stub.c pr-manager: add query-pr-managers QMP command 2018-06-28 19:05:35 +02:00
pr-manager.c file-posix: Switch to .bdrv_co_ioctl 2018-12-14 11:52:41 +01:00
qemu-pr-helper.c log: Make glib logging go through QEMU 2019-04-17 19:08:27 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
utils.c scsi: fix scsi_convert_sense crash when in_buf == NULL && in_len == 0 2018-01-12 09:54:13 +01:00