Skip to content
Snippets Groups Projects
  1. Apr 28, 2022
  2. Apr 21, 2022
  3. Apr 06, 2022
  4. Mar 22, 2022
  5. Feb 01, 2021
  6. Oct 09, 2020
  7. Jul 10, 2020
  8. Dec 18, 2019
    • Markus Armbruster's avatar
      error: Fix -msg timestamp default · deda497b
      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: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191010081508.8978-1-armbru@redhat.com>
      deda497b
  9. Apr 18, 2019
    • Markus Armbruster's avatar
      monitor error: Make printf()-like functions return a value · 679cb8e1
      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: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417190641.26814-11-armbru@redhat.com>
      679cb8e1
  10. Apr 17, 2019
    • Christophe Fergeau's avatar
      log: Make glib logging go through QEMU · f5852efa
      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: default avatarChristophe Fergeau <cfergeau@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20190131164614.19209-3-cfergeau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      f5852efa
  11. Oct 19, 2018
  12. Sep 24, 2018
  13. Jul 24, 2017
  14. Jul 13, 2017
  15. Nov 01, 2016
    • Paolo Bonzini's avatar
      qemu-error: remove dependency of stubs on monitor · 397d30e9
      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: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1477326663-67817-2-git-send-email-pbonzini@redhat.com>
      397d30e9
  16. Feb 04, 2016
  17. Jan 13, 2016
  18. Sep 18, 2015
    • Stefan Hajnoczi's avatar
      error: only prepend timestamp on stderr · 615cf669
      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: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <1439212541-16997-1-git-send-email-stefanha@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Tested-by: default avatarFrank Schreuder <fschreuder@transip.nl>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      615cf669
  19. Jun 22, 2015
    • Markus Armbruster's avatar
    • Markus Armbruster's avatar
      qmp: Wean off qerror_report() · 485febc6
      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: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
      485febc6
  20. Oct 09, 2014
  21. Apr 25, 2014
  22. Jul 10, 2013
    • Seiji Aguchi's avatar
      add timestamp to error_report() · 5e2ac519
      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: default avatarSeiji Aguchi <seiji.aguchi@hds.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
      5e2ac519
  23. Jan 12, 2013
  24. Dec 19, 2012
  25. Dec 15, 2011
  26. Jun 24, 2011
  27. Apr 15, 2011
  28. Mar 27, 2010
  29. Mar 23, 2010
  30. Mar 16, 2010
    • Markus Armbruster's avatar
      error: New error_printf_unless_qmp() · aa924ae7
      Markus Armbruster authored
      aa924ae7
    • Markus Armbruster's avatar
      error: Let converted handlers print in human monitor · cde0fc75
      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.
      cde0fc75
    • Markus Armbruster's avatar
      error: Track locations on command line · 0f0bc3f1
      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
      0f0bc3f1
    • Markus Armbruster's avatar
      error: Track locations in configuration files · cf5a65aa
      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:)
      cf5a65aa
Loading