Expressing large integer values in D-Bus APIs

Andy Grover agrover at redhat.com
Tue Jul 18 21:40:23 UTC 2017


On 07/17/2017 02:53 PM, Bastien Nocera wrote:
> On Mon, 2017-07-17 at 12:12 -0700, Andy Grover wrote:
>> Hi all,
>>
>> If we have a large integer value that might exceed 64 bits, how best
>> to
>> expose it on D-Bus? Convert to string? an array of [u64 (high), u64
>> (low)]? An array of 16 bytes and specify endianness?
>>
>> Another solution (but the most work) would be to add INT/UINT128
>> basic
>> types. Is that within the realm of possibility?
> 
> What's it for? Hard to know what a better type would be otherwise.
> 

It's for a storage array solution, to report a property with the total 
capacity. I don't know if we'd realistically exceed 16 EiB values but 
the projected numbers get close when you multiply max conceivable 
disksize with max conceivable arraysize.

I think we're provisionally going with a string representation. I guess 
it's also true that we could punt and use a UINT64, and create a new 
interface version, if we ever really needed more.

-- Andy


More information about the dbus mailing list