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 <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
Gerd Hoffmann 2009-09-25 16:55:28 +02:00 committed by Aurelien Jarno
parent befb031654
commit 22f84e73d8

View File

@ -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->bus_num = bus_num;
dev->addr = addr; dev->addr = addr;
dev->fd = fd;
/* read the device description */ /* read the device description */
dev->descr_len = read(fd, dev->descr, sizeof(dev->descr)); 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); hostdev_link(dev);
qdev_init(&d->qdev);
return (USBDevice *) dev; return (USBDevice *) dev;
fail: fail: