On Sun, Apr 30, 2023 at 11:19:17PM -0400, Laine Stump wrote:
We will need access to these attributes of the object from outside
virfirewall.c.
I think this is not desirable. It is caused by the movement of
part of virfirewall functionality into viriptables.c and the
new virnftables.c. This movement creates the circular
dependancy and need to access private data.
The parts that are placed in virnftables.c / viriptbles.c are
quite small and thus I think they could easily remain in the
virfirewall.c file, avoiding the circular dep
Signed-off-by: Laine Stump <laine(a)redhat.com>
---
src/libvirt_private.syms | 3 +++
src/util/virfirewall.c | 30 ++++++++++++++++++++++++++++++
src/util/virfirewall.h | 10 ++++++++++
3 files changed, 43 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1247b67a39..73cccf38a1 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2380,7 +2380,10 @@ virFirewallRuleAddArg;
virFirewallRuleAddArgFormat;
virFirewallRuleAddArgList;
virFirewallRuleAddArgSet;
+virFirewallRuleGetArg;
virFirewallRuleGetArgCount;
+virFirewallRuleGetIgnoreErrors;
+virFirewallRuleGetLayer;
virFirewallRuleToString;
virFirewallStartRollback;
virFirewallStartTransaction;
diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index e8e74621c8..15c8db3702 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -388,6 +388,36 @@ size_t virFirewallRuleGetArgCount(virFirewallRule *rule)
}
+const char *
+virFirewallRuleGetArg(virFirewallRule *rule,
+ int index)
+{
+ if (!rule || rule->argsLen <= index)
+ return NULL;
+ return rule->args[index];
+}
+
+
+virFirewallLayer
+virFirewallRuleGetLayer(virFirewallRule *rule)
+{
+ if (!rule)
+ return VIR_FIREWALL_LAYER_LAST;
+
+ return rule->layer;
+}
+
+
+bool
+virFirewallRuleGetIgnoreErrors(virFirewallRule *rule)
+{
+ if (!rule)
+ return false;
+
+ return rule->ignoreErrors;
+}
+
+
/**
* virFirewallStartTransaction:
* @firewall: the firewall ruleset
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index 187748b2bf..0f40dae859 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -89,6 +89,16 @@ void virFirewallRuleAddArgList(virFirewall *firewall,
size_t virFirewallRuleGetArgCount(virFirewallRule *rule);
+const char *
+virFirewallRuleGetArg(virFirewallRule *rule,
+ int index);
+
+virFirewallLayer
+virFirewallRuleGetLayer(virFirewallRule *rule);
+
+bool
+virFirewallRuleGetIgnoreErrors(virFirewallRule *rule);
+
char *virFirewallRuleToString(const char *cmd,
virFirewallRule *rule);
--
2.39.2
With regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|