On 05/23/2016 04:14 AM, Wei, Jiangang wrote:
> Hi all,
> 
> I found a problem about the output of 'query-version'
> 

> Actually, It's as following,
> -> { "execute": "query-version" }
> <- {
>       "return":{
>          "qemu":{
>             "micro":50,
>             "minor":6,
>             "major":2
>          },
>          "package":""
>       }
>    }
> 

JSON has no inherent ordering of keys in a dictionary, so I see nothing
that needs to be changed here.

> The reason is that the member ''qemu" is regarded as Un-ordered dict.
> and  tdb_hash() returns the same bucket(225) for both  "micro" and
> "minor". 
> and The "major" is bigger (481).
> 
> All of the above metioned introduces the disorder for major , minor and
> micro.

And if we pick any different hash, the results might be in a different
order again. But it doesn't make it any less correct, so I don't think
an ordered dict will help anything, and would instead just cost more
overhead to write and maintain.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to