mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
usb-bus: Don't allow attaching a device to a bus with no free ports
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
adddecb169
commit
ee210d6390
1 changed files with 5 additions and 0 deletions
|
@ -181,6 +181,11 @@ static void do_attach(USBDevice *dev)
|
|||
dev->product_desc);
|
||||
return;
|
||||
}
|
||||
if (bus->nfree == 0) {
|
||||
fprintf(stderr, "Warning: tried to attach usb device %s to a bus with no free ports\n",
|
||||
dev->product_desc);
|
||||
return;
|
||||
}
|
||||
if (dev->port_path) {
|
||||
QTAILQ_FOREACH(port, &bus->free, next) {
|
||||
if (strcmp(port->path, dev->port_path) == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue