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