[dbus PATCH 2/2] Replace uint -> int wherever libvirt uses int type

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

 



Follow this pattern even if negative values will not
appear, in order to be consistent with libvirt APIs.

Note: In virtDBusNetworkGetDHCPLeases the lease->type
was corrected from string to int.

Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Connect.xml     | 18 +++++++++---------
 data/org.libvirt.Domain.xml      | 16 ++++++++--------
 data/org.libvirt.Network.xml     |  2 +-
 data/org.libvirt.Secret.xml      |  2 +-
 data/org.libvirt.StoragePool.xml |  2 +-
 src/connect.c                    |  6 +++---
 src/domain.c                     | 18 +++++++++---------
 src/events.c                     | 12 ++++++------
 src/network.c                    |  4 ++--
 src/secret.c                     |  2 +-
 src/storagepool.c                |  2 +-
 11 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/data/org.libvirt.Connect.xml b/data/org.libvirt.Connect.xml
index 243ef35..b4f4de4 100644
--- a/data/org.libvirt.Connect.xml
+++ b/data/org.libvirt.Connect.xml
@@ -40,7 +40,7 @@
         value="See https://libvirt.org/html/libvirt-libvirt-host.html#virConnectCompareCPU"/>
       <arg name="xmlDesc" type="s" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
-      <arg name="compareResult" type="u" direction="out"/>
+      <arg name="compareResult" type="i" direction="out"/>
     </method>
     <method name="DomainCreateXML">
       <annotation name="org.gtk.GDBus.DocString"
@@ -66,7 +66,7 @@
     <method name="DomainLookupByID">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainLookupByID"/>
-      <arg name="id" type="u" direction="in"/>
+      <arg name="id" type="i" direction="in"/>
       <arg name="domain" type="o" direction="out"/>
     </method>
     <method name="DomainLookupByName">
@@ -267,28 +267,28 @@
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventCallback"/>
       <arg name="domain" type="o"/>
-      <arg name="event" type="u"/>
-      <arg name="detail" type="u"/>
+      <arg name="event" type="i"/>
+      <arg name="detail" type="i"/>
     </signal>
     <signal name="NetworkEvent">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-network.html#virConnectNetworkEventLifecycleCallback"/>
       <arg name="network" type="o"/>
-      <arg name="event" type="u"/>
+      <arg name="event" type="i"/>
     </signal>
     <signal name="SecretEvent">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-secret.html#virConnectSecretEventLifecycleCallback"/>
       <arg name="secret" type="o"/>
-      <arg name="event" type="u"/>
-      <arg name="detail" type="u"/>
+      <arg name="event" type="i"/>
+      <arg name="detail" type="i"/>
     </signal>
     <signal name="StoragePoolEvent">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-storage.html#virConnectStoragePoolEventLifecycleCallback"/>
       <arg name="storagePool" type="o"/>
-      <arg name="event" type="u"/>
-      <arg name="detail" type="u"/>
+      <arg name="event" type="i"/>
+      <arg name="detail" type="i"/>
     </signal>
   </interface>
 </node>
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 9343dbd..21c017e 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -195,7 +195,7 @@
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetBlockJobInfo"/>
       <arg name="disk" type="s" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
-      <arg name="blockJobInfo" type="(uttt)" direction="out"/>
+      <arg name="blockJobInfo" type="(ittt)" direction="out"/>
     </method>
     <method name="GetControlInfo">
       <annotation name="org.gtk.GDBus.DocString"
@@ -207,7 +207,7 @@
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetDiskErrors"/>
       <arg name="flags" type="u" direction="in"/>
-      <arg name="diskErrors" type="a(su)" direction="out"/>
+      <arg name="diskErrors" type="a(si)" direction="out"/>
     </method>
     <method name="GetFSInfo">
       <annotation name="org.gtk.GDBus.DocString"
@@ -243,13 +243,13 @@
     <method name="GetJobInfo">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo"/>
-      <arg name="jobInfo" type="(uttttttttttt)" direction="out"/>
+      <arg name="jobInfo" type="(ittttttttttt)" direction="out"/>
     </method>
     <method name="GetJobStats">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobStats"/>
       <arg name="flags" type="u" direction="in"/>
