Index: src/xend_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/xend_internal.c,v retrieving revision 1.56 diff -c -r1.56 xend_internal.c *** src/xend_internal.c 16 Aug 2006 17:58:23 -0000 1.56 --- src/xend_internal.c 24 Aug 2006 13:57:36 -0000 *************** *** 1655,1660 **** --- 1655,1674 ---- return (NULL); } + char * + xend_parse_domain_sexp(virConnectPtr conn, char *sexpr) { + struct sexpr *root = string2sexpr(sexpr); + char *data; + + if (!root) + return NULL; + + data = xend_parse_sexp_desc(conn, root); + + sexpr_free(root); + + return data; + } /** * sexpr_to_xend_domain_info: Index: src/xend_internal.h =================================================================== RCS file: /data/cvs/libvirt/src/xend_internal.h,v retrieving revision 1.24 diff -c -r1.24 xend_internal.h *** src/xend_internal.h 9 Aug 2006 15:21:16 -0000 1.24 --- src/xend_internal.h 24 Aug 2006 13:57:36 -0000 *************** *** 613,618 **** --- 613,620 ---- */ int xend_log(virConnectPtr xend, char *buffer, size_t n_buffer); + char *xend_parse_domain_sexp(virConnectPtr conn, char *root); + /* refactored ones */ void xenDaemonRegister(void); int xenDaemonOpen(virConnectPtr conn, const char *name, int flags); Index: src/xs_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/xs_internal.c,v retrieving revision 1.15 diff -c -r1.15 xs_internal.c *** src/xs_internal.c 9 Aug 2006 15:21:16 -0000 1.15 --- src/xs_internal.c 24 Aug 2006 13:57:37 -0000 *************** *** 148,154 **** char s[256]; unsigned int len = 0; ! if (conn->xshandle == NULL) return (NULL); snprintf(s, 255, "/local/domain/%d/%s", domid, path); --- 148,154 ---- char s[256]; unsigned int len = 0; ! if (!conn || conn->xshandle == NULL) return (NULL); snprintf(s, 255, "/local/domain/%d/%s", domid, path); Index: tests/.cvsignore =================================================================== RCS file: /data/cvs/libvirt/tests/.cvsignore,v retrieving revision 1.1 diff -c -r1.1 .cvsignore *** tests/.cvsignore 5 Jul 2006 21:52:52 -0000 1.1 --- tests/.cvsignore 24 Aug 2006 13:57:37 -0000 *************** *** 3,5 **** --- 3,7 ---- .deps .libs xmlrpctest + sexpr2xmltest + xml2sexprtest Index: tests/Makefile.am =================================================================== RCS file: /data/cvs/libvirt/tests/Makefile.am,v retrieving revision 1.2 diff -c -r1.2 Makefile.am *** tests/Makefile.am 29 May 2006 16:05:05 -0000 1.2 --- tests/Makefile.am 24 Aug 2006 13:57:37 -0000 *************** *** 16,22 **** EXTRA_DIST = xmlrpcserver.py ! noinst_PROGRAMS = xmlrpctest # Note: xmlrpc.[c|h] is not in libvirt yet xmlrpctest_SOURCES = \ --- 16,24 ---- EXTRA_DIST = xmlrpcserver.py ! noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest ! ! TESTS = xml2sexprtest sexpr2xmltest # Note: xmlrpc.[c|h] is not in libvirt yet xmlrpctest_SOURCES = \ *************** *** 28,32 **** --- 30,46 ---- xmlrpctest_LDFLAGS = xmlrpctest_LDADD = $(LDADDS) + xml2sexprtest_SOURCES = \ + xml2sexprtest.c \ + testutils.c testutils.h + xml2sexprtest_LDFLAGS = + xml2sexprtest_LDADD = $(LDADDS) + + sexpr2xmltest_SOURCES = \ + sexpr2xmltest.c \ + testutils.c testutils.h + sexpr2xmltest_LDFLAGS = + sexpr2xmltest_LDADD = $(LDADDS) + $(LIBVIRT): -@(cd $(top_builddir)/src && $(MAKE) MAKEFLAGS+=--silent) Index: tests/sexpr2xml-fv.sexpr =================================================================== RCS file: tests/sexpr2xml-fv.sexpr diff -N tests/sexpr2xml-fv.sexpr *** /dev/null 1 Jan 1970 00:00:00 -0000 --- tests/sexpr2xml-fv.sexpr 24 Aug 2006 13:57:37 -0000 *************** *** 0 **** --- 1 ---- + (domain (domid 3)(name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(cdrom '/root/boot.iso')(acpi 1)(vnc 1)))(device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu)))) Index: tests/sexpr2xml-fv.xml =================================================================== RCS file: tests/sexpr2xml-fv.xml diff -N tests/sexpr2xml-fv.xml *** /dev/null 1 Jan 1970 00:00:00 -0000 --- tests/sexpr2xml-fv.xml 24 Aug 2006 13:57:37 -0000 *************** *** 0 **** --- 1,35 ---- + + fvtest + b5d70dd275cdaca517769660b059d8bc + + hvm + /usr/lib/xen/boot/hvmloader + + + 409600 + 1 + destroy + restart + restart + + + + + /usr/lib64/xen/bin/qemu-dm + + + + + + + +