[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] schemas: Add vim modeline
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] schemas: Add vim modeline |
Date: |
Mon, 3 Aug 2020 14:16:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 03/08/20 13:36, Daniel P. Berrangé wrote:
>>> Given that QEMU needs to pass
>>> uint64 values, JSON was simply the wrong choice of format for QMP.
>
> I wasn't refering to RFC7159. The problem of undefined integer precision
> with JSON came up right at the very start when QMP was first designed and
> implemented, and has come up again periodically ever since then. libvirt
> needed to do workarounds right at the start in 2009, in order to fully
> handle signed/unsigned 64-bit integers with QMP.
I assume the workaround you refer to is to store the number as a string
and converting it lazily to either an integer or a floating-point type
in whoever uses the JSON API. It may not be pretty but probably it
would have been the same for any text-based, schema-less protocol. For
example, it didn't require writing your own parser.
It could be avoided by using a schema in Libvirt, just like QEMU has no
problem with it on the other side; it's just a different design choice
with different trade-offs, I don't think it's enough of an issue to
declare JSON "the wrong choice of format for QMP".
Paolo
Re: [PATCH] schemas: Add vim modeline, Markus Armbruster, 2020/08/03
Re: [PATCH] schemas: Add vim modeline, Daniel P . Berrangé, 2020/08/03
Re: [PATCH] schemas: Add vim modeline, Paolo Bonzini, 2020/08/03
Re: [PATCH] schemas: Add vim modeline, Alex Bennée, 2020/08/04