Skip to contentSkip to conversation

unbreak usb pass-through on linux.

PATCH In review Gerd Hoffmann 2 participants 2 messages Sep 25, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unbreak usb pass-through on linux.

Changes:
* Re-add the 'dev->fd = fd;' line which the qdev patches dropped by mistake.
* call qdev_init() so the newly created usb device is plugged into a usb port and thus actually visible to the guest.

---
 usb-linux.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
usb-linux.c +2 -0
index c434e4f..2b7b092 100644
@@ -922,6 +922,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
 
     dev->bus_num = bus_num;
     dev->addr = addr;
+    dev->fd = fd;
 
     /* read the device description */
     dev->descr_len = read(fd, dev->descr, sizeof(dev->descr));
@@ -979,6 +980,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
 
     hostdev_link(dev);
 
+    qdev_init(&d->qdev);
     return (USBDevice *) dev;
 
 fail:
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 8 lines · Gerd Hoffmann

Changes:
* Re-add the 'dev->fd = fd;' line which the qdev patches dropped by mistake.
* call qdev_init() so the newly created usb device is plugged into a usb port and thus actually visible to the guest.

---
 usb-linux.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Good work. A SoB is missing though.

Quoted 26 lines
usb-linux.c +2 -0
index c434e4f..2b7b092 100644
@@ -922,6 +922,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
 
     dev->bus_num = bus_num;
     dev->addr = addr;
+    dev->fd = fd;
 
     /* read the device description */
     dev->descr_len = read(fd, dev->descr, sizeof(dev->descr));
@@ -979,6 +980,7 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
 
     hostdev_link(dev);
 
+    qdev_init(&d->qdev);
     return (USBDevice *) dev;
 
 fail:
Signature · 1 line
1.6.2.5
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net