1. 16 3月, 2010 12 次提交
    • M
      error: New error_printf() and error_vprintf() · ba0fe87a
      Markus Armbruster 提交于
      ba0fe87a
    • M
      2f792016
    • 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
    • M
      monitor: Factor monitor_set_error() out of qemu_error_internal() · d6f46833
      Markus Armbruster 提交于
      This separates the monitor part from the QError part.
      d6f46833
    • M
      block: Simplify usb_msd_initfn() test for "can read bdrv key" · a4426488
      Markus Armbruster 提交于
      The old test assumes that "hotplugged" implies "we have a current
      monitor for reading the key".  This is in fact true, but it's not
      obviously true.
      
      Aside: if it were false, we could pass a null pointer to
      monitor_read_bdrv_key_start(), which would then crash.
      
      The previous commit permits us to check for "we have a current
      monitor" directly, so do that.
      a4426488
    • M
      monitor: Separate "default monitor" and "current monitor" cleanly · 8631b608
      Markus Armbruster 提交于
      Commits 376253ec..731b0364 introduced global variable cur_mon, which
      points to the "default monitor" (if any), except during execution of
      monitor_read() or monitor_control_read() it points to the monitor from
      which we're reading instead (the "current monitor").  Monitor command
      handlers run within monitor_read() or monitor_control_read().
      
      Default monitor and current monitor are really separate things, and
      squashing them together is confusing and error-prone.
      
      For instance, usb_host_scan() can run both in "info usbhost" and
      periodically via usb_host_auto_check().  It prints to cur_mon, which
      is what we want in the former case: the monitor executing "info
      usbhost".  But since that's the default monitor in the latter case, it
      periodically spams the default monitor there.
      
      A few places use cur_mon to log stuff to the default monitor.  If we
      ever log something while cur_mon points to current monitor instead of
      default monitor, the log temporarily "jumps" to another monitor.
      Whether that can or cannot happen isn't always obvious.
      
      Maybe logging to the default monitor (which may not even exist) is a
      bad idea, and we should log to stderr or a logfile instead.  But
      that's outside the scope of this commit.
      
      Change cur_mon to point to the current monitor.  Create new
      default_mon to point to the default monitor.  Update users of cur_mon
      accordingly.
      
      This fixes the periodical spamming of the default monitor by
      usb_host_scan().  It also stops "log jumping", should that problem
      exist.
      8631b608
    • M
      tools: Remove unused cur_mon from qemu-tool.c · 070a2f81
      Markus Armbruster 提交于
      070a2f81
    • M
      pc: Factor common code out of pc_boot_set() and cmos_init() · d9346e81
      Markus Armbruster 提交于
      Code duplicated in commit 0ecdffbb.  The two versions are similar, but
      not identical:
      
      * cmos_init() reports errors to stderr, pc_boot_set() via
        qemu_error().  The latter is fine for both, so pick that for the
        common code.
      
      * cmos_init() obeys fd_bootchk, pc_boot_set() ignores it.  Make it a
        parameter of the common code.
      d9346e81
    • M
      pc: Fix error reporting for -boot once · 8ad00f84
      Markus Armbruster 提交于
      Commit 0ecdffbb created pc_boot_set() for use from monitor command
      "boot_set", via qemu_boot_set().  pc_boot_set() reports errors to
      cur_mon, which works fine for monitor code.
      
      Commit e0f084bf reused the function int reset handler
      restore_boot_devices().  Use of cur_mon is problematic in that
      context.  For instance, the "Too many boot devices for PC" error for
      "-boot order=abcdefgh,once=c" goes to the monitor instead of stderr.
      The monitor may not even exist.
      
      Fix by switching to qemu_error().
      8ad00f84
    • M
      savevm: Fix -loadvm to report errors to stderr, not the monitor · 03cd4655
      Markus Armbruster 提交于
      A monitor may not even exist.
      
      Change load_vmstate() to use qemu_error() instead of monitor_printf().
      Parameter mon is now unused, remove it.
      03cd4655
    • M
      usb: Remove disabled monitor_printf() in usb_read_file() · 4491e0f3
      Markus Armbruster 提交于
      The monitor_printf() reports failure.  Printing is wrong, because the
      caller tries various arguments, and expects the function to fail for
      some or all.
      
      Disabled since commit 26a9e82a.  Remove it.
      4491e0f3
  2. 12 3月, 2010 3 次提交
  3. 11 3月, 2010 1 次提交
  4. 10 3月, 2010 12 次提交
  5. 09 3月, 2010 12 次提交