1. 17 3月, 2010 14 次提交
  2. 16 3月, 2010 25 次提交
    • M
      qdev: Hide "no_user" devices from users · c64eafaf
      Markus Armbruster 提交于
      Users can't create them, so qdev_device_help() shouldn't list them.
      Fix that.
      
      Also make qdev_device_add() pretend they don't exist.  Before, it
      rejected them with a "can't be added via command line" message, which
      wasn't quite right for monitor command device_add.
      c64eafaf
    • M
      qdev: Factor qdev_create_from_info() out of qdev_create() · 0c17542d
      Markus Armbruster 提交于
      To make it obvious that -device and device_add can't die in
      hw_error().
      0c17542d
    • M
      qdev: Fix -device and device_add to handle unsuitable bus gracefully · 327867b6
      Markus Armbruster 提交于
      "device_add isa-serial,bus=pci.0" kills QEMU.  Not good.
      327867b6
    • M
      error: Track locations on command line · 0f0bc3f1
      Markus 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
      0f0bc3f1
    • M
      ef82516d
    • M
      error: Track locations in configuration files · cf5a65aa
      Markus 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:)
      cf5a65aa
    • 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: Don't abuse qemu_error() for non-error in scsi_hot_add() · 6fdb03d5
      Markus Armbruster 提交于
      Commit 30d335d6 converted an informational message from
      monitor_printf() to qemu_error(), probably because the latter doesn't
      need a mon argument.  A later commit will make qemu_error() print
      additional stuff that is only appropriate for proper errors, and then
      this will break.  Clean it up.
      6fdb03d5
    • M
      error: Don't abuse qemu_error() for non-error in qbus_find() · 53db16b5
      Markus Armbruster 提交于
      qbus_find() adds an informational line to error messages, and prints
      both lines with one qemu_error().  Use error_printf() for the
      informational line instead.
      
      While there, simplify: instead of printing buffers filled by
      qbus_list_bus() and qbus_list_dev() in one go, make them print it.
      53db16b5
    • M
      error: Don't abuse qemu_error() for non-error in qdev_device_help() · 8a9662ca
      Markus Armbruster 提交于
      qdev_device_help() prints device information with qemu_error().  A
      later commit will make qemu_error() print additional stuff that is
      only appropriate for proper errors, and then this will break.  Use
      error_printf() instead.
      
      While there, simplify: instead of printing a buffer filled by
      qdev_print_devinfo() in one go, make qdev_print_devinfo() print it.
      8a9662ca
    • 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
  3. 12 3月, 2010 1 次提交