]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Check for user alias collisions in coldplug
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Apr 2019 13:33:34 +0000 (15:33 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Apr 2019 13:47:40 +0000 (15:47 +0200)
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 <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index 40fd8b9d2dfe294f00b9cbabd6c2a0f90a153a1b..c072bed1ce1a14617d1ca735a96ffd26bf383d25 100644 (file)
@@ -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)