Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Connect.xml | 5 +++++ src/connect.c | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml index 4a1ee4a..610dda7 100644 --- a/data/org.libvirt.Connect.xml +++ b/data/org.libvirt.Connect.xml @@ -195,6 +195,11 @@ <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#virNodeGetSecurityModel"/> + <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#virConnectDomainEventCallback"/> diff --git a/src/connect.c b/src/connect.c index 0ecb333..7495017 100644 --- a/src/connect.c +++ b/src/connect.c @@ -1009,6 +1009,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 }, @@ -1045,6 +1067,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = { { "NodeGetInfo", virtDBusConnectNodeGetInfo }, { "NodeGetMemoryParameters", virtDBusConnectNodeGetMemoryParameters }, { "NodeGetMemoryStats", virtDBusConnectNodeGetMemoryStats }, + { "NodeGetSecurityModel", virtDBusConnectNodeGetSecurityModel }, { 0 } }; -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list