[libvirt] [PATCH 0/2] Refactored XM and SEXPR parsing

Hi, I refactored the XM and SEXPR parsing routines from the xen-unified driver into a seperate directory (xenxs; x for xm and s for sexpr). This way different xen-drivers besides xen-unified are able to use the parsing functionality. For example the upcoming XenLight (libxl) driver. To use the XM parsing functions one includes "xen_xm.h" and for SEXPR parsing "xen_sxpr.h". The patch is rather big, but most of it are code movements. Some parsing functions required a driver object to fetch the tty path and vncport. I removed all references to a specific driver and added additional parameters as a replacement. The tests sexpr2xml, xmconfig and xml2sexpr are adapted and show no error. Thanks in advance for your comments about this. Cheers, Markus Markus Groß (2): Moved Xen SEXPR and XM parsing functionality to seperate directory. Added to authors to please make syntax-check AUTHORS | 1 + configure.ac | 4 + include/libvirt/virterror.h | 2 +- src/Makefile.am | 15 +- src/util/virterror.c | 4 +- src/xen/sexpr.c | 568 ---- src/xen/sexpr.h | 55 - src/xen/xen_driver.c | 19 +- src/xen/xend_internal.c | 6673 ++++++++++++++----------------------------- src/xen/xend_internal.h | 30 - src/xen/xm_internal.c | 1706 +----------- src/xen/xm_internal.h | 3 - src/xenxs/sexpr.c | 647 +++++ src/xenxs/sexpr.h | 63 + src/xenxs/xen_sxpr.c | 2149 ++++++++++++++ src/xenxs/xen_sxpr.h | 62 + src/xenxs/xen_xm.c | 1716 +++++++++++ src/xenxs/xen_xm.h | 41 + src/xenxs/xenxs_private.h | 63 + tests/sexpr2xmltest.c | 12 +- tests/xmconfigtest.c | 5 +- tests/xml2sexprtest.c | 4 +- 22 files changed, 7012 insertions(+), 6830 deletions(-) delete mode 100644 src/xen/sexpr.c delete mode 100644 src/xen/sexpr.h create mode 100644 src/xenxs/sexpr.c create mode 100644 src/xenxs/sexpr.h create mode 100644 src/xenxs/xen_sxpr.c create mode 100644 src/xenxs/xen_sxpr.h create mode 100644 src/xenxs/xen_xm.c create mode 100644 src/xenxs/xen_xm.h create mode 100644 src/xenxs/xenxs_private.h -- 1.7.4.1

--- AUTHORS | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)

On Thu, Feb 17, 2011 at 01:45:42PM +0100, Markus Groß wrote:
Hi,
I refactored the XM and SEXPR parsing routines from the xen-unified driver into a seperate directory (xenxs; x for xm and s for sexpr). This way different xen-drivers besides xen-unified are able to use the parsing functionality. For example the upcoming XenLight (libxl) driver. To use the XM parsing functions one includes "xen_xm.h" and for SEXPR parsing "xen_sxpr.h".
The patch is rather big, but most of it are code movements.
FYI in case people are wondering where the patch is, it was blocked at mailman level because it was seriously huge! After discussion with Markus on IRC, we have figured a way to split it up into smaller pieces for reposting 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 :|

On 02/17/2011 06:14 AM, Daniel P. Berrange wrote:
On Thu, Feb 17, 2011 at 01:45:42PM +0100, Markus Groß wrote:
Hi,
I refactored the XM and SEXPR parsing routines from the xen-unified driver into a seperate directory (xenxs; x for xm and s for sexpr). This way different xen-drivers besides xen-unified are able to use the parsing functionality. For example the upcoming XenLight (libxl) driver. To use the XM parsing functions one includes "xen_xm.h" and for SEXPR parsing "xen_sxpr.h".
The patch is rather big, but most of it are code movements.
FYI in case people are wondering where the patch is, it was blocked at mailman level because it was seriously huge! After discussion with Markus on IRC, we have figured a way to split it up into smaller pieces for reposting
Also, if it involves file movement, then be sure you are using git's diff.rename = true configuration option, as it compresses the file motion to only show the few tweaks needed across the rename, rather than showing the entire old file as deleted and new file as created. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Markus Groß wrote:
Hi,
I refactored the XM and SEXPR parsing routines from the xen-unified driver into a seperate directory (xenxs; x for xm and s for sexpr). This way different xen-drivers besides xen-unified are able to use the parsing functionality. For example the upcoming XenLight (libxl) driver. To use the XM parsing functions one includes "xen_xm.h" and for SEXPR parsing "xen_sxpr.h".
libxl does not support sexpr at all so I don't think there is a need to move that code, only the xm config parsing functions. Regards, Jim
The patch is rather big, but most of it are code movements. Some parsing functions required a driver object to fetch the tty path and vncport. I removed all references to a specific driver and added additional parameters as a replacement.
The tests sexpr2xml, xmconfig and xml2sexpr are adapted and show no error.
Thanks in advance for your comments about this.
Cheers, Markus
Markus Groß (2): Moved Xen SEXPR and XM parsing functionality to seperate directory. Added to authors to please make syntax-check
AUTHORS | 1 + configure.ac | 4 + include/libvirt/virterror.h | 2 +- src/Makefile.am | 15 +- src/util/virterror.c | 4 +- src/xen/sexpr.c | 568 ---- src/xen/sexpr.h | 55 - src/xen/xen_driver.c | 19 +- src/xen/xend_internal.c | 6673 ++++++++++++++----------------------------- src/xen/xend_internal.h | 30 - src/xen/xm_internal.c | 1706 +----------- src/xen/xm_internal.h | 3 - src/xenxs/sexpr.c | 647 +++++ src/xenxs/sexpr.h | 63 + src/xenxs/xen_sxpr.c | 2149 ++++++++++++++ src/xenxs/xen_sxpr.h | 62 + src/xenxs/xen_xm.c | 1716 +++++++++++ src/xenxs/xen_xm.h | 41 + src/xenxs/xenxs_private.h | 63 + tests/sexpr2xmltest.c | 12 +- tests/xmconfigtest.c | 5 +- tests/xml2sexprtest.c | 4 +- 22 files changed, 7012 insertions(+), 6830 deletions(-) delete mode 100644 src/xen/sexpr.c delete mode 100644 src/xen/sexpr.h create mode 100644 src/xenxs/sexpr.c create mode 100644 src/xenxs/sexpr.h create mode 100644 src/xenxs/xen_sxpr.c create mode 100644 src/xenxs/xen_sxpr.h create mode 100644 src/xenxs/xen_xm.c create mode 100644 src/xenxs/xen_xm.h create mode 100644 src/xenxs/xenxs_private.h
------------------------------------------------------------------------
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Feb 17, 2011 at 07:46:59AM -0700, Jim Fehlig wrote:
Markus Groß wrote:
Hi,
I refactored the XM and SEXPR parsing routines from the xen-unified driver into a seperate directory (xenxs; x for xm and s for sexpr). This way different xen-drivers besides xen-unified are able to use the parsing functionality. For example the upcoming XenLight (libxl) driver. To use the XM parsing functions one includes "xen_xm.h" and for SEXPR parsing "xen_sxpr.h".
libxl does not support sexpr at all so I don't think there is a need to move that code, only the xm config parsing functions.
The reason was that the 'XM' code reuses several functions from the 'SEXPR' code... 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 :|
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Jim Fehlig
-
Markus Groß