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

2018-06-19 Thread Pavel Hrdina
On Fri, Jun 15, 2018 at 07:03:50PM +0200, Katerina Koukiou wrote:
> Signed-off-by: Katerina Koukiou 
> ---
>  data/org.libvirt.NodeDevice.xml |  4 
>  src/nodedev.c   | 21 +
>  2 files changed, 25 insertions(+)

Reviewed-by: Pavel Hrdina 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2018-06-15 Thread Katerina Koukiou
Signed-off-by: Katerina Koukiou 
---
 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 @@
   https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReAttach"/>
 
+
+  https://libvirt.org/html/libvirt-libvirt-nodedev.html#virNodeDeviceReset"/>
+
   
 
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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list