On 01/05/2016 07:06 AM, Marc-André Lureau wrote: > Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com>Hi > > On Mon, Dec 21, 2015 at 6:08 PM, Eric Blake <ebl...@redhat.com> wrote: >> JSON uses "name":value, but many of our visitor interfaces were >> called with visit_type_FOO(v, &value, name, errp). This can be >> a bit confusing to have to mentally swap the parameter order to >> match JSON order. It's particularly bad for visit_start_struct(), >> where the 'name' parameter is smack in the middle of the >> otherwise-related group of 'obj, kind, size' parameters! It's >> time to do a global swap of the parameter ordering, so that the >> 'name' parameter is always immediately after the Visitor argument. >> > > fwiw, I do agree. > >> Additional reasons in favor of the swap: name is always an input >> parameter, while &value is sometimes an output parameter (depending >> on whether the caller is using an input visitor); and it is nicer >> to list input parameters first. Also, the existing include/qjson.h >> prefers listing 'name' first in json_prop_*(), and I have plans to >> unify that file with the qapi visitors; listing 'name' first in >> qapi will minimize churn to the (admittedly few) qjson.h clients. >> >> The next patches will then fix object.h, visitor-impl.h, and those >> clients to match. >>
> > The result looks good and passes the tests > Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> > > However, docs/qapi-code-gen.txt should be updated in a follow-up patch. D'oh - I knew I'd forget something :) You're right, of course. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature