[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] QMP accepts double dict keys
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] QMP accepts double dict keys |
Date: |
Tue, 4 Dec 2018 10:24:09 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Mon, Dec 03, 2018 at 01:57:13PM -0600, Eric Blake wrote:
> On 12/3/18 1:48 PM, Markus Armbruster wrote:
> > Eric Blake <address@hidden> writes:
> >
> > > On 12/3/18 10:30 AM, Max Reitz wrote:
> > > > Hi,
> > > >
> > > > QMP accepts double keys in dicts without complaining. The value it is
> > > > using is apparently the last one specified:
> > >
> > > JSON says it is undefined what happens when a client passes double
> > > keys. We are probably best off if we teach our parser to be strict and
> > > reject doubled keys in QMP as invalid.
> >
> > Not bug-compatible. Do we care?
>
> I don't think so. Such a client was already invoking undefined behavior.
> Relying on first- or last-past-the-post to win is not portable, since JSON
> parsers are allowed to use hash tables with non-deterministic lookups. I
> think erroring out is nicer than silently accepting one thing, especially if
> that might have been different than what the client (incorrectly) expected.
> I'm not even sure that we would want a deprecation period.
Erroring out immediately, without any deprecation period sounds fine
to me, as this is simply a bug fix.
IMHO the ABI/API compatibility stability only applies to things that
are intended behaviour / correct usage.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|