mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
Introduce an object for managing firewall rulesets
The network and nwfilter drivers both have a need to update firewall rules. The currently share no code for interacting with iptables / firewalld. The nwfilter driver is fairly tied to the concept of creating shell scripts to execute which makes it very hard to port to talk to firewalld via DBus APIs. This patch introduces a virFirewallPtr object which is able to represent a complete sequence of rule changes, with the ability to have multiple transactional checkpoints with rollbacks. By formally separating the definition of the rules to be applied from the mechanism used to apply them, it is also possible to write a firewall engine that uses firewalld DBus APIs natively instead of via the slow firewalld-cmd. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
+14
-4
@@ -459,10 +459,20 @@ int virtTestDifference(FILE *stream,
|
||||
const char *expect,
|
||||
const char *actual)
|
||||
{
|
||||
const char *expectStart = expect;
|
||||
const char *expectEnd = expect + (strlen(expect)-1);
|
||||
const char *actualStart = actual;
|
||||
const char *actualEnd = actual + (strlen(actual)-1);
|
||||
const char *expectStart;
|
||||
const char *expectEnd;
|
||||
const char *actualStart;
|
||||
const char *actualEnd;
|
||||
|
||||
if (!expect)
|
||||
expect = "";
|
||||
if (!actual)
|
||||
actual = "";
|
||||
|
||||
expectStart = expect;
|
||||
expectEnd = expect + (strlen(expect)-1);
|
||||
actualStart = actual;
|
||||
actualEnd = actual + (strlen(actual)-1);
|
||||
|
||||
if (!virTestGetDebug())
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user