From: Ján Tomko Date: Fri, 21 Oct 2016 12:23:54 +0000 (+0200) Subject: Fix crash on usb-serial hotplug X-Git-Tag: v2.2.1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d34d093218d7ddf8e16321ace69cc9234f3691f;p=thirdparty%2Flibvirt.git 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 (cherry picked from commit 00c5386c8622514553c41041312acf0ea86278d7) --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d67dd926ac..2132bbf084 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1608,7 +1608,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainDefPtr def, goto cleanup; ret = 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) { if (virDomainUSBAddressEnsure(priv->usbaddrs, &chr->info) < 0) goto cleanup;