From: Michal Privoznik Date: Fri, 26 Apr 2019 13:33:34 +0000 (+0200) Subject: qemu: Check for user alias collisions in coldplug X-Git-Tag: v5.3.0-rc2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=572c50849c649c3d7586df01a3a0069b6d1a32af;p=thirdparty%2Flibvirt.git qemu: Check for user alias collisions in coldplug https://bugzilla.redhat.com/show_bug.cgi?id=1697676 If an user tries to attach a device with colliding user alias then we attach it happily and thus leave domain unable to start. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 40fd8b9d2d..c072bed1ce 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8647,6 +8647,10 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm, driver->xmlopt, parse_flags))) goto cleanup; + if (virDomainDeviceValidateAliasForHotplug(vm, devConf, + VIR_DOMAIN_AFFECT_CONFIG) < 0) + goto cleanup; + if (virDomainDefCompatibleDevice(vmdef, devConf, NULL, VIR_DOMAIN_DEVICE_ACTION_ATTACH, false) < 0)