Commit c7394339 authored by Katerina Koukiou's avatar Katerina Koukiou

Implement Reset method for NodeDevice Interface

Signed-off-by: 's avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 74b62b4a
......@@ -38,5 +38,9 @@
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach"/>
</method>
<method name="Reset">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReset"/>
</method>
</interface>
</node>
......@@ -193,6 +193,26 @@ virtDBusNodeDeviceReAttach(GVariant *inArgs G_GNUC_UNUSED,
virtDBusUtilSetLastVirtError(error);
}
static void
virtDBusNodeDeviceReset(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 (virNodeDeviceReset(dev) < 0)
virtDBusUtilSetLastVirtError(error);
}
static virtDBusGDBusPropertyTable virtDBusNodeDevicePropertyTable[] = {
{ "Name", virtDBusNodeDeviceGetName, NULL },
{ "Parent", virtDBusNodeDeviceGetParent, NULL },
......@@ -205,6 +225,7 @@ static virtDBusGDBusMethodTable virtDBusNodeDeviceMethodTable[] = {
{ "GetXMLDesc", virtDBusNodeDeviceGetXMLDesc },
{ "ListCaps", virtDBusNodeDeviceListCaps },
{ "ReAttach", virtDBusNodeDeviceReAttach },
{ "Reset", virtDBusNodeDeviceReset },
{ 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