1. 05 4月, 2013 1 次提交
  2. 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
  3. 07 1月, 2013 1 次提交
  4. 19 12月, 2012 2 次提交
  5. 04 12月, 2012 1 次提交
    • H
      usb-tablet: Allow connecting to ehci · 427e3aa1
      Hans de Goede 提交于
      Our ehci code has is capable of significantly lowering the wakeup rate
      for the hcd emulation while the device is idle. It is possible to add
      similar code ot the uhci emulation, but that simply is not there atm,
      and there is no reason why a (virtual) usb-tablet can not be a USB-2 device.
      
      Making usb-hid devices connect to the emulated ehci controller instead
      of the emulated uhci controller on vms which have both lowers the cpuload
      for a fully idle vm from 20% to 2-3% (on my laptop).
      
      An alternative implementation to using a property to select the tablet
      type, would be simply making it a new device type, ie usb-tablet2, but the
      downside of that is that this will require libvirt changes to be available
      through libvirt at all, and then management tools changes to become the
      default for new vms, where as using a property will automatically get
      any pc-1.3 type vms the lower cpuload.
      
      [ kraxel: adapt compat property for post-1.3 merge ]
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      
      tablet compat fixup
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      427e3aa1
  6. 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
  7. 20 6月, 2012 1 次提交
  8. 13 3月, 2012 1 次提交
    • G
      usb: the big rename · f1ae32a1
      Gerd Hoffmann 提交于
      Reorganize usb source files.  Create a new hw/usb/ directory and move
      all usb source code to that place.  Also make filenames a bit more
      descriptive.  Host adapters are prefixed with "hch-" now, usb device
      emulations are prefixed with "dev-".  Fixup paths Makefile and include
      paths to make it compile.  No code changes.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      f1ae32a1
  9. 27 2月, 2012 1 次提交
  10. 15 2月, 2012 1 次提交
  11. 10 2月, 2012 3 次提交
    • G
      usb: pass USBEndpoint to usb_wakeup · 7567b51f
      Gerd Hoffmann 提交于
      Devices must specify which endpoint has data to transfer now.
      The plan is to use the usb_wakeup() not only for remove wakeup support,
      but for "data ready" signaling in general, so we can move away from
      constant polling to event driven usb device emulation.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7567b51f
    • 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
  12. 04 2月, 2012 3 次提交
  13. 28 1月, 2012 1 次提交
  14. 13 1月, 2012 1 次提交
  15. 13 10月, 2011 1 次提交
    • G
      usb-hid: activate usb tablet / mouse after migration. · 3a3286bf
      Gerd Hoffmann 提交于
      qemu uses the ps/2 mouse by default.  The usb tablet (or mouse) is
      activated as soon as qemu sees some guest activity on the device,
      i.e. polling for HID events.  That used to work fine for both fresh
      boot and migration.
      
      Remote wakeup support changed the picture though: There will be no
      polling after migration in case the guest suspended the usb bus,
      waiting for wakeup events.  Result is that the ps/2 mouse stays
      active.
      
      Fix this by activating the usb tablet / mouse in post_load() in case
      the guest enabled remote wakeup.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3a3286bf
  16. 10 8月, 2011 3 次提交
  17. 04 8月, 2011 6 次提交
    • G
      hid: move idle+protocol from usb-hid to hid too. · b069d348
      Gerd Hoffmann 提交于
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      b069d348
    • G
      usb-hid: split hid code to hw/hid.[ch] · dcfda673
      Gerd Hoffmann 提交于
      Almost pure code motion.  Unstatic hid interface functions and add
      them to the header file.  Some renames.  Some code style cleanups.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      dcfda673
    • G
      usb-hid: add hid_has_events() · 38931fa8
      Gerd Hoffmann 提交于
      Add hid_has_events function, use it to figure whenever there are pending
      events instead of checking and updating USBHIDState->changed.
      
      Setting ->changed to 1 on init is removed, that should have absolutely
      no effect as the initial state of ->idle is 0 so we report hid state
      anyway until the guest configures some idle time.  Also should clear
      ->idle on reset.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      38931fa8
    • G
      usb-hid: add event callback · 8bde6805
      Gerd Hoffmann 提交于
      Add callback for event notification, which allows to un-usbify more
      functions.  Also split separate hid_* functions for reset and release.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8bde6805
    • G
      usb-hid: create & use HIDState · 0d878eec
      Gerd Hoffmann 提交于
      First step in separating out the HID emulation code from usb-hid, so it
      can be reused without creating a dummy usb device like bluetooth does.
      
      This creates a HIDState struct, moves the non-usbish fields from
      USBHIDStruct there.  Renames non-usbish structs, defines and functions
      from usb* to hid*.  Adapts the code to that.
      
      Also cleans up a bunch of code style issues along the way.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      0d878eec
    • G
      usb: use iovecs in USBPacket · 4f4321c1
      Gerd Hoffmann 提交于
      Zap data pointer from USBPacket, add a QEMUIOVector instead.
      Add a bunch of helper functions to manage USBPacket data.
      Switch over users to the new interface.
      
      Note that USBPacket->len was used for two purposes:  First to
      pass in the buffer size and second to return the number of
      transfered bytes or the status code on async transfers.  There
      is a new result variable for the latter.  A new status code
      was added to catch uninitialized result.
      
      Nobody creates iovecs with more than one element (yet).
      Some users are (temporarely) limited to iovecs with a single
      element to keep the patch size as small as possible.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4f4321c1
  18. 30 7月, 2011 1 次提交
  19. 22 7月, 2011 1 次提交
  20. 14 6月, 2011 2 次提交
  21. 26 5月, 2011 2 次提交
  22. 16 4月, 2011 1 次提交
  23. 21 3月, 2011 1 次提交
    • P
      change all other clock references to use nanosecond resolution accessors · 74475455
      Paolo Bonzini 提交于
      This was done with:
      
          sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \
              $(git grep -l 'qemu_get_clock\>' )
          sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \
              $(git grep -l 'qemu_new_timer\>' )
      
      after checking that get_clock and new_timer never occur twice
      on the same line.  There were no missed occurrences; however, even
      if there had been, they would have been caught by the compiler.
      
      There was exactly one false positive in qemu_run_timers:
      
           -    current_time = qemu_get_clock (clock);
           +    current_time = qemu_get_clock_ns (clock);
      
      which is of course not in this patch.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      74475455
  24. 25 1月, 2011 3 次提交