qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC/RFA PATCH] qapi: detect extra members inside struc


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC/RFA PATCH] qapi: detect extra members inside structs
Date: Mon, 19 Mar 2012 14:56:26 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 03/19/2012 02:51 PM, Paolo Bonzini wrote:
Il 19/03/2012 20:34, Anthony Liguori ha scritto:

     Is this acceptable or just wrong?

This is a feature.  The idea is that with QMP, old clients just ignore
extra members in a structure.  I've never felt that comfortable with
this as a semantic but this is how QMP was designed.

For old clients that could be fine.  But what about old servers? :)

Same applies to old server. If a new client tries to use a new field, if the old server refuses it, then the new client breaks.

There's no way in QMP to detect whether a server supports a new field. This is why I proposed instituting a policy of never adding/removing fields to structures and why I had advocating use a C version of libqapi in terms of enforcing compatibility rules.

I'm not sure if the "server ignores unknown" fields thing is even reasonable to rely upon so maybe we should just draw a line in the sane and make the change you're suggesting...

Regards,

Anthony Liguori


Perhaps we need an argument to the QMPInputVisitor constructor to
control this.

If you don't allow this semantic, then it's impossible to ever add a
field to an existing type as that would break backwards compatibility.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]