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

Re: [Xen-devel] [PATCH v6 08/11] libxl: QEMU startup sync based on QMP



On Wed, Nov 21, 2018 at 04:49:06PM +0000, Anthony PERARD wrote:
> On Fri, Nov 16, 2018 at 12:14:43PM +0000, Ian Jackson wrote:
> > Anthony PERARD writes ("[PATCH v6 08/11] libxl: QEMU startup sync based on 
> > QMP"):
> > > +        LOGD(DEBUG, ev->domid, ".. instead, got: %s",
> > > +             libxl__json_object_to_json(gc, response));
> > 
> > The doc comments for libxl__json_object_to_json don't say whether it
> > can fail.  So I assume it can, in which case you will pass NULL to %s
> > which is (sadly) nowadays illegal (although in practice probably
> > safe).
> 
> I wounder what to do for this.
> Maybe invent a JSON macro which would be:
>     JSON(o) (libxl__json_object_to_json(gc, (o)) : ? "\"null\"")
>     ("null" would actually be valid json)
> Or do it without the macro, but there are plenty of other caller's of
> libxl__json_object_to_json in libxl__ev_qmp implementation.

Or simply change libxl__json_object_to_json to always return a valid
json string. There are no user yet, so it is probably fine to make that
change.

What do you think?

Thanks,

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.