]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Remove nwfilter tech driver 'removeRules' callback
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 24 Mar 2014 17:05:42 +0000 (17:05 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 25 Apr 2014 14:44:09 +0000 (15:44 +0100)
The 'removeRules' callback in the nwfilter tech driver is never
invoked, so can be deleted.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/nwfilter/nwfilter_ebiptables_driver.c
src/nwfilter/nwfilter_tech_driver.h

index 4365c1f20afc3ef0bfb6db7a3b86e0d64594eece..1dabe52d0b12810ef959abf1309c5b546a390400 100644 (file)
@@ -4045,45 +4045,6 @@ ebiptablesTearOldRules(const char *ifname)
 }
 
 
-/**
- * ebiptablesRemoveRules:
- * @ifname : the name of the interface to which the rules apply
- * @nRuleInstance : the number of given rules
- * @_inst : array of rule instantiation data
- *
- * Remove all rules one after the other
- *
- * Return 0 on success, -1 if execution of one or more cleanup
- * commands failed.
- */
-static int
-ebiptablesRemoveRules(const char *ifname ATTRIBUTE_UNUSED,
-                      int nruleInstances,
-                      void **_inst)
-{
-    int rc = -1;
-    size_t i;
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
-    ebiptablesRuleInstPtr *inst = (ebiptablesRuleInstPtr *)_inst;
-
-    NWFILTER_SET_EBTABLES_SHELLVAR(&buf);
-
-    for (i = 0; i < nruleInstances; i++)
-        ebiptablesInstCommand(&buf,
-                              inst[i]->commandTemplate,
-                              'D', -1,
-                              false);
-
-    if (ebiptablesExecCLI(&buf, true, NULL) < 0)
-        goto cleanup;
-
-    rc = 0;
-
- cleanup:
-    return rc;
-}
-
-
 /**
  * ebiptablesAllTeardown:
  * @ifname : the name of the interface to which the rules apply
@@ -4143,7 +4104,6 @@ virNWFilterTechDriver ebiptables_driver = {
     .tearNewRules        = ebiptablesTearNewRules,
     .tearOldRules        = ebiptablesTearOldRules,
     .allTeardown         = ebiptablesAllTeardown,
-    .removeRules         = ebiptablesRemoveRules,
     .freeRuleInstance    = ebiptablesFreeRuleInstance,
     .displayRuleInstance = ebiptablesDisplayRuleInstance,
 
index 03588e214366f450819d5e8ec94ec3024829566a..d1c85b4f5cc4ef100856c3caa4e59b7ecbbec922 100644 (file)
@@ -58,10 +58,6 @@ typedef int (*virNWFilterRuleTeardownNewRules)(const char *ifname);
 
 typedef int (*virNWFilterRuleTeardownOldRules)(const char *ifname);
 
-typedef int (*virNWFilterRuleRemoveRules)(const char *ifname,
-                                          int nruleInstances,
-                                          void **_inst);
-
 typedef int (*virNWFilterRuleAllTeardown)(const char *ifname);
 
 typedef int (*virNWFilterRuleFreeInstanceData)(void * _inst);
@@ -97,7 +93,6 @@ struct _virNWFilterTechDriver {
     virNWFilterRuleApplyNewRules applyNewRules;
     virNWFilterRuleTeardownNewRules tearNewRules;
     virNWFilterRuleTeardownOldRules tearOldRules;
-    virNWFilterRuleRemoveRules removeRules;
     virNWFilterRuleAllTeardown allTeardown;
     virNWFilterRuleFreeInstanceData freeRuleInstance;
     virNWFilterRuleDisplayInstanceData displayRuleInstance;