Skip to contentSkip to conversation

BUG: 0.14.0 -device usb-host supports only one device

Qemu-devel Erik Rull 3 participants 6 messages Mar 23, 2011 – May 17, 2011

lore
Share & tools
lore

Erik Rull

author
#0 lore raw

When enabling the -device usb-host option support for adding automatically USB devices from the host to the guest, only one device gets detected. It does not matter if it is added via commandline or via device_add on the qemu console.

Curious: If a second devices is plugged into the host, nothing happens in qemu. But on the host, the device is detected. If the first device is removed, the second device gets detected by qemu. If then the first device is added again, it gets not detected by qemu until the second device is removed and so on.

When adding the devices manually, everything is fine.
Confirmed with and without the ehci-patch on qemu-kvm 0.14.0. I first sent the report to the kvm list but it seems to be a pure qemu related issue.

Best regards,

Erik

author
#1 lore raw

No idea how to start here?
If someone could assist me where to start and what information to collect, I could help debugging and finding a solution for that.

Best regards,

Erik

Quoted 21 lines · Erik Rull

When enabling the -device usb-host option support for adding automatically USB devices from the host to the guest, only one device gets detected.
It does not matter if it is added via commandline or via device_add on the qemu console.

Curious: If a second devices is plugged into the host, nothing happens in qemu. But on the host, the device is detected. If the first device is removed, the second device gets detected by qemu. If then the first device is added again, it gets not detected by qemu until the second device is removed and so on.

When adding the devices manually, everything is fine. Confirmed with and without the ehci-patch on qemu-kvm 0.14.0. I first sent the report to the kvm list but it seems to be a pure qemu related issue.

Best regards,

Erik

#2 lore raw

Hi all,

does nobody else struggle with this bug? I would like to help, but don't know where to start!

Best regards,

Erik

Quoted 33 lines · Erik Rull

No idea how to start here?
If someone could assist me where to start and what information to collect, I could help debugging and finding a solution for that.

Best regards,

Erik

Quoted 21 lines · Erik Rull

When enabling the -device usb-host option support for adding automatically USB devices from the host to the guest, only one device gets detected.
It does not matter if it is added via commandline or via device_add on the qemu console.

Curious: If a second devices is plugged into the host, nothing happens in qemu. But on the host, the device is detected. If the first device is removed, the second device gets detected by qemu. If then the first device is added again, it gets not detected by qemu until the second device is removed and so on.

When adding the devices manually, everything is fine. Confirmed with and without the ehci-patch on qemu-kvm 0.14.0. I first sent the report to the kvm list but it seems to be a pure qemu related issue.

Best regards,

Erik

#3 lore raw

Hi,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

When enabling the -device usb-host option support for adding automatically USB devices from the host to the guest, only one device gets detected.

Yes. -device usb-host creates a *single* virtual usb device instance. When a matching device on the host is found the virtual device is plugged in, otherwise it is plugged out. In plugged out state qemu looks now and then (every two seconds IIRC) whenever a matching device was plugged into the host.

Try -device usb-host twice if you need two virtual usb devices.

cheers,
Gerd

author
#4 lore raw
Quoted 12 lines · Gerd Hoffmann

Hi,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

When enabling the -device usb-host option support for adding automatically USB devices from the host to the guest, only one device gets detected.

Yes. -device usb-host creates a *single* virtual usb device instance. When a matching device on the host is found the virtual device is plugged in, otherwise it is plugged out. In plugged out state qemu looks now and then (every two seconds IIRC) whenever a matching device was plugged into the host.

Quoted 4 lines

Try -device usb-host twice if you need two virtual usb devices.

cheers,
Gerd

Hi Gerd,

hm, if I add it multiple times and plug in a USB flashdrive, then all slots are filled up with this device (duplicated)... And Windows detects them with the result, that the "not first" devices are marked with a yellow exclamation mark in the device manager. And the next device plugged in gets then not detected because all preallocated slots are full :-(

Any ideas?

Best regards,

Erik

#5 lore raw
Quoted 10 lines

Hi Gerd,

hm, if I add it multiple times and plug in a USB flashdrive, then all slots are filled up with this device (duplicated)...
And Windows detects them with the result, that the "not first" devices are marked with a yellow exclamation mark in the device manager. And the next device plugged in gets then not detected because all preallocated slots are full :-(

Any ideas?

The upcoming usb patches will add the option to assign devices by physical host port, that is probably the best solution for the issue.

I don't have an idea offhand for stable-0.14 though.

cheers,
Gerd