summaryrefslogtreecommitdiff
path: root/qemu-error.h
AgeCommit message (Collapse)Author
2011-12-15error: Add an accessor for prognamemichael@ozlabs.org
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>
2010-10-03Use GCC_FMT_ATTR (format checking)Stefan Weil
Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-03Replace most gcc format attributes by macro GCC_FMT_ATTR (format checking)Stefan Weil
Since version 4.4.x, gcc supports additional format attributes. __attribute__ ((format (gnu_printf, 1, 2))) should be used instead of __attribute__ ((format (printf, 1, 2)) because QEMU always uses standard format strings (even with mingw32). The patch replaces format attribute printf / __printf__ by macro GCC_FMT_ATTR which uses gnu_printf if supported. It also removes an #ifdef __GNUC__ (not needed any longer). Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-03-27error: Move qerror_report() from qemu-error.[ch] to qerror.[ch]Markus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-03-16error: New error_printf_unless_qmp()Markus Armbruster
2010-03-16error: Track locations on command lineMarkus Armbruster
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
2010-03-16error: Track locations in configuration filesMarkus Armbruster
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:)
2010-03-16error: Include the program name in error messages to stderrMarkus Armbruster
2010-03-16error: Infrastructure to track locations for error reportingMarkus Armbruster
New struct Location holds a location. So far, the only location is LOC_NONE, so this doesn't do anything useful yet. Passing the current location all over the place would be too cumbersome. Hide it away in static cur_loc instead, and provide accessors. Print it in error_report(). Store it in QError, and print it in qerror_print(). Store it in QemuOpt, for use by qemu_opts_foreach(). This makes error_report() do the right thing when it runs within qemu_opts_foreach(). We may still have to store it in other data structures holding user input for better error messages. Left for another day.
2010-03-16error: Rename qemu_error_new() to qerror_report()Markus Armbruster
2010-03-16error: Replace qemu_error() by error_report()Markus Armbruster
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
2010-03-16error: New error_printf() and error_vprintf()Markus Armbruster
2010-03-16error: Move qemu_error & friends into their own headerMarkus Armbruster