On Fri, Feb 20, 2015 at 03:49:05PM -0700, Eric Blake wrote: Hello and thanks for your comments.
> 1. implement QAPI introspection (we've been dreaming about this > since qemu 1.5 days), then the caller just queries to see if the > version of QMP has the optional 'top' parameter. This sounds like the best option. Is there a roadmap? What's the status? I guess the amount of work depends a lot on the goals, but from what I can see, something like a 'query-command-args' command that returns the list of parameters is trivial, there's already the qmp_cmds array in memory with all the necessary information. > 2. implement the new feature as a new command (then the existing > 'query-commands' becomes an easy probe; but we have code duplication > with existing commands) I don't think there would be a lot of code duplication because one operation is a strict superset of the other, we would be just adding unnecessary commands. I would go for option 1) if possible. > 3. guarantee that we have sane error messages for bogus > commands used as the probe. If {"execute":"block-stream", > "data":{"device":"no-such","top":"bogus"}} gives a reliable > DeviceNotFound error for qemu that supports optional 'top', and a > reliable GenericError about an unknown argument 'top' in older qemu It doesn't seem like the best solution considering the alternatives, but for what it's worth: Current QEMU: (QEMU) block-stream device=no-such top=bogus {u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter 'top'"}} With my patch: (QEMU) block-stream device=no-such top=bogus {u'error': {u'class': u'DeviceNotFound', u'desc': u"Device 'no-such' not found"}} Regards, Berto