Commit de0d09e7 authored by Anya Harter's avatar Anya Harter Committed by Katerina Koukiou

Implement Undefine method for Interface Interface

Signed-off-by: 's avatarAnya Harter <aharter@redhat.com>
Reviewed-by: 's avatarKaterina Koukiou <kkoukiou@redhat.com>
parent 302332cf
......@@ -13,5 +13,9 @@
value="See https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDestroy"/>
<arg name="flags" type="u" direction="in"/>
</method>
<method name="Undefine">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceUndefine"/>
</method>
</interface>
</node>
......@@ -70,6 +70,26 @@ virtDBusInterfaceDestroy(GVariant *inArgs,
virtDBusUtilSetLastVirtError(error);
}
static void
virtDBusInterfaceUndefine(GVariant *inArgs G_GNUC_UNUSED,
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;
interface = virtDBusInterfaceGetVirInterface(connect, objectPath, error);
if (!interface)
return;
if (virInterfaceUndefine(interface) < 0)
virtDBusUtilSetLastVirtError(error);
}
static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] = {
{ 0 }
};
......@@ -77,6 +97,7 @@ static virtDBusGDBusPropertyTable virtDBusInterfacePropertyTable[] = {
static virtDBusGDBusMethodTable virtDBusInterfaceMethodTable[] = {
{ "Create", virtDBusInterfaceCreate },
{ "Destroy", virtDBusInterfaceDestroy },
{ "Undefine", virtDBusInterfaceUndefine },
{ 0 }
};
......
......@@ -7,6 +7,11 @@ class TestInterface(libvirttest.BaseTestClass):
""" Tests for methods and properties of the Interface interface
"""
def test_interface_undefine(self):
_,interface_obj = self.interface_create()
interface_obj.Destroy(0)
interface_obj.Undefine()
def test_interface_destroy(self):
_,interface_obj = self.interface_create()
interface_obj.Destroy(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