[libvirt] [PATCH 4/4] qemu: Check for user alias collisions in coldplug

Michal Privoznik mprivozn at redhat.com
Fri Apr 26 13:52:23 UTC 2019


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 at redhat.com>
---
 src/qemu/qemu_driver.c | 4 ++++
 1 file changed, 4 insertions(+)

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)
-- 
2.21.0




More information about the libvir-list mailing list