[dbus PATCH 09/25] Implement BlockPull method for Domain Interface

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

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Domain.xml |  7 +++++++
 src/domain.c                | 26 ++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 480499c..46a6632 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -84,6 +84,13 @@
       <arg name="flags" type="u" direction="in"/>
       <arg name="buffer" type="ay" direction="out"/>
     </method>
+    <method name="BlockPull">
+      <annotation name="org.gtk.GDBus.DocString"
+        value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockPull"/>
+      <arg name="disk" type="s" direction="in"/>
+      <arg name="bandwidth" type="t" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="Create">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainCreateWithFlags"/>
diff --git a/src/domain.c b/src/domain.c
index fee4a2c..af8cc73 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -496,6 +496,31 @@ virtDBusDomainBlockPeek(GVariant *inArgs,
     *outArgs = g_variant_new_tuple(&res, 1);
 }
 
+static void
+virtDBusDomainBlockPull(GVariant *inArgs,
+                        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(virDomain) domain = NULL;
+    const gchar *disk;
+    gulong bandwidth;
+    guint flags;
+
+    g_variant_get(inArgs, "(&stu)", &disk, &bandwidth, &flags);
+
+    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+    if (!domain)
+        return;
+
+    if (virDomainBlockPull(domain, disk, bandwidth, flags) < 0)
+        virtDBusUtilSetLastVirtError(error);
+}
+
 static void
 virtDBusDomainCreate(GVariant *inArgs,
                      GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -1357,6 +1382,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
     { "BlockCommit", virtDBusDomainBlockCommit },
     { "BlockJobAbort", virtDBusDomainBlockJobAbort },
     { "BlockPeek", virtDBusDomainBlockPeek },
+    { "BlockPull", virtDBusDomainBlockPull },
     { "Create", virtDBusDomainCreate },
     { "Destroy", virtDBusDomainDestroy },
     { "DetachDevice", virtDBusDomainDetachDevice },
-- 
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