mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: assign USB port on a selected hub for all devices
Due to a logic error, the autofilling of USB port when a bus is specified: <address type='usb' bus='0'/> does not work for non-hub devices on domain startup. Fix the logic in qemuDomainAssignUSBPortsIterator to also assign ports for USB addresses that do not yet have one. https://bugzilla.redhat.com/show_bug.cgi?id=1374128
This commit is contained in:
parent
d6bc7622f0
commit
384504f7ba
@ -2238,7 +2238,12 @@ qemuDomainAssignUSBPortsIterator(virDomainDeviceInfoPtr info,
|
||||
{
|
||||
struct qemuAssignUSBIteratorInfo *data = opaque;
|
||||
|
||||
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
|
||||
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
||||
info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB)
|
||||
return 0;
|
||||
|
||||
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB &&
|
||||
virDomainUSBAddressPortIsValid(info->addr.usb.port))
|
||||
return 0;
|
||||
|
||||
return virDomainUSBAddressAssign(data->addrs, info);
|
||||
|
@ -22,5 +22,5 @@ server,nowait \
|
||||
-usb \
|
||||
-device usb-hub,id=hub0,bus=usb.0,port=1 \
|
||||
-device usb-hub,id=hub1,bus=usb.0,port=2 \
|
||||
-device usb-mouse,id=input0,bus=usb.0 \
|
||||
-device usb-mouse,id=input0,bus=usb.0,port=1.1 \
|
||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
||||
|
Loading…
x
Reference in New Issue
Block a user