]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_nwfilter: Return early if net has no name in virDomainConfNWFilterTeardownImpl
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 9 Jul 2018 12:05:06 +0000 (14:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 9 Jul 2018 14:01:50 +0000 (16:01 +0200)
This function is called from various clean up paths (e.g.
from qemuBuildInterfaceCommandLine). However, depending on the
stage the interface creation process failed at, net->ifname might
still be not filled in when control jumps to cleanup label. If
that is the case return early (avoiding useless error message
produced in virNWFilterBindingLookupByPortDev) as there is no
NWFilter to tear down anyway.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/conf/domain_nwfilter.c

index 24b5f42ddd510a8f44b80fbfa52aa2bc4f6999d7..f39c8a1f9b556f68b6f58f938ca47f4dc71f3b07 100644 (file)
@@ -133,6 +133,9 @@ virDomainConfNWFilterTeardownImpl(virConnectPtr conn,
 {
     virNWFilterBindingPtr binding;
 
+    if (!net->ifname)
+        return;
+
     binding = virNWFilterBindingLookupByPortDev(conn, net->ifname);
     if (!binding)
         return;