-      <arg name="stats" type="(ua{sv})" direction="out"/>
+      <arg name="stats" type="(ia{sv})" direction="out"/>
     </method>
     <method name="GetMemoryParameters">
       <annotation name="org.gtk.GDBus.DocString"
@@ -261,7 +261,7 @@
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetMetadata
                Empty string can be used to pass a NULL as @uri argument."/>
-      <arg name="type" type="u" direction="in"/>
+      <arg name="type" type="i" direction="in"/>
       <arg name="uri" type="s" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
       <arg name="metadata" type="s" direction="out"/>
@@ -516,7 +516,7 @@
       <annotation name="org.gtk.GDBus.DocString"
           value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMetadata
                  Empty string can be used to pass a NULL as @key or @uri argument."/>
-      <arg name="type" type="u" direction="in"/>
+      <arg name="type" type="i" direction="in"/>
       <arg name="metadata" type="s" direction="in"/>
       <arg name="key" type="s" direction="in"/>
       <arg name="uri" type="s" direction="in"/>
@@ -596,13 +596,13 @@
       <arg name="oldSrcPath" type="s"/>
       <arg name="newSrcPath" type="s"/>
       <arg name="device" type="s"/>
-      <arg name="reason" type="u"/>
+      <arg name="reason" type="i"/>
     </signal>
     <signal name="TrayChange">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTrayChangeCallback"/>
       <arg name="device" type="s"/>
-      <arg name="reason" type="u"/>
+      <arg name="reason" type="i"/>
     </signal>
   </interface>
 </node>
diff --git a/data/org.libvirt.Network.xml b/data/org.libvirt.Network.xml
index 6ac25e9..dec3533 100644
--- a/data/org.libvirt.Network.xml
+++ b/data/org.libvirt.Network.xml
@@ -42,7 +42,7 @@
                Empty string will be returned in output for NULL variables."/>
       <arg name="mac" type="s" direction="in"/>
       <arg name="flags" type="u" direction="in"/>
-      <arg name="leases" type="a(stusssuss)" direction="out"/>
+      <arg name="leases" type="a(stisssuss)" direction="out"/>
     </method>
     <method name="GetXMLDesc">
       <annotation name="org.gtk.GDBus.DocString"
diff --git a/data/org.libvirt.Secret.xml b/data/org.libvirt.Secret.xml
index 3a5d742..7ae5e6d 100644
--- a/data/org.libvirt.Secret.xml
+++ b/data/org.libvirt.Secret.xml
@@ -13,7 +13,7 @@
         value="See https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageID"/>
       <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
     </property>
-    <property name="UsageType" type="u" access="read">
+    <property name="UsageType" type="i" access="read">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-secret.html#virSecretGetUsageType"/>
       <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="const"/>
diff --git a/data/org.libvirt.StoragePool.xml b/data/org.libvirt.StoragePool.xml
index f33ed38..4679fff 100644
--- a/data/org.libvirt.StoragePool.xml
+++ b/data/org.libvirt.StoragePool.xml
@@ -49,7 +49,7 @@
     <method name="GetInfo">
       <annotation name="org.gtk.GDBus.DocString"
         value="See https://libvirt.org/html/libvirt-libvirt-storage.html#virStoragePoolGetInfo"/>
-      <arg name="info" type="(uttt)" direction="out"/>
+      <arg name="info" type="(ittt)" direction="out"/>
     </method>
     <method name="GetXMLDesc">
       <annotation name="org.gtk.GDBus.DocString"
diff --git a/src/connect.c b/src/connect.c
index 0b33bc5..e9ad2dd 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -289,7 +289,7 @@ virtDBusConnectCompareCPU(GVariant *inArgs,
     if (compareResult < 0)
         return virtDBusUtilSetLastVirtError(error);
 
-    *outArgs = g_variant_new("(u)", compareResult);
+    *outArgs = g_variant_new("(i)", compareResult);
 }
 
 static void
