1. 22 1月, 2013 1 次提交
  2. 17 1月, 2013 1 次提交
  3. 11 1月, 2013 1 次提交
    • A
      Make all static TypeInfos const · 8c43a6f0
      Andreas Färber 提交于
      Since 39bffca2 (qdev: register all
      types natively through QEMU Object Model), TypeInfo as used in
      the common, non-iterative pattern is no longer amended with information
      and should therefore be const.
      
      Fix the documented QOM examples:
      
       sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
      
      Since frequently the wrong examples are being copied by contributors of
      new devices, fix all types in the tree:
      
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
      
      This also avoids to piggy-back these changes onto real functional
      changes or other refactorings.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8c43a6f0
  4. 19 12月, 2012 4 次提交
  5. 09 11月, 2012 1 次提交
    • H
      usb: split packet result into actual_length + status · 9a77a0f5
      Hans de Goede 提交于
      Since with the ehci and xhci controllers a single packet can be larger
      then maxpacketsize, it is possible for the result of a single packet
      to be both having transferred some data as well as the transfer to have
      an error.
      
      An example would be an input transfer from a bulk endpoint successfully
      receiving 1 or more maxpacketsize packets from the device, followed
      by a packet signalling halt.
      
      While already touching all the devices and controllers handle_packet /
      handle_data / handle_control code, also change the return type of
      these functions to void, solely storing the status in the packet. To
      make the code paths for regular versus async packet handling more
      uniform.
      
      This patch unfortunately is somewhat invasive, since makeing the qemu
      usb core deal with this requires changes everywhere. This patch only
      prepares the usb core for this, all the hcd / device changes are done
      in such a way that there are no functional changes.
      
      This patch has been tested with uhci and ehci hcds, together with usb-audio,
      usb-hid and usb-storage devices, as well as with usb-redir redirection
      with a wide variety of real devices.
      
      Note that there is usually no need to directly set packet->actual_length
      form devices handle_data callback, as that is done by usb_packet_copy()
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9a77a0f5
  6. 11 9月, 2012 1 次提交
  7. 07 8月, 2012 2 次提交
  8. 17 7月, 2012 1 次提交
  9. 20 6月, 2012 1 次提交
  10. 07 6月, 2012 4 次提交
  11. 05 6月, 2012 1 次提交
    • L
      qemu-option: qemu_opts_create(): use error_set() · 8be7e7e4
      Luiz Capitulino 提交于
      This commit converts qemu_opts_create() from qerror_report() to
      error_set().
      
      Currently, most calls to qemu_opts_create() can't fail, so most
      callers don't need any changes.
      
      The two cases where code checks for qemu_opts_create() erros are:
      
       1. Initialization code in vl.c. All of them print their own
          error messages directly to stderr, no need to pass the Error
          object
      
       2. The functions opts_parse(), qemu_opts_from_qdict() and
          qemu_chr_parse_compat() make use of the error information and
          they can be called from HMP or QMP. In this case, to allow for
          incremental conversion, we propagate the error up using
          qerror_report_err(), which keeps the QError semantics
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-By: NLaszlo Ersek <lersek@redhat.com>
      8be7e7e4
  12. 26 4月, 2012 2 次提交
    • G
      usb: add serial number generator · 9d55d1ad
      Gerd Hoffmann 提交于
      This patch adds a function which creates unique serial numbers for usb
      devices and puts it into use.  Windows guests tend to become unhappy if
      they find two identical usb devices in the system.  Effects range from
      non-functional devices (with yellow exclamation mark in device manager)
      to BSODs.  Handing out unique serial numbers to devices fixes this.
      
      With this patch applied almost all emulated devices get a generated,
      unique serial number.  There are two exceptions:
      
       * usb-storage devices will prefer a user-specified serial number
         and will only get a generated number in case the serial property
         is unset.
       * usb-hid devices keep the fixed serial number "42" as it is used
         to signal "remote wakeup actually works".
         See commit 7b074a22Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9d55d1ad
    • G
      usb-storage: fix request canceling · 6d7aeeeb
      Gerd Hoffmann 提交于
      Little fix for usb packet handling on i/o cancelation.  The
      usb packet pointer (s->packet) is cleared at the wrong place:
      The scsi request cancel handler does it.  When a usb packet
      is canceled the usb-storage emulation canceles the scsi request
      if present.  In most cases there is one, so usually s->packet
      is cleared as needed even with the code sitting at the wrong
      place.
      
      If there is no scsi request in flight s->packet is not cleared
      though.  The usb-storage emulation will then try to complete an
      usb packet which is not in flight any more and thereby trigger
      an assert() in the usb core.
      
      Fix this by clearing s->packet at the correct place, which is
      the usb packet cancel header.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      6d7aeeeb
  13. 10 4月, 2012 1 次提交
    • L
      qdev: qdev_unplug(): use error_set() · 56f9107e
      Luiz Capitulino 提交于
      It currently uses qerror_report(), but next commit will convert
      the drive_del command to the QAPI and this requires using
      error_set().
      
      One particularity of qerror_report() is that it knows when it's
      running on monitor context or command-line context and prints the
      error message accordingly. error_set() doesn't do this, so we
      have to be careful not to drop error messages.
      
      qdev_unplug() has three kinds of usages:
      
       1. It's called when hot adding a device fails, to undo anything
          that has been done before hitting the error
      
       2. It's called by function monitor functions like device_del(),
          to unplug a device
      
       3. It's used by xen_platform.c in a way that doesn't _seem_ to
          be in monitor context
      
      Only item 2 can print an error message to the user, this commit
      maintains that.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      56f9107e
  14. 13 3月, 2012 2 次提交
  15. 27 2月, 2012 1 次提交
  16. 22 2月, 2012 1 次提交
  17. 15 2月, 2012 1 次提交
  18. 10 2月, 2012 2 次提交
    • G
      usb: Set USBEndpoint in usb_packet_setup(). · 079d0b7f
      Gerd Hoffmann 提交于
      With the separation of the device lookup (via usb_find_device) and
      packet processing we can lookup device and endpoint before setting up
      the usb packet.  So we can initialize USBPacket->ep early and keep it
      valid for the whole lifecycle of the USBPacket.  Also the devaddr and
      devep fields are not needed any more.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      079d0b7f
    • G
      usb: kill handle_packet callback · 7f74a56b
      Gerd Hoffmann 提交于
      All drivers except usb-hub use usb_generic_handle_packet.  The only
      reason the usb hub has its own function is that it used to be called
      with packets which are intended for downstream devices.  With the new,
      separate device lookup step this doesn't happen any more, so the need
      for a different handle_packet callback is gone.
      
      So we can kill the handle_packet callback and just call
      usb_generic_handle_packet directly.  The special hub handling in
      usb_handle_packet() can go away for the same reason.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7f74a56b
  19. 04 2月, 2012 2 次提交
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      Anthony Liguori 提交于
      This was done in a mostly automated fashion.  I did it in three steps and then
      rebased it into a single step which avoids repeatedly touching every file in
      the tree.
      
      The first step was a sed-based addition of the parent type to the subclass
      registration functions.
      
      The second step was another sed-based removal of subclass registration functions
      while also adding virtual functions from the base class into a class_init
      function as appropriate.
      
      Finally, a python script was used to convert the DeviceInfo structures and
      qdev_register_subclass functions to TypeInfo structures, class_init functions,
      and type_register_static calls.
      
      We are almost fully converted to QOM after this commit.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      39bffca2
    • A
      usb: separate out legacy usb registration from type registration · ba02430f
      Anthony Liguori 提交于
      Type registeration is going to get turned into a QOM call so decouple the
      legacy support.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ba02430f
  20. 28 1月, 2012 1 次提交
  21. 13 1月, 2012 1 次提交
  22. 06 1月, 2012 2 次提交
    • M
      scsi virtio-blk usb-msd: Clean up device init error messages · 6a84cb1f
      Markus Armbruster 提交于
      Replace
      
          error_report("DEVICE-NAME: MESSAGE");
      
      by just
      
          error_report("MESSAGE");
      
      in block device init functions.
      
      DEVICE-NAME is bogus in some cases: it's "scsi-disk" for device
      scsi-hd and scsi-cd, "virtio-blk-pci" for virtio-blk-s390, and
      "usb-msd" for usb-storage.
      
      There is no real need to put a device name in the message, because
      error_report() points to the offending command line option already:
      
      $ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb -device virtio-blk-pci
      upstream-qemu: -device virtio-blk-pci: virtio-blk-pci: drive property not set
      upstream-qemu: -device virtio-blk-pci: Device 'virtio-blk-pci' could not be initialized
      
      And for a monitor command, it's obvious anyway:
      
      $ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb
      (qemu) device_add virtio-blk-pci
      virtio-blk-pci: drive property not set
      Device 'virtio-blk-pci' could not be initialized
      Reported-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      6a84cb1f
    • G
      usb-storage: cancel I/O on reset · 24a5bbe1
      Gerd Hoffmann 提交于
      When resetting the usb-storage device we'll have to carefully cancel
      and clear any requests which might be in flight, otherwise we'll confuse
      the state machine.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      24a5bbe1
  23. 22 11月, 2011 1 次提交
  24. 21 11月, 2011 5 次提交