[dbus PATCH 09/15] Implement InterfaceChangeRollback method for Connect Interface

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

 



Signed-off-by: Anya Harter <aharter@xxxxxxxxxx>
---
 data/org.libvirt.Connect.xml |  5 +++++
 src/connect.c                | 22 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 8c88cc8..7c97117 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -158,6 +158,11 @@
         value="See https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeCommit"/>
       <arg name="flags" type="u" direction="in"/>
     </method>
+    <method name="InterfaceChangeRollback">
+      <annotation name="org.gtk.GDBus.DocString"
+        value="See https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceChangeRollback"/>
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="InterfaceDefineXML">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-interface.html#virInterfaceDefineXML"/>
diff --git a/src/connect.c b/src/connect.c
index dadfd96..563535c 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -777,6 +777,27 @@ virtDBusConnectInterfaceChangeCommit(GVariant *inArgs,
         virtDBusUtilSetLastVirtError(error);
 }
 
+static void
+virtDBusConnectInterfaceChangeRollback(GVariant *inArgs,
+                                       GUnixFDList *inFDs G_GNUC_UNUSED,
+                                       const gchar *objectPath G_GNUC_UNUSED,
+                                       gpointer userData,
+                                       GVariant **outArgs G_GNUC_UNUSED,
+                                       GUnixFDList **outFDs G_GNUC_UNUSED,
+                                       GError **error)
+{
+    virtDBusConnect *connect = userData;
+    guint flags;
+
+    g_variant_get(inArgs, "(u)", &flags);
+
+    if (!virtDBusConnectOpen(connect, error))
+        return;
+
+    if (virInterfaceChangeRollback(connect->connection, flags) < 0)
+        virtDBusUtilSetLastVirtError(error);
+}
+
 static void
 virtDBusConnectInterfaceDefineXML(GVariant *inArgs,
                                   GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -1876,6 +1897,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
     { "GetSysinfo", virtDBusConnectGetSysinfo },
     { "InterfaceChangeBegin", virtDBusConnectInterfaceChangeBegin },
     { "InterfaceChangeCommit", virtDBusConnectInterfaceChangeCommit },
+    { "InterfaceChangeRollback", virtDBusConnectInterfaceChangeRollback },
     { "InterfaceDefineXML", virtDBusConnectInterfaceDefineXML },
     { "ListDomains", virtDBusConnectListDomains },
     { "ListInterfaces", virtDBusConnectListInterfaces },
-- 
2.17.1

--
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