]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: match by network alias only if aliases are assigned
authorJán Tomko <jtomko@redhat.com>
Thu, 18 Nov 2021 15:21:27 +0000 (16:21 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 19 Nov 2021 13:06:17 +0000 (14:06 +0100)
Commit 114e3b423210d316b3326816fd2c33335b1167fe added matching by
aliases for interfaces with same MAC address.
( https://bugzilla.redhat.com/show_bug.cgi?id=1926190 )

However, unless the domain is using user aliases (prefixed ua-),
there are no aliases in the persistent definition.

Only match by MAC/PCI/other addresses in that case, to fix update-device
with --persistent flag (AFFECT_LIVE | AFFECT_CONFIG).

https://bugzilla.redhat.com/show_bug.cgi?id=2024098

Fixes: 114e3b423210d316b3326816fd2c33335b1167fe
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/conf/domain_conf.c

index 7231d8fc3f4e8f86e1baba6e2fd2595e201500dd..deb32b3f6b6edd09e48744fd749f833dda8e3c2e 100644 (file)
@@ -15770,8 +15770,8 @@ virDomainNetFindIdx(virDomainDef *def, virDomainNetDef *net)
                                             &net->info.addr.ccw))
             continue;
 
-        if (net->info.alias &&
-            STRNEQ_NULLABLE(def->nets[i]->info.alias, net->info.alias)) {
+        if (net->info.alias && def->nets[i]->info.alias &&
+            STRNEQ(def->nets[i]->info.alias, net->info.alias)) {
             continue;
         }