[PATCH v2 00/13] Multiple cleanups within nwfilterobj and nwfilter drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



v1: https://www.redhat.com/archives/libvir-list/2017-April/msg01074.html

Changes since v1:

 * Patch 2 -> Do not add the local @def when just dereference obj->def

 * Patch 13 & 15 dropped

Most patches were ACK'd, but patch 2's impact was felt in a few other
patches so I just resent the whole thing. In particular patch 5 for
nwfilterUndefine and nwfilterGetXMLDesc as well as patch 7 for the
_virNWFilterObjListDefLoopDetect call w/ _virNWFilterObjListDefLoopDetect


John Ferlan (13):
  nwfilter: Use consistent naming for variables
  nwfilter: Use virNWFilterDefPtr rather than deref virNWFilterObjPtr
  nwfilter: Remove unused 'active' in virNWFilterObj
  nwfilter: Convert wantRemoved to bool
  nwfilter: Make _virNWFilterObjPtr private
  nwfilter: Introduce virNWFilterObjNew
  nwfilter: Rename some virNWFilterObj* API's
  nwfilter: Make _virNWFilterObjList private
  nwfilter: Make a common UUID lookup function from driver
  nwfilter: Replace virNWFilterConfigFile with virFileBuildPath
  nwfilter: Replace virNWFilterSaveDef with virNWFilterSaveConfig
  nwfilter: Move creation of configDir to driver initialization
  nwfilter: Move save of config until after successful assign

 src/conf/nwfilter_conf.c               |  57 +------
 src/conf/nwfilter_conf.h               |   8 -
 src/conf/virnwfilterobj.c              | 270 +++++++++++++++++++++------------
 src/conf/virnwfilterobj.h              |  70 ++++-----
 src/libvirt_private.syms               |  20 ++-
 src/nwfilter/nwfilter_driver.c         | 138 ++++++++++-------
 src/nwfilter/nwfilter_gentech_driver.c |  42 ++---
 7 files changed, 320 insertions(+), 285 deletions(-)

-- 
2.9.3


FWIW: The diffs between this series and the previous taking away patches 13/15:


diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c
index 62206b8..8c9da13 100644
--- a/src/conf/virnwfilterobj.c
+++ b/src/conf/virnwfilterobj.c
@@ -92,16 +92,11 @@ virNWFilterObjWantRemoved(virNWFilterObjPtr obj)
 static void
 virNWFilterObjFree(virNWFilterObjPtr obj)
 {
-    virNWFilterDefPtr def;
-    virNWFilterDefPtr newDef;
-
     if (!obj)
         return;
-    def = obj->def;
-    newDef = obj->newDef;
 
-    virNWFilterDefFree(def);
-    virNWFilterDefFree(newDef);
+    virNWFilterDefFree(obj->def);
+    virNWFilterDefFree(obj->newDef);
 
     virMutexDestroy(&obj->lock);
 
@@ -204,7 +199,6 @@ _virNWFilterObjListDefLoopDetect(virNWFilterObjListPtr nwfilters,
     size_t i;
     virNWFilterEntryPtr entry;
     virNWFilterObjPtr obj;
-    virNWFilterDefPtr objdef;
 
     if (!def)
         return 0;
@@ -221,8 +215,7 @@ _virNWFilterObjListDefLoopDetect(virNWFilterObjListPtr nwfilters,
             obj = virNWFilterObjListFindByName(nwfilters,
                                                entry->include->filterref);
             if (obj) {
-                objdef = obj->def;
-                rc = _virNWFilterObjListDefLoopDetect(nwfilters, objdef,
+                rc = _virNWFilterObjListDefLoopDetect(nwfilters, obj->def,
                                                       filtername);
                 virNWFilterObjUnlock(obj);
                 if (rc < 0)
@@ -386,13 +379,11 @@ virNWFilterObjListNumOfNWFilters(virNWFilterObjListPtr nwfilters,
 {
     size_t i;
     int nfilters = 0;
-    virNWFilterDefPtr def;
 
     for (i = 0; i < nwfilters->count; i++) {
         virNWFilterObjPtr obj = nwfilters->objs[i];
         virNWFilterObjLock(obj);
-        def = obj->def;
-        if (!aclfilter || aclfilter(conn, def))
+        if (!aclfilter || aclfilter(conn, obj->def))
             nfilters++;
         virNWFilterObjUnlock(obj);
     }

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux