On Wed, 24 Apr 2013 15:59:15 -0600 Eric Blake <ebl...@redhat.com> wrote:
> On 04/24/2013 03:29 PM, Luiz Capitulino wrote: > >> -> { "execute": "query-command-capabilities" } > >> <- { [ { "type": "drive-mirror", > >> "data": [ "granularity", "buf-size" ] }, > >> { "type", ... } > >> ] } > >> > >> And whether a '*command' argument should be optional for filtered > >> output, vs. always unconditionally dumping all information on all > >> commands with capabilities, vs. mandatory (can only get capabilities for > >> one command at a time), all goes back to the larger question of whether > >> query-* commands should allow filtering. > > > > Not discussing filtering for now, but your proposal would superseded by > > full introspection, wouldn't it? > > Yeah, the two do seem rather similar, in that they are both providing a > form of introspection. As I see it, it boils down to WHAT is being > introspected: > > With query-command-capabilities, we are asking about capabilities, which > can always be represented as pure enum values (either the capability is > present or it is not). For DriveMirrorCapabilities we happened to map > two enum values to the name of two optional drive-mirror parameters; but > where we could introduce other capabilities that are unrelated to an > optional parameter; That's a good point, although I wonder if a command could have a new capability that's not mapped to a new argument. IOW, I'd expect most/all new capabilities to always be mapped to new arguments. In any case, I think the way to go is to add full introspection and then add query-command-capabilities afterwards if it turns out to be necessary.