From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [libvirt] [Xen-devel] [PATCH 0/5] Testing libvirt XML -> libxl_domain_config conversion Date: Mon, 2 Jun 2014 13:49:28 +0100 Message-ID: <20140602124928.GH28039@redhat.com> References: <1401470645-19869-1-git-send-email-berrange@redhat.com> <1401712918.18029.19.camel@kazak.uk.xensource.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1401712918.18029.19.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com To: Ian Campbell Cc: libvir-list@redhat.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Mon, Jun 02, 2014 at 01:41:58PM +0100, Ian Campbell wrote: > > I hacked around this, but it is a little dirty too. libvirt > > already links to libyajl for the QEMU driver, but we don't > > really need the raw YAJL objects. It'd be nice to have a > > > > char * libxl_domain_config_as_json(libxl_domain_config *p) > > > > as a higher level wrapper around libxl_domain_config_gen_json > > avoiding the pain of dealing with YAJL's different APIs. > > > > Ian J mentioned to me that he thought there was already such a > > method, but AFAICT, the only such code is in the 'xl' command > > line tool itself (xl_cmdimpl.c - printf_info_one_json) > > That was me not Ian J I think. Opps, my bad, was talking to too many people to remember things clearly :-) > The function you need is libxl_domain_config_to_json (which is > autogenerated, so in _libxl_types.[hc]). I think the general > libxl_*_to_json support has been there since Xen 4.2, but IIRC > libxl_domain_config only got moved into the autogenerated/IDL layer in > 4.3. Ahhh, so I was looking in the wrong place - no wonder 'git grep' failed to find it :-) > For compatibility with 4.2 you could probably use libxl_*_to_json on the > various members of libxl_domain_config individually, or just punt on the > unit tests in that case of course... Yeah, I think it is reasonable to just disable the test case if this function is missing. So I can avoid libxl_json.h entirely in this case. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|