[dbus PATCH 23/25] Implement DomainSaveImageDefineXML method for Connect Interface

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

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Connect.xml |  7 +++++++
 src/connect.c                | 25 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 04ac2de..d2c77c1 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -63,6 +63,13 @@
       <arg name="xml" type="s" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
     </method>
+    <method name="DomainSaveImageDefineXML">
+      <annotation name="org.gtk.GDBus.DocString"
+        value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSaveImageDefineXML"/>
+      <arg name="file" type="s" direction="in"/>
+      <arg name="xml" type="s" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="GetCapabilities">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCapabilities"/>
diff --git a/src/connect.c b/src/connect.c
index 97e4d9c..af3d460 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -373,6 +373,30 @@ virtDBusConnectDomainRestoreFlags(GVariant *inArgs,
         virtDBusUtilSetLastVirtError(error);
 }
 
+static void
+virtDBusConnectDomainSaveImageDefineXML(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;
+    g_autoptr(virDomain) domain = NULL;
+    const gchar *file;
+    const gchar *xml;
+    guint flags;
+
+    g_variant_get(inArgs, "(&s&su)", &file, &xml, &flags);
+
+    if (!virtDBusConnectOpen(connect, error))
+        return;
+
+    if (virDomainSaveImageDefineXML(connect->connection, file, xml, flags) < 0)
+        virtDBusUtilSetLastVirtError(error);
+}
+
 static void
 virtDBusConnectGetSysinfo(GVariant *inArgs,
                           GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -607,6 +631,7 @@ static virtDBusGDBusMethodTable virtDBusConnectMethodTable[] = {
     { "DomainLookupByName", virtDBusConnectDomainLookupByName },
     { "DomainLookupByUUID", virtDBusConnectDomainLookupByUUID },
     { "DomainRestore", virtDBusConnectDomainRestoreFlags },
+    { "DomainSaveImageDefineXML", virtDBusConnectDomainSaveImageDefineXML },
     { "GetCapabilities", virtDBusConnectGetCapabilities },
     { "GetSysinfo", virtDBusConnectGetSysinfo },
     { "ListDomains", virtDBusConnectListDomains },
-- 
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