util: pass layer into firewall query callback

Some of the query callbacks want to know the firewall layer that was
being used for triggering the query to avoid duplicating that data.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2018-12-04 16:33:28 +00:00
parent 0fc746aa54
commit b092a4357d
4 changed files with 14 additions and 9 deletions

View File

@@ -990,11 +990,12 @@ testFirewallQueryHook(const char *const*args,
static int
testFirewallQueryCallback(virFirewallPtr fw,
virFirewallLayer layer,
const char *const *lines,
void *opaque ATTRIBUTE_UNUSED)
{
size_t i;
virFirewallAddRule(fw, VIR_FIREWALL_LAYER_IPV4,
virFirewallAddRule(fw, layer,
"-A", "INPUT",
"--source-host", "!192.168.122.129",
"--jump", "REJECT", NULL);