Commit 74b62b4a authored by Katerina Koukiou's avatar Katerina Koukiou

Implement ReAttach method for NodeDevice Interface

Signed-off-by: 's avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 21b8f160
......@@ -34,5 +34,9 @@
value="See https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceListCaps"/>
<arg name="names" type="as" direction="out"/>
</method>
<method name="ReAttach">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach"/>
</method>
</interface>
</node>
......@@ -173,6 +173,26 @@ virtDBusNodeDeviceListCaps(GVariant *inArgs G_GNUC_UNUSED,
*outArgs = g_variant_new_tuple(&gret, 1);
}
static void
virtDBusNodeDeviceReAttach(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(virNodeDevice) dev = NULL;
dev = virtDBusNodeDeviceGetVirNodeDevice(connect, objectPath, error);
if (!dev)
return;
if (virNodeDeviceReAttach(dev) < 0)
virtDBusUtilSetLastVirtError(error);
}
static virtDBusGDBusPropertyTable virtDBusNodeDevicePropertyTable[] = {
{ "Name", virtDBusNodeDeviceGetName, NULL },
{ "Parent", virtDBusNodeDeviceGetParent, NULL },
......@@ -184,6 +204,7 @@ static virtDBusGDBusMethodTable virtDBusNodeDeviceMethodTable[] = {
{ "Detach", virtDBusNodeDeviceDetach },
{ "GetXMLDesc", virtDBusNodeDeviceGetXMLDesc },
{ "ListCaps", virtDBusNodeDeviceListCaps },
{ "ReAttach", virtDBusNodeDeviceReAttach },
{ 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