Commit 1bebe5ae authored by Katerina Koukiou's avatar Katerina Koukiou

Replace uint -> int wherever libvirt uses int type

Follow this pattern even if negative values will not
appear, in order to be consistent with libvirt APIs.
Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent f536695e
......@@ -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">
......@@ -288,28 +288,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>
......@@ -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="GetEmulatorPinInfo">
<annotation name="org.gtk.GDBus.DocString"
......@@ -249,13 +249,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"
......@@ -267,7 +267,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"/>
......@@ -372,7 +372,7 @@
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMemoryStats"/>
<arg name="flags" type="u" direction="in"/>
<arg name="stats" type="a{ut}" direction="out"/>
<arg name="stats" type="a{it}" direction="out"/>
</method>
<method name="MigrateGetCompressionCache">
<annotation name="org.gtk.GDBus.DocString"
......@@ -540,7 +540,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"/>
......@@ -648,7 +648,7 @@
<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="Graphics">
<annotation name="org.gtk.GDBus.DocString"
......@@ -711,7 +711,7 @@
<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>
<signal name="Tunable">
<annotation name="org.gtk.GDBus.DocString"
......
......@@ -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"
......
......@@ -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"/>
......
......@@ -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"
......
......@@ -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;
......
......@@ -102,10 +102,10 @@ virtDBusDomainMemoryStatsToGVariant(virDomainMemoryStatPtr stats,
{
GVariantBuilder builder;
g_variant_builder_init(&builder, G_VARIANT_TYPE("a{ut}"));
g_variant_builder_init(&builder, G_VARIANT_TYPE("a{it}"));
for (gint i = 0; i < nr_stats; i++)
g_variant_builder_add(&builder, "{ut}", stats[i].tag, stats[i].val);
g_variant_builder_add(&builder, "{it}", stats[i].tag, stats[i].val);
return g_variant_builder_end(&builder);
}
......@@ -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);
......@@ -1345,7 +1345,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,
......@@ -1385,8 +1385,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);
......@@ -1448,7 +1448,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;
......@@ -2758,7 +2758,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, ""))
......
......@@ -112,7 +112,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;
......@@ -464,7 +464,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;
......@@ -537,7 +537,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);
......@@ -561,7 +561,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;
......@@ -584,7 +584,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;
......@@ -608,7 +608,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;
......
......@@ -228,11 +228,11 @@ virtDBusNetworkGetDHCPLeases(GVariant *inArgs,
if (nleases < 0)
return virtDBusUtilSetLastVirtError(error);
g_variant_builder_init(&builder, G_VARIANT_TYPE("a(stusssuss)"));
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 : "" ,
......
......@@ -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
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment