1. 10 12月, 2018 1 次提交
  2. 27 11月, 2018 1 次提交
  3. 07 5月, 2018 1 次提交
    • G
      usb-host: skip open on pending postload bh · 3280ea8e
      Gerd Hoffmann 提交于
      usb-host emulates a device unplug after live migration, because the
      device state is unknown and unplug/replug makes sure the guest
      re-initializes the device into a working state.  This can't be done in
      post-load though, so post-load just schedules a bottom half which
      executes after vmload is complete.
      
      It can happen that the device autoscan timer hits the race window
      between scheduling and running the bottom half, which in turn can
      triggers an assert().
      
      Fix that issue by just ignoring the usb_host_open() call in case the
      bottom half didn't execute yet.
      
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1572851Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20180503062932.17233-1-kraxel@redhat.com
      3280ea8e
  4. 27 4月, 2018 1 次提交
    • J
      Fix libusb-1.0.22 deprecated libusb_set_debug with libusb_set_option · 9d8fa0df
      John Thomson 提交于
      libusb-1.0.22 marked libusb_set_debug deprecated
      it is replaced with
      libusb_set_option(libusb_context, LIBUSB_OPTION_LOG_LEVEL, libusb_log_level);
      
      details here: https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f461c5593168
      
      Warning here:
      
        CC      hw/usb/host-libusb.o
      /builds/xen/src/qemu-xen/hw/usb/host-libusb.c: In function 'usb_host_init':
      /builds/xen/src/qemu-xen/hw/usb/host-libusb.c:250:5: error: 'libusb_set_debug' is deprecated: Use libusb_set_option instead [-Werror=deprecated-declarations]
           libusb_set_debug(ctx, loglevel);
           ^~~~~~~~~~~~~~~~
      In file included from /builds/xen/src/qemu-xen/hw/usb/host-libusb.c:40:0:
      /usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
       void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                        ^~~~~~~~~~~~~~~~
      cc1: all warnings being treated as errors
      make: *** [/builds/xen/src/qemu-xen/rules.mak:66: hw/usb/host-libusb.o] Error 1
      make: Leaving directory '/builds/xen/src/xen/tools/qemu-xen-build'
      Signed-off-by: NJohn Thomson <git@johnthomson.fastmail.com.au>
      Message-id: 20180405132046.4968-1-git@johnthomson.fastmail.com.au
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9d8fa0df
  5. 21 6月, 2017 1 次提交
    • S
      usb-host: support devices with sparse/non-sequential USB interfaces · 896b6757
      Samuel Brian 提交于
      Some USB devices have sparse interface numbering which is not able to be
      passthroughed.
      For example, the Sierra Wireless MC7455/MC7430:
      
        # lsusb  -D /dev/bus/usb/003/003 | egrep '1199|9071|bNumInterfaces|bInterfaceNumber'
        Device: ID 1199:9071 Sierra Wireless, Inc.
          idVendor           0x1199 Sierra Wireless, Inc.
          idProduct          0x9071
            bNumInterfaces          5
              bInterfaceNumber        0
              bInterfaceNumber        2
              bInterfaceNumber        3
              bInterfaceNumber        8
              bInterfaceNumber       10
      
      In this case, the interface numbers are 0, 2, 3, 8, 10 and not the
      0, 1, 2, 3, 4 that QEMU tries to claim.
      
      This change allows sparse USB interface numbering.
      Instead of only claiming the interfaces in the range reported by the USB
      device through bNumInterfaces, QEMU attempts to claim all possible
      interfaces.
      
      v2 to fix broken v1 patch formatting.
      v3 to fix indentation.
      Signed-off-by: NSamuel Brian <sam.brian@accelerated.com>
      Message-id: 20170613234039.27201-1-sam.brian@accelerated.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      896b6757
  6. 03 4月, 2017 1 次提交
  7. 23 2月, 2017 1 次提交
  8. 31 1月, 2017 1 次提交
    • T
      hw/ppc/spapr: Fix boot path of usb-host storage devices · b99260eb
      Thomas Huth 提交于
      When passing through an USB storage device to a pseries guest, it
      is currently not possible to automatically boot from the device
      if the "bootindex" property has been specified, too (e.g. when using
      "-device nec-usb-xhci -device usb-host,hostbus=1,hostaddr=2,bootindex=0"
      at the command line). The problem is that QEMU builds a device tree path
      like "/pci@800000020000000/usb@0/usb-host@1" and passes it to SLOF
      in the /chosen/qemu,boot-list property. SLOF, however, probes the
      USB device, recognizes that it is a storage device and thus changes
      its name to "storage", and additionally adds a child node for the
      SCSI LUN, so the correct boot path in SLOF is something like
      "/pci@800000020000000/usb@0/storage@1/disk@101000000000000" instead.
      So when we detect an USB mass storage device with SCSI interface,
      we've got to adjust the firmware boot-device path properly that
      SLOF can automatically boot from the device.
      
      Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354177Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      b99260eb
  9. 13 9月, 2016 1 次提交
  10. 02 8月, 2016 2 次提交
  11. 13 6月, 2016 1 次提交
    • G
      usb-host: add special case for bus+addr · e058fa2d
      Gerd Hoffmann 提交于
      This patch changes usb-host behavior in case we hostbus= and hostaddr=
      properties are used to identify the usb device in question.  Instead of
      adding the device to the hotplug watchlist we try to open directly using
      the given bus number and device address.
      
      Putting a device specified by hostaddr to the hotplug watchlist isn't
      a great idea as the address isn't a fixed property.  It changes every
      time the device is plugged in.  So considering this case as "use the
      device at bus:addr _now_" is more sane.  Also usb-host will throw errors
      in case it can't initialize the host device.
      
      Note: For devices on the hotplug watchlist (hostport or vendorid or
      productid specified) qemu continues to ignore errors and keeps
      monitoring the usb bus to see if the device eventually shows up.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1464945175-28939-1-git-send-email-kraxel@redhat.com
      e058fa2d
  12. 11 5月, 2016 1 次提交
  13. 23 3月, 2016 1 次提交
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  14. 29 1月, 2016 1 次提交
    • P
      usb: Clean up includes · e532b2e0
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-20-git-send-email-peter.maydell@linaro.org
      e532b2e0
  15. 03 11月, 2015 1 次提交
    • G
      usb-host: fix usb3ep0quirk test · a9be4e7c
      Gerd Hoffmann 提交于
      usb->speed is the usb speed the device is actually running on in the
      qemu emulation (i.e. from the guests point of view).  So when plugging
      usb3 devices into ehci hostadapter this is HIGH not SUPER.
      
      To figure whenever the host talks to the device with superspeed we
      have to check speedmask instead and see whenever the superspeed bit
      is set there.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1445603230-11840-1-git-send-email-kraxel@redhat.com
      a9be4e7c
  16. 20 10月, 2015 1 次提交
  17. 11 9月, 2015 1 次提交
  18. 16 7月, 2015 1 次提交
  19. 23 6月, 2015 1 次提交
  20. 18 2月, 2015 2 次提交
  21. 10 12月, 2014 1 次提交
  22. 12 11月, 2014 1 次提交
  23. 11 11月, 2014 1 次提交
  24. 15 10月, 2014 2 次提交
  25. 23 9月, 2014 3 次提交
  26. 01 7月, 2014 1 次提交
    • J
      usb: initialize libusb_device to avoid crash · 3ce21445
      Jincheng Miao 提交于
      If libusb_get_device_list() fails, the uninitialized local variable
      libusb_device would be passed to libusb_free_device_list(), that
      will cause a crash, like:
      (gdb) bt
       #0  0x00007fbbb4bafc10 in pthread_mutex_lock () from /lib64/libpthread.so.0
       #1  0x00007fbbb233e653 in libusb_unref_device (dev=0x6275682d627375)
           at core.c:902
       #2  0x00007fbbb233e739 in libusb_free_device_list (list=0x7fbbb6e8436e,
           unref_devices=<optimized out>) at core.c:653
       #3  0x00007fbbb6cd80a4 in usb_host_auto_check (unused=unused@entry=0x0)
           at hw/usb/host-libusb.c:1446
       #4  0x00007fbbb6cd8525 in usb_host_initfn (udev=0x7fbbbd3c5670)
           at hw/usb/host-libusb.c:912
       #5  0x00007fbbb6cc123b in usb_device_init (dev=0x7fbbbd3c5670)
           at hw/usb/bus.c:106
       ...
      
      So initialize libusb_device at the begin time.
      Signed-off-by: NJincheng Miao <jmiao@redhat.com>
      Reviewed-by: NGonglei <arei.gonglei@huawei.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3ce21445
  27. 13 6月, 2014 1 次提交
  28. 02 6月, 2014 2 次提交
  29. 26 5月, 2014 3 次提交
  30. 15 2月, 2014 1 次提交
  31. 22 10月, 2013 2 次提交