[dbus PATCH 19/25] Implement PinIOThread 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                | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 97c5471..9490654 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -274,6 +274,13 @@
       <arg name="cpumap" type="ay" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
     </method>
+    <method name="PinIOThread">
+      <annotation name="org.gtk.GDBus.DocString"
+        value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPinIOThread"/>
+      <arg name="iothreadId" type="u" direction="in"/>
+      <arg name="cpumap" type="ay" direction="in"/>
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="Reboot">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot"/>
diff --git a/src/domain.c b/src/domain.c
index 92799ac..60dab7e 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1396,6 +1396,44 @@ virtDBusDomainPinEmulator(GVariant *inArgs,
         virtDBusUtilSetLastVirtError(error);
 }
 
+static void
+virtDBusDomainPinIOThread(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;
+    guint iothreadId;
+    g_autofree const guchar *cpumap = NULL;
+    gsize maplen;
+    guint flags;
+    GVariant *v;
+
+    v = g_variant_get_child_value(inArgs, 0);
+    iothreadId = g_variant_get_uint32(v);
+    g_variant_unref(v);
+
+    v = g_variant_get_child_value(inArgs, 1);
+    cpumap = g_variant_get_fixed_array(v, &maplen, sizeof(guchar));
+    g_variant_unref(v);
+
+    v = g_variant_get_child_value(inArgs, 2);
+    flags = g_variant_get_uint32(v);
+    g_variant_unref(v);
+
+    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+    if (!domain)
+        return;
+
+    if (virDomainPinIOThread(domain, iothreadId, (guchar *)cpumap, maplen, flags) < 0)
+        virtDBusUtilSetLastVirtError(error);
+}
+
 static void
 virtDBusDomainReboot(GVariant *inArgs,
                      GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -1677,6 +1715,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
     { "MigrateSetMaxSpeed", virtDBusDomainMigrateSetMaxSpeed },
     { "MigrateStartPostCopy", virtDBusDomainMigrateStartPostCopy },
     { "PinEmulator", virtDBusDomainPinEmulator },
+    { "PinIOThread", virtDBusDomainPinIOThread },
     { "Reboot", virtDBusDomainReboot },
     { "Reset", virtDBusDomainReset },
     { "Resume", virtDBusDomainResume },
-- 
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