From: Ian Jackson Subject: Re: [PATCH V5 3/3] libxl, Introduce a QMP client Date: Mon, 27 Jun 2011 17:17:46 +0100 Message-ID: <19976.44330.128977.805588@mariner.uk.xensource.com> References: <1309187551-21538-1-git-send-email-anthony.perard@citrix.com> <1309187551-21538-4-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1309187551-21538-4-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony PERARD Cc: Ian Campbell , Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Anthony PERARD writes ("[Xen-devel] [PATCH V5 3/3] libxl, Introduce a QMP client"): > QMP stands for QEMU Monitor Protocol and it is used to query information > from QEMU or to control QEMU. > > This implementation will ask QEMU the list of chardevice and store the > path to serial0 in xenstored. So we will be able to use xl console with > QEMU upstream. Can I make a suggestion ? I think the formulaic json parser stuff could usefully live in a separate file. > +static inline yajl_gen_status yajl_gen_asciiz(yajl_gen hand, const char *str) Isn't this a hostage to fortune ? yajl may grow an identically-named function in which case this will no longer build. > +#ifdef DEBUG_ANSWER > + if (qmp->g) > + yajl_gen_free(qmp->g); > +#endif Can this #ifdef not be shuffled off somewhere ? Ie, make a debug function (or macro) which we call unconditionally. The rest looks plausible. Ian.