render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
27b6f9
From 3860c41885fc2365dd10559dbc6c721265673a36 Mon Sep 17 00:00:00 2001
27b6f9
Message-Id: <3860c41885fc2365dd10559dbc6c721265673a36@dist-git>
27b6f9
From: Michal Privoznik <mprivozn@redhat.com>
27b6f9
Date: Wed, 14 Mar 2018 08:18:44 +0100
27b6f9
Subject: [PATCH] conf: Check for user aliases duplicates only
27b6f9
27b6f9
RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1553162
27b6f9
RHEL-7.5.z: https://bugzilla.redhat.com/show_bug.cgi?id=1554962
27b6f9
27b6f9
When validating a device XML config we check if user provided
27b6f9
alias is unique. We do this by maintaining a hash table of device
27b6f9
aliases as we iterated over all devices defined for the domain.
27b6f9
However, it may happen that what appears as two devices in domain
27b6f9
XML is in fact just one interface in hypervisor.  We can assume
27b6f9
libvirt generated aliases to be unique and thus really check user
27b6f9
provided ones only.
27b6f9
27b6f9
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
27b6f9
(cherry picked from commit e43263601fe27feb8d005668528f35f75428b8c6)
27b6f9
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
27b6f9
---
27b6f9
 src/conf/domain_conf.c | 2 +-
27b6f9
 1 file changed, 1 insertion(+), 1 deletion(-)
27b6f9
27b6f9
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
27b6f9
index c746ab19cd..a0c0702a6c 100644
27b6f9
--- a/src/conf/domain_conf.c
27b6f9
+++ b/src/conf/domain_conf.c
27b6f9
@@ -5560,7 +5560,7 @@ virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def,
27b6f9
     struct virDomainDefValidateAliasesData *data = opaque;
27b6f9
     const char *alias = info->alias;
27b6f9
 
27b6f9
-    if (!alias)
27b6f9
+    if (!alias || !virDomainDeviceAliasIsUserAlias(alias))
27b6f9
         return 0;
27b6f9
 
27b6f9
     /* Some crazy backcompat for consoles. */
27b6f9
-- 
27b6f9
2.16.2
27b6f9