- Apr 28, 2022
-
-
Haiyue Wang authored
The 'g_get_real_time' returns the number of microseconds since January 1, 1970 UTC, but 'g_date_time_new_from_unix_utc' needs the number of seconds, so it will cause the invalid time input: (process:279642): GLib-CRITICAL (recursed) **: g_date_time_format: assertion 'datetime != NULL' failed Call function 'g_date_time_new_now_utc' instead, it has the same result as 'g_date_time_new_from_unix_utc(g_get_real_time() / G_USEC_PER_SEC)'; Fixes: 73dab893 ("error-report: replace deprecated g_get_current_time() with glib >= 2.62") Signed-off-by:
Haiyue Wang <haiyue.wang@intel.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220424105036.291370-1-haiyue.wang@intel.com>
-
- Apr 21, 2022
-
-
Marc-André Lureau authored
Since it depends on monitor code, and error_vprintf_unless_qmp() is already there. This will help to move error-report in a common subproject. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-31-marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
The solution was discussed with Markus Armbruster during the review: https://patchew.org/QEMU/20220323155743.1585078-1-marcandre.lureau@redhat.com/20220323155743.1585078-14-marcandre.lureau@redhat.com/ Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-3-marcandre.lureau@redhat.com>
-
- Apr 06, 2022
-
-
Marc-André Lureau authored
For consistency with other calls in the function, let's use error_printf(). (it will use stderr since !monitor_cur()) Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-16-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
The header name is more appropriate. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-15-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
According to GLib API: g_get_current_time has been deprecated since version 2.62 and should not be used in newly-written code. GTimeVal is not year-2038-safe. Use g_get_real_time() instead. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-14-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 22, 2022
-
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com>
-
- Feb 01, 2021
-
-
Stefan Hajnoczi authored
The -msg timestamp=on|off option controls whether a timestamp is printed with error_report() messages. The "-msg" name suggests that this option has a wider effect than just error_report(). The next patch extends it to the 'log' trace backend, so rename the variable from error_with_timestamp to message_with_timestamp. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20210125113507.224287-2-stefanha@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Oct 09, 2020
-
-
Kevin Wolf authored
cur_mon really needs to be coroutine-local as soon as we move monitor command handlers to coroutines and let them yield. As a first step, just remove all direct accesses to cur_mon so that we can implement this in the getter function later. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Message-Id: <20201005155855.256490-4-kwolf@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Jul 10, 2020
-
-
Mario Smarduch authored
This is followup patch to the one submitted back in Oct, 19 https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg02102.html My mistake here, I took my eyes of the mailing list after I got the initial thumbs up. This patch follows up on Markus comments in the above link. Purpose of this patch: We want to print guest name for errors, warnings and info messages. This was the first of two patches the second being MCE errors targeting a VM with guest name prepended. But in a large fleet we see many other errors that disable a VM or crash it. In a large fleet and centralized logging having the guest name enables identify of owner and customer. Signed-off-by:
Mario Smarduch <msmarduch@digitalocean.com> Message-Id: <20200626201900.8876-1-msmarduch@digitalocean.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 18, 2019
-
-
Markus Armbruster authored
-msg parameter "timestamp" defaults to "off" if you don't specify msg, and to "on" if you do. Messed up right in commit 5e2ac519 "add timestamp to error_report()". Mostly harmless, because "timestamp" is the only parameter, so "if you do" is "-msg ''", which nobody does. Change the default to "off" no matter what. While there, rename enable_timestamp_msg to error_with_timestamp, and polish documentation. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20191010081508.8978-1-armbru@redhat.com>
-
- Apr 18, 2019
-
-
Markus Armbruster authored
printf() & friends return the number of characters written on success, negative value on error. monitor_printf(), monitor_vfprintf(), monitor_vprintf(), error_printf(), error_printf_unless_qmp(), error_vprintf(), and error_vprintf_unless_qmp() return void. Some of them carry a TODO comment asking for int instead. Improve them to return int like printf() does. This makes our use of monitor_printf() as fprintf_function slightly less dirty: the function cast no longer adds a return value that isn't there. It still changes a parameter's pointer type. That will be addressed in a future commit. monitor_vfprintf() always returns zero. Improve it to return the proper value. Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417190641.26814-11-armbru@redhat.com>
-
- Apr 17, 2019
-
-
Christophe Fergeau authored
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>
-
- Oct 19, 2018
-
-
Markus Armbruster authored
Commit 97f40301 "error: Functions to report warnings and informational messages" copied the "use error_setg() instead" admonition from the error reporting functions to new functions even though it doesn't actually apply there. Drop it. Also drop it from vreport(), where it doesn't apply anymore. Reported-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20181019123923.26649-1-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
- Sep 24, 2018
-
-
Cornelia Huck authored
Add two functions to print an error/warning report once depending on a passed-in condition variable and flip it if printed. This is useful if you want to print a message not once-globally, but e.g. once-per-device. Inspired by warn_once() in hw/vfio/ccw.c, which has been replaced with warn_report_once_cond(). Signed-off-by:
Cornelia Huck <cohuck@redhat.com> Message-Id: <20180830145902.27376-2-cohuck@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> [Function comments reworded] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Jul 24, 2017
-
-
Markus Armbruster authored
Commit 97f40301 changed warning messages from timestamp-if-enabled progname ":" location "warning: " message to "warning: " timestamp-if-enabled progname ":" location message This regressed qemu-iotests 051. Put "warning: " right back where it was, along with "info: ". Reported-by:
Kevin Wolf <kwolf@redhat.com> Cc: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1500449614-16811-1-git-send-email-armbru@redhat.com> Reviewed-by:
Alistair Francis <alistair.francis@xilinx.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com>
-
- Jul 13, 2017
-
-
Alistair Francis authored
Add warn_report(), warn_vreport() for reporting warnings, and info_report(), info_vreport() for informational messages. These are implemented them with a helper function factored out of error_vreport(), suitably generalized. This patch makes no changes to the output of the original error_report() function. Signed-off-by:
Alistair Francis <alistair.francis@xilinx.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <c89e9980019f296ec9aa38d7689ac4d5c369296d.1499866456.git.alistair.francis@xilinx.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
Alistair Francis authored
Rename the error_print_loc() function in preparation for using it to print warnings as well. Signed-off-by:
Alistair Francis <alistair.francis@xilinx.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <661b215695db878a0aef8401b506fb3da50e981a.1499866456.git.alistair.francis@xilinx.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Nov 01, 2016
-
-
Paolo Bonzini authored
Leave the implementation of error_vprintf and error_vprintf_unless_qmp (the latter now trivially wrapped by error_printf_unless_qmp) to libqemustub.a and monitor.c. This has two advantages: it lets us remove the monitor_printf and monitor_vprintf stubs, and it lets tests provide a different implementation of the functions that uses g_test_message. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1477326663-67817-2-git-send-email-pbonzini@redhat.com>
-
- Feb 04, 2016
-
-
Peter Maydell authored
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-6-git-send-email-peter.maydell@linaro.org
-
- Jan 13, 2016
-
-
Markus Armbruster authored
While there, tighten error_append_hint()'s assertion. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <1450452927-8346-6-git-send-email-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
- Sep 18, 2015
-
-
Stefan Hajnoczi authored
The -msg timestamp=on option prepends a timestamp to error messages. This is useful on stderr where it allows users to identify when an error was raised. Timestamps do not make sense on the monitor since error_report() is called in response to a synchronous monitor command and the user already knows "when" the command was issued. Additionally, the rest of the monitor conversation lacks timestamps so the error timestamp cannot be correlated with other activity. Only prepend timestamps on stderr. This fixes libvirt's 'drive_del' processing, which did not expect a timestamp. Other QEMU monitor clients are probably equally confused by timestamps on monitor error messages. Cc: Markus Armbruster <armbru@redhat.com> Cc: Seiji Aguchi <seiji.aguchi@hds.com> Cc: Frank Schreuder <fschreuder@transip.nl> Cc: Daniel P. Berrange <berrange@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <1439212541-16997-1-git-send-email-stefanha@redhat.com> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Tested-by:
Frank Schreuder <fschreuder@transip.nl> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Jun 22, 2015
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
Markus Armbruster authored
The traditional QMP command handler interface int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data); doesn't provide for returning an Error object. Instead, the handler is expected to stash it in the monitor with qerror_report(). When we rebased QMP on top of QAPI, we didn't change this interface. Instead, commit 776574d6 introduced "middle mode" as a temporary aid for converting existing QMP commands to QAPI one by one. More than three years later, we're still using it. Middle mode has two effects: * Instead of the native input marshallers static void qmp_marshal_input_FOO(QDict *, QObject **, Error **) it generates input marshallers conforming to the traditional QMP command handler interface. * It suppresses generation of code to register them with qmp_register_command() This permits giving them internal linkage. As long as we need qmp-commands.hx, we can't use the registry behind qmp_register_command(), so the latter has to stay for now. The former has to go to get rid of qerror_report(). Changing all QMP commands to fit the QAPI mold in one go was impractical back when we started, but by now there are just a few stragglers left: do_qmp_capabilities(), qmp_qom_set(), qmp_qom_get(), qmp_object_add(), qmp_netdev_add(), do_device_add(). Switch middle mode to generate native input marshallers, and adapt the stragglers. Simplifies both the monitor code and the stragglers. Rename do_qmp_capabilities() to qmp_capabilities(), and do_device_add() to qmp_device_add, because that's how QMP command handlers are named today. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- Oct 09, 2014
-
-
Corey Minyard authored
Needed to nicely print socket error reports. Signed-off-by:
Corey Minyard <cminyard@mvista.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Apr 25, 2014
-
-
Cole Robinson authored
monitor_printf will drop the requested output if cur_mon is qmp (for good reason). However these messages are often helpful for debugging issues with via libvirt. If we know the message won't hit the monitor, send it to stderr. Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by:
Cole Robinson <crobinso@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
Cole Robinson authored
Cc: Luiz Capitulino <lcapitulino@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by:
Cole Robinson <crobinso@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- Jul 10, 2013
-
-
Seiji Aguchi authored
[Issue] When we offer a customer support service and a problem happens in a customer's system, we try to understand the problem by comparing what the customer reports with message logs of the customer's system. In this case, we often need to know when the problem happens. But, currently, there is no timestamp in qemu's error messages. Therefore, we may not be able to understand the problem based on error messages. [Solution] Add a timestamp to qemu's error message logged by error_report() with g_time_val_to_iso8601(). Signed-off-by:
Seiji Aguchi <seiji.aguchi@hds.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- Jan 12, 2013
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 15, 2011
-
-
Michael Ellerman authored
We'd like to get the progname for help output, so add an accessor. Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Reviewed-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by:
Andreas F=E4rber <afaerber@suse.de> Signed-off-by:
Michael Ellerman <michael@ellerman.id.au> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Jun 24, 2011
-
-
Markus Armbruster authored
error_report() prepends location, and appends a newline. The message constructed from the arguments should not contain a newline. Fix the obvious offenders. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- Apr 15, 2011
-
-
Blue Swirl authored
Remove unused sysemu.h include directives to speed up build with the following patches. Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- Mar 27, 2010
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Aurelien Jarno <aurelien@aurel32.net>
-
- Mar 23, 2010
-
-
Edgar E. Iglesias authored
CC qemu-error.o cc1: warnings being treated as errors /home/edgar/src/c/qemu/git/qemu/qemu-error.c: In function 'error_print_loc': /home/edgar/src/c/qemu/git/qemu/qemu-error.c:191: error: format not a string literal and no format arguments make: *** [qemu-error.o] Error 1 Signed-off-by:
Edgar E. Iglesias <edgar.iglesias@gmail.com>
-
- Mar 16, 2010
-
-
Markus Armbruster authored
-
Markus Armbruster authored
While fully converted handlers are not supposed to print anything when running in a QMP monitor, they are free to print in a human monitor. For instance, device_add (not yet converted) prints help, and will continue to do so after conversion. Moreover, utility functions converted to QError should remain usable from unconverted handlers. Two problems: * handler_audit() complains when a converted handler prints. Limit that to QMP monitors. * With QMP, handlers need to pass the error object by way of monitor_set_error(). However, we do that both for QMP and for the human monitor. The human monitor prints the error object after the handler returns. If the handler prints anything else, that output "overtakes" the error message. Limit use of monitor_set_error() to QMP monitors. Update handler_audit() accordingly.
-
Markus Armbruster authored
New LOC_CMDLINE. Use it for tracking option with argument in lookup_opt(). We now report errors like this qemu: -device smbus-eeprom: Did not find I2C bus for smbus-eeprom
-
Markus Armbruster authored
New LOC_FILE. Use it for tracking file name and line number in qemu_config_parse(). We now report errors like qemu:foo.conf:42: Did not find I2C bus for smbus-eeprom In particular, gems like this message: -device: no driver specified become almost nice now: qemu:foo.conf:44: -device: no driver specified (A later commit will get rid of the bogus -device:)
-