mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
Fix crash on usb-serial hotplug
For domains with no USB address cache, we should not attempt to generate a USB address. https://bugzilla.redhat.com/show_bug.cgi?id=1387665
This commit is contained in:
parent
c11586940c
commit
00c5386c86
@ -1775,7 +1775,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm,
|
|||||||
return -1;
|
return -1;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} else if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
|
} else if (priv->usbaddrs &&
|
||||||
|
chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
|
||||||
chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB) {
|
chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB) {
|
||||||
if (virDomainUSBAddressEnsure(priv->usbaddrs, &chr->info) < 0)
|
if (virDomainUSBAddressEnsure(priv->usbaddrs, &chr->info) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user