1. 16 3月, 2010 7 次提交
    • M
      65abca0a
    • M
      error: Infrastructure to track locations for error reporting · 827b0813
      Markus 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.
      827b0813
    • M
      ab5b027e
    • M
      error: Replace qemu_error() by error_report() · 1ecda02b
      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.
      1ecda02b
    • M
      error: New error_printf() and error_vprintf() · ba0fe87a
      Markus Armbruster 提交于
      ba0fe87a
    • M
      error: Simplify error sink setup · 6e4f984c
      Markus Armbruster 提交于
      qemu_error_sink can either point to a monitor or a file.  In practice,
      it always points to the current monitor if we have one, else to
      stderr.  Simply route errors to the current monitor or else to stderr,
      and remove qemu_error_sink along with the functions to control it.
      
      Actually, the old code switches the sink slightly later, in
      handle_user_command() and handle_qmp_command(), than it gets switched
      now, implicitly, by setting the current monitor in monitor_read() and
      monitor_control_read().  Likewise, it switches back slightly earlier
      (same places).  Doesn't make a difference, because there are no calls
      of qemu_error() in between.
      6e4f984c
    • M
      error: Move qemu_error() & friends from monitor.c to own file · b4a51f7f
      Markus Armbruster 提交于
      They're about reporting errors, not about the monitor.
      b4a51f7f