提交 384504f7 编写于 作者: J Ján Tomko

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
上级 d6bc7622
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册