Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Connect.xml | 6 ++++++
src/connect.c | 23 +++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index abb2dbc..fc306be 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -203,6 +203,12 @@
<arg name="flags" type="u" direction="in"/>
<arg name="stats" type="a{st}"
direction="out"/>
</method>
+ <method name="NodeGetSecurityModel">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-host.html#virNodeGetSecurityMode...
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="secModel" type="(ss)"
direction="out"/>
+ </method>
<signal name="DomainEvent">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven...
diff --git a/src/connect.c b/src/connect.c
index 27355d3..32aa07d 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -1044,6 +1044,28 @@ virtDBusConnectNodeGetMemoryStats(GVariant *inArgs,
*outArgs = g_variant_new_tuple(&res, 1);
}
+static void
+virtDBusConnectNodeGetSecurityModel(GVariant *inArgs G_GNUC_UNUSED,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath G_GNUC_UNUSED,
+ gpointer userData,
+ GVariant **outArgs,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+
+{
+ virtDBusConnect *connect = userData;
+ virSecurityModel secmodel;
+
+ if (!virtDBusConnectOpen(connect, error))
+ return;
+
+ if (virNodeGetSecurityModel(connect->connection, &secmodel) < 0)
+ return virtDBusUtilSetLastVirtError(error);
+
+ *outArgs = g_variant_new("((ss))", secmodel.model, secmodel.doi);
+}
+
static virtDBusGDBusPropertyTable virtDBusConnectPropertyTable[] = {
{ "Encrypted", virtDBusConnectGetEncrypted, NULL },
{ "Hostname", virtDBusConnectGetHostname, NULL },
@@ -1081,6 +1103,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
{ "NodeGetInfo", virtDBusConnectNodeGetInfo },
{ "NodeGetMemoryParameters", virtDBusConnectNodeGetMemoryParameters },
{ "NodeGetMemoryStats", virtDBusConnectNodeGetMemoryStats },
+ { "NodeGetSecurityModel", virtDBusConnectNodeGetSecurityModel },
{ 0 }
};
--
2.15.0