@@ -399,9 +399,9 @@ virtDBusConnectDomainLookupByID(GVariant *inArgs,
     virtDBusConnect *connect = userData;
     g_autoptr(virDomain) domain = NULL;
     g_autofree gchar *path = NULL;
-    guint id;
+    gint id;
 
-    g_variant_get(inArgs, "(u)", &id);
+    g_variant_get(inArgs, "(i)", &id);
 
     if (!virtDBusConnectOpen(connect, error))
         return;
diff --git a/src/domain.c b/src/domain.c
index 06b3f17..212ed9f 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1009,7 +1009,7 @@ virtDBusDomainGetBlockJobInfo(GVariant *inArgs,
     if (virDomainGetBlockJobInfo(domain, disk, &info, flags) < 0)
         return virtDBusUtilSetLastVirtError(error);
 
-    *outArgs = g_variant_new("((uttt))", info.type, info.bandwidth,
+    *outArgs = g_variant_new("((ittt))", info.type, info.bandwidth,
                              info.cur, info.end);
 }
 
@@ -1078,11 +1078,11 @@ virtDBusDomainGetDiskErrors(GVariant *inArgs,
             return virtDBusUtilSetLastVirtError(error);
     }
 
-    g_variant_builder_init(&builder, G_VARIANT_TYPE("a(su)"));
+    g_variant_builder_init(&builder, G_VARIANT_TYPE("a(si)"));
     for (gint i = 0; i < count; i++) {
-        g_variant_builder_open(&builder, G_VARIANT_TYPE("(su)"));
+        g_variant_builder_open(&builder, G_VARIANT_TYPE("(si)"));
         g_variant_builder_add(&builder, "s", disks[i].disk);
-        g_variant_builder_add(&builder, "u", disks[i].error);
+        g_variant_builder_add(&builder, "i", disks[i].error);
         g_variant_builder_close(&builder);
     }
     res = g_variant_builder_end(&builder);
@@ -1301,7 +1301,7 @@ virtDBusDomainGetJobInfo(GVariant *inArgs G_GNUC_UNUSED,
     if (virDomainGetJobInfo(domain, jobInfo) < 0)
         return virtDBusUtilSetLastVirtError(error);
 
-    *outArgs = g_variant_new("((uttttttttttt))", jobInfo->type,
+    *outArgs = g_variant_new("((ittttttttttt))", jobInfo->type,
                              jobInfo->timeElapsed, jobInfo->timeRemaining,
                              jobInfo->dataTotal, jobInfo->dataProcessed,
                              jobInfo->dataRemaining, jobInfo->memTotal,
@@ -1341,8 +1341,8 @@ virtDBusDomainGetJobStats(GVariant *inArgs,
 
     grecords = virtDBusUtilTypedParamsToGVariant(params.params, params.nparams);
 
-    g_variant_builder_init(&builder, G_VARIANT_TYPE("(ua{sv})"));
-    g_variant_builder_add(&builder, "u", type);
+    g_variant_builder_init(&builder, G_VARIANT_TYPE("(ia{sv})"));
+    g_variant_builder_add(&builder, "i", type);
     g_variant_builder_add_value(&builder, grecords);
     gret = g_variant_builder_end(&builder);
 
@@ -1404,7 +1404,7 @@ virtDBusDomainGetMetadata(GVariant *inArgs,
     guint flags;
     g_autofree gchar *ret = NULL;
 
-    g_variant_get(inArgs, "(u&su)", &type, &uri, &flags);
+    g_variant_get(inArgs, "(i&su)", &type, &uri, &flags);
     if (g_str_equal(uri, ""))
         uri = NULL;
 
@@ -2589,7 +2589,7 @@ virtDBusDomainSetMetadata(GVariant *inArgs,
     const gchar *uri;
     guint flags;
 
-    g_variant_get(inArgs, "(u&s&s&su)", &type, &metadata, &key, &uri, &flags);
+    g_variant_get(inArgs, "(i&s&s&su)", &type, &metadata, &key, &uri, &flags);
     if (g_str_equal(key, ""))
         key = NULL;
     if (g_str_equal(uri, ""))
diff --git a/src/events.c b/src/events.c
index 53cd725..6d7aca8 100644
--- a/src/events.c
+++ b/src/events.c
@@ -21,7 +21,7 @@ virtDBusEventsDomainLifecycle(virConnectPtr connection G_GNUC_UNUSED,
                                   connect->connectPath,
                                   VIRT_DBUS_CONNECT_INTERFACE,
                                   "DomainEvent",
-                                  g_variant_new("(ouu)", path, event, detail),
+                                  g_variant_new("(oii)", path, event, detail),
                                   NULL);
 
     return 0;
@@ -88,7 +88,7 @@ virtDBusEventsDomainTrayChange(virConnectPtr connection G_GNUC_UNUSED,
                                   path,
                                   VIRT_DBUS_DOMAIN_INTERFACE,
                                   "TrayChange",
-                                  g_variant_new("(su)", device, reason),
+                                  g_variant_new("(si)", device, reason),
                                   NULL);
 
     return 0;
@@ -113,7 +113,7 @@ virtDBusEventsDomainDiskChange(virConnectPtr connection G_GNUC_UNUSED,
                                   path,
                                   VIRT_DBUS_DOMAIN_INTERFACE,
                                   "DiskChange",
-                                  g_variant_new("(sssu)", old_src_path,
+                                  g_variant_new("(sssi)", old_src_path,
                                                 new_src_path, device, reason),
                                   NULL);
 
@@ -137,7 +137,7 @@ virtDBusEventsNetworkLifecycle(virConnectPtr connection G_GNUC_UNUSED,
                                   connect->connectPath,
                                   VIRT_DBUS_CONNECT_INTERFACE,
                                   "NetworkEvent",
-                                  g_variant_new("(ou)", path, event),
+                                  g_variant_new("(oi)", path, event),
                                   NULL);
 
     return 0;
@@ -160,7 +160,7 @@ virtDBusEventsSecretLifecycle(virConnectPtr connection G_GNUC_UNUSED,
                                   connect->connectPath,
                                   VIRT_DBUS_CONNECT_INTERFACE,
                                   "SecretEvent",
-                                  g_variant_new("(ouu)", path, event, detail),
+                                  g_variant_new("(oii)", path, event, detail),
                                   NULL);
 
     return 0;
@@ -184,7 +184,7 @@ virtDBusEventsStoragePoolLifecycle(virConnectPtr connection G_GNUC_UNUSED,
                                   connect->connectPath,
                                   VIRT_DBUS_CONNECT_INTERFACE,
                                   "StoragePoolEvent",
-                                  g_variant_new("(ouu)", path, event, detail),
+                                  g_variant_new("(oii)", path, event, detail),
                                   NULL);
 
     return 0;
diff --git a/src/network.c b/src/network.c
index 1763eca..e7087f7 100644
--- a/src/network.c
+++ b/src/network.c
@@ -228,11 +228,11 @@ virtDBusNetworkGetDHCPLeases(GVariant *inArgs,
     if (nleases < 0)
         return virtDBusUtilSetLastVirtError(error);
 
-    g_variant_builder_init(&builder, G_VARIANT_TYPE("a(stssssuss)"));
+    g_variant_builder_init(&builder, G_VARIANT_TYPE("a(stisssuss)"));
     for (gint i = 0; i < nleases; i++) {
         virNetworkDHCPLeasePtr lease = leases[i];
 
-        g_variant_builder_add(&builder, "(stusssuss)",
+        g_variant_builder_add(&builder, "(stisssuss)",
                               lease->iface, lease->expirytime,
                               lease->type, lease->mac,
                               lease->iaid ? lease->iaid : "" ,
diff --git a/src/secret.c b/src/secret.c
index 3aaed03..903cfc2 100644
--- a/src/secret.c
+++ b/src/secret.c
@@ -83,7 +83,7 @@ virtDBusSecretGetUsageType(const gchar *objectPath,
     if (usageType < 0)
         return virtDBusUtilSetLastVirtError(error);
 
-    *value = g_variant_new("u", usageType);
+    *value = g_variant_new("i", usageType);
 }
 
 static void
diff --git a/src/storagepool.c b/src/storagepool.c
index c8b6467..0da732f 100644
--- a/src/storagepool.c
+++ b/src/storagepool.c
@@ -268,7 +268,7 @@ virtDBusStoragePoolGetInfo(GVariant *inArgs G_GNUC_UNUSED,
     if (virStoragePoolGetInfo(storagePool, info) < 0)
         return virtDBusUtilSetLastVirtError(error);
 
-    *outArgs = g_variant_new("((uttt))", info->state,
+    *outArgs = g_variant_new("((ittt))", info->state,
                              info->capacity, info->allocation,
                              info->available);
 }
-- 
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