Signed-off-by: Anya Harter
---
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#virInterfaceCreate"/>
+
+ https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDestroy"/>
+
+
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)", );
+
+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
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list