[dbus PATCH 14/14] Implement Reset method for NodeDevice Interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.NodeDevice.xml |  4 ++++
 src/nodedev.c                   | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/data/org.libvirt.NodeDevice.xml b/data/org.libvirt.NodeDevice.xml
index 56deee3..5464c9a 100644
--- a/data/org.libvirt.NodeDevice.xml
+++ b/data/org.libvirt.NodeDevice.xml
@@ -37,5 +37,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>
diff --git a/src/nodedev.c b/src/nodedev.c
index 1d15d79..7982fd1 100644
--- a/src/nodedev.c
+++ b/src/nodedev.c
@@ -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 }
 };
 
-- 
2.15.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux