From: Michal Privoznik Date: Thu, 14 Feb 2019 09:44:15 +0000 (+0100) Subject: qemu_hotplug: Assume chardev alias always exists in qemuDomainDetachChrDevice X-Git-Tag: v5.1.0-rc1~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5657e22212c54651a9e098ceb79c5522d55e0114;p=thirdparty%2Flibvirt.git qemu_hotplug: Assume chardev alias always exists in qemuDomainDetachChrDevice The @tmpChr is looked up in domain definition based on user provided chardev XML. Therefore, the alias must have been allocated already when domain was started up. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 60b393234a..a5c352f44b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6144,11 +6144,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, guestfwd = tmpChr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && tmpChr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD; - if (!tmpChr->info.alias && qemuAssignDeviceChrAlias(vmdef, tmpChr, -1) < 0) - goto cleanup; - - sa_assert(tmpChr->info.alias); - if (!async && !guestfwd) qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info);