Commit 50d3e1be authored by Anya Harter's avatar Anya Harter Committed by Katerina Koukiou

Implement Destroy method for Interface Interface

Signed-off-by: 's avatarAnya Harter <aharter@redhat.com>
Reviewed-by: 's avatarJán Tomko <jtomko@redhat.com>
parent 5ebe0351
......@@ -8,5 +8,10 @@
value="See https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceCreate"/>
<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#virInterfaceDestroy"/>
<arg name="flags" type="u" direction="in"/>
</method>
</interface>
</node>
......@@ -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 }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment