Skip to contentSkip to conversation

Usb 20171005 patches

GIT PULL Applied Gerd Hoffmann 2 participants 6 messages Oct 5, 2017

lore
Share & tools
lore
#1 lore raw

[Qemu-devel] [PULL 3/4] usb: Use angle brackets for cacard include directive

In reply to Gerd Hoffmann

From: Fam Zheng <[email protected]>

This is a library header, so angle brackets are more appropriate; also move the line to before QEMU headers, as is recommended in HACKING.

Message-id: [email protected]

---
 hw/usb/ccid-card-passthru.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/ccid-card-passthru.c +1 -1
index 45d96b03c6..117711862e 100644
@@ -9,11 +9,11 @@
  */
 
 #include "qemu/osdep.h"
+#include <cacard/vscard_common.h>
 #include "chardev/char-fe.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "ccid.h"
-#include "cacard/vscard_common.h"
 
 #define DPRINTF(card, lvl, fmt, ...)                    \
 do {                                                    \
Signature · 1 line
2.9.3
#0 lore raw

The following changes since commit ab161529261928ae7f3556e3220829c34b2686ec:

Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170927a' into staging (2017-09-27 22:44:51 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/usb-20171005-pull-request

for you to fetch changes up to eea6ae20379dca837631d603c3bed03e5128189f:

usb: fix host-stub.c build race (2017-10-05 11:03:25 +0200)

----------------------------------------------------------------
usb bugfixes.

----------------------------------------------------------------

Fam Zheng (1):
usb: Use angle brackets for cacard include directive

Gerd Hoffmann (2):
usb: fix libusb config variable name.
usb: fix host-stub.c build race

Thomas Huth (1):
hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple()

 hw/usb/bus.c                | 4 +---
 hw/usb/ccid-card-passthru.c | 2 +-
 hw/usb/Makefile.objs        | 3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
2.9.3
#2 lore raw

[Qemu-devel] [PULL 2/4] usb: fix libusb config variable name.

Cc Jan Kiszka <[email protected]>
Fixes 4e5ee5b21c84fe3023a64b5cc2e12a52ab0597c1

Message-id: [email protected]

---
 hw/usb/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/Makefile.objs +1 -1
index 9255234c63..0e6d54b21f 100644
@@ -42,7 +42,7 @@ redirect.o-cflags = $(USB_REDIR_CFLAGS)
 redirect.o-libs = $(USB_REDIR_LIBS)
 
 # usb pass-through
-ifeq ($(CONFIG_LIBUSB)$(CONFIG_USB),yy)
+ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy)
 common-obj-y += host-libusb.o host-legacy.o
 else
 common-obj-y += host-stub.o
Signature · 1 line
2.9.3
#3 lore raw

[Qemu-devel] [PULL 4/4] usb: fix host-stub.c build race

In reply to Gerd Hoffmann

Message-id: [email protected]

---
 hw/usb/Makefile.objs | 1 +
 1 file changed, 1 insertion(+)
hw/usb/Makefile.objs +1 -0
index 0e6d54b21f..bdfead6701 100644
@@ -47,6 +47,7 @@ common-obj-y += host-libusb.o host-legacy.o
 else
 common-obj-y += host-stub.o
 endif
+common-obj-$(CONFIG_ALL) += host-stub.o
 
 host-libusb.o-cflags := $(LIBUSB_CFLAGS)
 host-libusb.o-libs := $(LIBUSB_LIBS)
Signature · 1 line
2.9.3
#4 lore raw

[Qemu-devel] [PULL 1/4] hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple()

In reply to Gerd Hoffmann

From: Thomas Huth <[email protected]>

Valgrind detects an invalid read operation when hot-plugging of an USB device fails:

$ valgrind x86_64-softmmu/qemu-system-x86_64 -device usb-ehci -nographic -S
==30598== Memcheck, a memory error detector
==30598== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==30598== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==30598== Command: x86_64-softmmu/qemu-system-x86_64 -device usb-ehci -nographic -S
==30598==
QEMU 2.10.50 monitor - type 'help' for more information
(qemu) device_add usb-tablet
(qemu) device_add usb-tablet
(qemu) device_add usb-tablet
(qemu) device_add usb-tablet
(qemu) device_add usb-tablet
(qemu) device_add usb-tablet
==30598== Invalid read of size 8
==30598==    at 0x60EF50: object_unparent (object.c:445)
==30598==    by 0x580F0D: usb_try_create_simple (bus.c:346)
==30598==    by 0x581BEB: usb_claim_port (bus.c:451)
==30598==    by 0x582310: usb_qdev_realize (bus.c:257)
==30598==    by 0x4CB399: device_set_realized (qdev.c:914)
==30598==    by 0x60E26D: property_set_bool (object.c:1886)
==30598==    by 0x61235E: object_property_set_qobject (qom-qobject.c:27)
==30598==    by 0x61000F: object_property_set_bool (object.c:1162)
==30598==    by 0x4567C3: qdev_device_add (qdev-monitor.c:630)
==30598==    by 0x456D52: qmp_device_add (qdev-monitor.c:807)
==30598==    by 0x470A99: hmp_device_add (hmp.c:1933)
==30598==    by 0x3679C3: handle_hmp_command (monitor.c:3123)

The object_unparent() here is not necessary anymore since commit 69382d8b3e8600b3 ("qdev: Fix object reference leak in case device.realize() fails"), so let's remove it now.

Message-id: [email protected]

---
 hw/usb/bus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
hw/usb/bus.c +1 -3
index d910f849e7..e56dc3348a 100644
@@ -341,9 +341,7 @@ static USBDevice *usb_try_create_simple(USBBus *bus, const char *name,
     object_property_set_bool(OBJECT(dev), true, "realized", &err);
     if (err) {
         error_propagate(errp, err);
-        error_prepend(errp, "Failed to initialize USB device '%s': ",
-                      name);
-        object_unparent(OBJECT(dev));
+        error_prepend(errp, "Failed to initialize USB device '%s': ", name);
         return NULL;
     }
     return dev;
Signature · 1 line
2.9.3
#5 lore raw
In reply to Gerd Hoffmann
Quoted 24 lines · Gerd Hoffmann

The following changes since commit ab161529261928ae7f3556e3220829c34b2686ec:

Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20170927a' into staging (2017-09-27 22:44:51 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/usb-20171005-pull-request

for you to fetch changes up to eea6ae20379dca837631d603c3bed03e5128189f:

usb: fix host-stub.c build race (2017-10-05 11:03:25 +0200)

----------------------------------------------------------------
usb bugfixes.

----------------------------------------------------------------

Fam Zheng (1):
usb: Use angle brackets for cacard include directive

Gerd Hoffmann (2):
usb: fix libusb config variable name.
usb: fix host-stub.c build race

Quoted 7 lines

Thomas Huth (1):
hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple()

 hw/usb/bus.c                | 4 +---
 hw/usb/ccid-card-passthru.c | 2 +-
 hw/usb/Makefile.objs        | 3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)

Applied, thanks.

-- PMM