Re: [libvirt] [PATCH 5/6] Fix crash on usb-serial hotplug

2016-10-25 Thread John Ferlan


On 10/21/2016 09:58 AM, Ján Tomko wrote:
> 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
> ---
>  src/qemu/qemu_hotplug.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

ACK

John

Yet another case where ATTRIBUTE_NONNULL(#arg) doesn't really work if
the passed argument is assigned to NULL  (as opposed to the checks
made if someone passed 'NULL' in the argument.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 5/6] Fix crash on usb-serial hotplug

2016-10-21 Thread Ján Tomko
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
---
 src/qemu/qemu_hotplug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 407ae73..9e9073d 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1652,7 +1652,8 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainDefPtr def,
 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) {
 if (virDomainUSBAddressEnsure(priv->usbaddrs, >info) < 0)
 return -1;
-- 
2.7.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list