[libvirt] [PATCH v2 5.3/16] network: Unconditionally initialize macmap when stopping virtual network

John Ferlan posted 1 patch 6 years, 8 months ago
Failed in applying to current master (apply log)
src/conf/virnetworkobj.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH v2 5.3/16] network: Unconditionally initialize macmap when stopping virtual network
Posted by John Ferlan 6 years, 8 months ago
Since we can only ever have one reference to obj->macmap, rather
than only clearing obj->macmap during virNetworkObjUnrefMacMap
(e.g. virtual network from networkShutdownNetwork), let's just
unconditionally clear the obj->macmap to ensure that some future
change that created it's own reference to obj->macmap wouldn't
have that reference disappear if virNetworkObjDispose got called.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/conf/virnetworkobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c
index 5578ac3..bb7225c 100644
--- a/src/conf/virnetworkobj.c
+++ b/src/conf/virnetworkobj.c
@@ -125,8 +125,8 @@ virNetworkObjSetMacMap(virNetworkObjPtr obj,
 void
 virNetworkObjUnrefMacMap(virNetworkObjPtr obj)
 {
-    if (!virObjectUnref(obj->macmap))
-        obj->macmap = NULL;
+    virObjectUnref(obj->macmap);
+    obj->macmap = NULL;
 }
 
 
-- 
2.9.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list