Signed-off-by: Anya Harter <aharter(a)redhat.com>
---
data/org.libvirt.Interface.xml | 5 +++++
src/interface.c | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/data/org.libvirt.Interface.xml b/data/org.libvirt.Interface.xml
index d98a646..f5ec281 100644
--- a/data/org.libvirt.Interface.xml
+++ b/data/org.libvirt.Interface.xml
@@ -8,5 +8,10 @@
value="See
https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceCreat...
<arg name="flags" type="u" direction="in"/>
</method>
+ <method name="Destroy">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDestr...
+ <arg name="flags" type="u" direction="in"/>
+ </method>
</interface>
</node>
diff --git a/src/interface.c b/src/interface.c
index 4a5e431..077b10d 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -47,12 +47,36 @@ virtDBusInterfaceCreate(GVariant *inArgs,
virtDBusUtilSetLastVirtError(error);
}
+static void
+virtDBusInterfaceDestroy(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virInterface) interface = NULL;
+ guint flags;
+
+ g_variant_get(inArgs, "(u)", &flags);
+
+ interface = virtDBusInterfaceGetVirInterface(connect, objectPath, error);
+ if (!interface)
+ return;
+
+ if (virInterfaceDestroy(interface, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] = {
{ 0 }
};
static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] = {
{ "Create", virtDBusInterfaceCreate },
+ { "Destroy", virtDBusInterfaceDestroy },
{ 0 }
};
--
2.17.1