[libvirt] [PATCH 0/8] Refactored SEXPR and XM code

Markus Groß gross at univention.de
Mon Feb 21 13:40:05 UTC 2011


Hi,

this is a reworked version of my patch that refactors 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.
Because the XM functions reuse code from the SEXPR parsing functions
I had to move the SEXPR functions too.

To use the XM parsing functions one includes "xen_xm.h" and for SEXPR parsing "xen_sxpr.h".

The first patch just moves the sexpr.c.h files to src/util.
The second patch moves some general sexpr functions from xen-unified
to the sexpr unit.
With the patches 3 and 4 the SEXPR parsing/formatting functions
from xen-unified are moved to a new unit xen_sxpr.c.
Patches 5 and 6 do the same for the XM functions.
Patch 7 removes driver-references from the function names in xenxs.

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.

Markus Groß (8):
  Moved SEXPR unit to utils
  Moved some SEXPR functions from xen-unified
  Moved SEXPR parsing functions to xenxs
  Moved SEXPR formatting functions to xenxs
  Moved XM parsing functions to xenxs
  Moved XM formatting functions to xenxs
  Renamed functions in xenxs
  Added to AUTHORS

 AUTHORS                   |    1 +
 po/POTFILES.in            |    2 +
 src/Makefile.am           |   16 +-
 src/{xen => util}/sexpr.c |   64 +
 src/{xen => util}/sexpr.h |    6 +
 src/xen/xen_driver.c      |   19 +-
 src/xen/xend_internal.c   | 6668 +++++++++++++++------------------------------
 src/xen/xend_internal.h   |   30 -
 src/xen/xm_internal.c     | 1702 +------------
 src/xen/xm_internal.h     |    3 -
 src/xenxs/xen_sxpr.c      | 2197 +++++++++++++++
 src/xenxs/xen_sxpr.h      |   66 +
 src/xenxs/xen_xm.c        | 1724 ++++++++++++
 src/xenxs/xen_xm.h        |   39 +
 src/xenxs/xenxs_private.h |   63 +
 tests/sexpr2xmltest.c     |   12 +-
 tests/xmconfigtest.c      |    5 +-
 tests/xml2sexprtest.c     |    3 +-
 18 files changed, 6437 insertions(+), 6183 deletions(-)
 rename src/{xen => util}/sexpr.c (90%)
 rename src/{xen => util}/sexpr.h (88%)
 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


More information about the libvir-list mailing list