mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Remove nwfilter tech driver 'removeRules' callback
The 'removeRules' callback in the nwfilter tech driver is never invoked, so can be deleted. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
293d4fe2f1
commit
9b8aef1a02
@ -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:
|
* ebiptablesAllTeardown:
|
||||||
* @ifname : the name of the interface to which the rules apply
|
* @ifname : the name of the interface to which the rules apply
|
||||||
@ -4143,7 +4104,6 @@ virNWFilterTechDriver ebiptables_driver = {
|
|||||||
.tearNewRules = ebiptablesTearNewRules,
|
.tearNewRules = ebiptablesTearNewRules,
|
||||||
.tearOldRules = ebiptablesTearOldRules,
|
.tearOldRules = ebiptablesTearOldRules,
|
||||||
.allTeardown = ebiptablesAllTeardown,
|
.allTeardown = ebiptablesAllTeardown,
|
||||||
.removeRules = ebiptablesRemoveRules,
|
|
||||||
.freeRuleInstance = ebiptablesFreeRuleInstance,
|
.freeRuleInstance = ebiptablesFreeRuleInstance,
|
||||||
.displayRuleInstance = ebiptablesDisplayRuleInstance,
|
.displayRuleInstance = ebiptablesDisplayRuleInstance,
|
||||||
|
|
||||||
|
@ -58,10 +58,6 @@ typedef int (*virNWFilterRuleTeardownNewRules)(const char *ifname);
|
|||||||
|
|
||||||
typedef int (*virNWFilterRuleTeardownOldRules)(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 (*virNWFilterRuleAllTeardown)(const char *ifname);
|
||||||
|
|
||||||
typedef int (*virNWFilterRuleFreeInstanceData)(void * _inst);
|
typedef int (*virNWFilterRuleFreeInstanceData)(void * _inst);
|
||||||
@ -97,7 +93,6 @@ struct _virNWFilterTechDriver {
|
|||||||
virNWFilterRuleApplyNewRules applyNewRules;
|
virNWFilterRuleApplyNewRules applyNewRules;
|
||||||
virNWFilterRuleTeardownNewRules tearNewRules;
|
virNWFilterRuleTeardownNewRules tearNewRules;
|
||||||
virNWFilterRuleTeardownOldRules tearOldRules;
|
virNWFilterRuleTeardownOldRules tearOldRules;
|
||||||
virNWFilterRuleRemoveRules removeRules;
|
|
||||||
virNWFilterRuleAllTeardown allTeardown;
|
virNWFilterRuleAllTeardown allTeardown;
|
||||||
virNWFilterRuleFreeInstanceData freeRuleInstance;
|
virNWFilterRuleFreeInstanceData freeRuleInstance;
|
||||||
virNWFilterRuleDisplayInstanceData displayRuleInstance;
|
virNWFilterRuleDisplayInstanceData displayRuleInstance;
|
||||||
|
Loading…
Reference in New Issue
Block a user