[PATCH 2/6] nwfilter: add nwfilterDefineXMLFlags()

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

 



I have added a new driver function which allows to define
nwfilter with given flags. I have also replaced definition of
nwfilterDefineXML() with function call to the new function.

Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx>
---
 src/nwfilter/nwfilter_driver.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index edb284aa4b..4b355ffff1 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -525,9 +525,11 @@ nwfilterConnectListAllNWFilters(virConnectPtr conn,
     return ret;
 }
 
+
 static virNWFilterPtr
-nwfilterDefineXML(virConnectPtr conn,
-                  const char *xml)
+nwfilterDefineXMLFlags(virConnectPtr conn,
+                       const char *xml,
+                       unsigned int flags)
 {
     virNWFilterDef *def;
     virNWFilterObj *obj = NULL;
@@ -540,13 +542,15 @@ nwfilterDefineXML(virConnectPtr conn,
         return NULL;
     }
 
+    virCheckFlags(0, NULL);
+
     nwfilterDriverLock();
     virNWFilterWriteLockFilterUpdates();
 
     if (!(def = virNWFilterDefParseString(xml)))
         goto cleanup;
 
-    if (virNWFilterDefineXMLEnsureACL(conn, def) < 0)
+    if (virNWFilterDefineXMLFlagsEnsureACL(conn, def) < 0)
         goto cleanup;
 
     if (!(obj = virNWFilterObjListAssignDef(driver->nwfilters, def)))
@@ -572,6 +576,14 @@ nwfilterDefineXML(virConnectPtr conn,
 }
 
 
+static virNWFilterPtr
+nwfilterDefineXML(virConnectPtr conn,
+                  const char *xml)
+{
+    return nwfilterDefineXMLFlags(conn, xml, 0);
+}
+
+
 static int
 nwfilterUndefine(virNWFilterPtr nwfilter)
 {
@@ -809,6 +821,7 @@ static virNWFilterDriver nwfilterDriver = {
     .nwfilterLookupByName = nwfilterLookupByName, /* 0.8.0 */
     .nwfilterLookupByUUID = nwfilterLookupByUUID, /* 0.8.0 */
     .nwfilterDefineXML = nwfilterDefineXML, /* 0.8.0 */
+    .nwfilterDefineXMLFlags = nwfilterDefineXMLFlags, /* 7.7.0 */
     .nwfilterUndefine = nwfilterUndefine, /* 0.8.0 */
     .nwfilterGetXMLDesc = nwfilterGetXMLDesc, /* 0.8.0 */
     .nwfilterBindingLookupByPortDev = nwfilterBindingLookupByPortDev, /* 4.5.0 */
-- 
2.31.1




[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