[dbus PATCH 2/6] Implement SetBlockIOTune 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                | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 4a69f25..a7b0d22 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -416,6 +416,13 @@
       <arg name="params" type="a{sv}" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
     </method>
+    <method name="SetBlockIOTune">
+      <annotation name="org.gtk.GDBus.DocString"
+        value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetBlockIoTune"/>
+      <arg name="disk" type="s" direction="in"/>
+      <arg name="params" type="a{sv}" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="SetMemory">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryFlags"/>
diff --git a/src/domain.c b/src/domain.c
index 726b90d..51ab3ec 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -2159,6 +2159,39 @@ virtDBusDomainSetBlkioParameters(GVariant *inArgs,
     }
 }
 
+static void
+virtDBusDomainSetBlockIOTune(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;
+    g_autoptr(GVariantIter) iter = NULL;
+    g_auto(virtDBusUtilTypedParams) params = { 0 };
+    const gchar *disk;
+    guint flags;
+
+    g_variant_get(inArgs, "(&sa{sv}u)", &disk, &iter, &flags);
+
+    if (!virtDBusUtilGVariantToTypedParams(iter, &params.params,
+                                           &params.nparams, error)) {
+        return;
+    }
+
+    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+    if (!domain)
+        return;
+
+    if (virDomainSetBlockIoTune(domain, disk, params.params,
+                                params.nparams, flags) < 0) {
+        virtDBusUtilSetLastVirtError(error);
+    }
+}
+
 static void
 virtDBusDomainSetMemory(GVariant *inArgs,
                         GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -2521,6 +2554,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
     { "SendKey", virtDBusDomainSendKey },
     { "SendProcessSignal", virtDBusDomainSendProcessSignal },
     { "SetBlkioParameters", virtDBusDomainSetBlkioParameters },
+    { "SetBlockIOTune", virtDBusDomainSetBlockIOTune },
     { "SetVcpus", virtDBusDomainSetVcpus },
     { "SetMemory", virtDBusDomainSetMemory },
     { "SetMemoryStatsPeriod", virtDBusDomainSetMemoryStatsPeriod },
-- 
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