[Libguestfs] [PATCH 3/5] Move xml and xpath_helpers OCAML code to mllib

Cédric Bosdonnat
Tue, 03 Jan 2017 10:18:54 -0000

To allow other pieces of code to process XML files easily, move the
xml.ml* and xpath_helpers.ml* from v2v to mllib.
---
 docs/C_SOURCE_FILES              |  2 +-
 mllib/Makefile.am                |  9 +++++++--
 {v2v => mllib}/xml-c.c           |  0
 {v2v => mllib}/xml.ml            |  0
 {v2v => mllib}/xml.mli           |  0
 {v2v => mllib}/xpath_helpers.ml  |  0
 {v2v => mllib}/xpath_helpers.mli |  0
 v2v/Makefile.am                  | 17 +++--------------
 8 files changed, 11 insertions(+), 17 deletions(-)
 rename {v2v => mllib}/xml-c.c (100%)
 rename {v2v => mllib}/xml.ml (100%)
 rename {v2v => mllib}/xml.mli (100%)
 rename {v2v => mllib}/xpath_helpers.ml (100%)
 rename {v2v => mllib}/xpath_helpers.mli (100%)

diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES
index 7fa7d0a67..7e4dbdb25 100644
--- a/docs/C_SOURCE_FILES
+++ b/docs/C_SOURCE_FILES
@@ -390,4 +390,4 @@ utils/qemu-boot/qemu-boot.c
 utils/qemu-speed-test/qemu-speed-test.c
 v2v/domainxml-c.c
 v2v/utils-c.c
-v2v/xml-c.c
+mllib/xml-c.c
diff --git a/mllib/Makefile.am b/mllib/Makefile.am
index 4cf495555..1a21f825f 100644
--- a/mllib/Makefile.am
+++ b/mllib/Makefile.am
@@ -28,6 +28,8 @@ EXTRA_DIST = \
 	test-getopt.sh

 SOURCES_MLI = \
+	xml.mli \
+	xpath_helpers.mli \
 	checksums.mli \
 	common_utils.mli \
 	curl.mli \
@@ -67,7 +69,9 @@ SOURCES_ML = \
 	JSON.ml \
 	curl.ml \
 	exit.ml \
-	checksums.ml
+	checksums.ml \
+	xml.ml \
+	xpath_helpers.ml

 SOURCES_C = \
 	../cat/visit.c \
@@ -85,7 +89,8 @@ SOURCES_C = \
 	progress-c.c \
 	statvfs-c.c \
 	uri-c.c \
-	visit-c.c
+	visit-c.c \
+	xml-c.c

 if HAVE_OCAML

diff --git a/v2v/xml-c.c b/mllib/xml-c.c
similarity index 100%
rename from v2v/xml-c.c
rename to mllib/xml-c.c
diff --git a/v2v/xml.ml b/mllib/xml.ml
similarity index 100%
rename from v2v/xml.ml
rename to mllib/xml.ml
diff --git a/v2v/xml.mli b/mllib/xml.mli
similarity index 100%
rename from v2v/xml.mli
rename to mllib/xml.mli
diff --git a/v2v/xpath_helpers.ml b/mllib/xpath_helpers.ml
similarity index 100%
rename from v2v/xpath_helpers.ml
rename to mllib/xpath_helpers.ml
diff --git a/v2v/xpath_helpers.mli b/mllib/xpath_helpers.mli
similarity index 100%
rename from v2v/xpath_helpers.mli
rename to mllib/xpath_helpers.mli
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index cbb974fe4..feb47695a 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -58,14 +58,10 @@ SOURCES_MLI = \
 	utils.mli \
 	vCenter.mli \
 	windows.mli \
-	windows_virtio.mli \
-	xml.mli \
-	xpath_helpers.mli
+	windows_virtio.mli

 SOURCES_ML = \
 	types.ml \
-	xml.ml \
-	xpath_helpers.ml \
 	uefi.ml \
 	utils.ml \
 	name_from_disk.ml \
@@ -103,8 +99,7 @@ SOURCES_ML = \

 SOURCES_C = \
 	domainxml-c.c \
-	utils-c.c \
-	xml-c.c
+	utils-c.c

 if HAVE_OCAML

@@ -118,7 +113,6 @@ virt_v2v_CPPFLAGS = \
 	-I$(top_srcdir)/src
 virt_v2v_CFLAGS = \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
-	$(LIBXML2_CFLAGS) \
 	$(LIBVIRT_CFLAGS)

 BOBJECTS = \
@@ -166,8 +160,7 @@ virt_v2v_LINK = \

 virt_v2v_copy_to_local_SOURCES = \
 	domainxml-c.c \
-	utils-c.c \
-	xml-c.c
+	utils-c.c
 virt_v2v_copy_to_local_CPPFLAGS = \
 	-I. \
 	-I$(top_builddir) \
@@ -175,12 +168,9 @@ virt_v2v_copy_to_local_CPPFLAGS = \
 	-I$(top_srcdir)/src
 virt_v2v_copy_to_local_CFLAGS = \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
-	$(LIBXML2_CFLAGS) \
 	$(LIBVIRT_CFLAGS)

 COPY_TO_LOCAL_BOBJECTS = \
-	xml.cmo \
-	xpath_helpers.cmo \
 	uefi.cmo \
 	utils.cmo \
 	vCenter.cmo \
@@ -393,7 +383,6 @@ endif

 v2v_unit_tests_BOBJECTS = \
 	types.cmo \
-	xml.cmo \
 	uefi.cmo \
 	utils.cmo \
 	DOM.cmo \
--
2.11.0