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.
Signed-off-by Gerd Hoffmann <[email protected]>
--- usb-linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
usb-linux.c +2 -0
@@ -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 *phostdev_link (dev); +qdev_init (&d->qdev);return (USBDevice *) dev; fail:
Signature · 1 line
1.6.2.5
Luiz Capitulino
Tested-byQuoted 7 lines · On Fri, 25 Sep 2009 16:55:28 +0200 Gerd Hoffmann <[email protected]> wrote:
Changes:
* Re-add the 'dev->fd= fd;' line which the qdev patches dropped by mistake.
* callqdev_init()so the newly created usb device is plugged into a usb port and thus actually visible to the guest.Signed-off-by Gerd Hoffmann <[email protected]>
Simple tests work for me, thanks a lot Gerd.
Tested-by Luiz Capitulino <[email protected]>
Quoted 24 lines
--- usb-linux.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)usb-linux.c +2
-0@@ -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 *phostdev_link (dev); +qdev_init (&d->qdev);return (USBDevice *) dev; fail: