[Pkg-libvirt-commits] [libguestfs] 156/165: v2v: Create a shared StringMap module.
Hilko Bengen
bengen at moszumanska.debian.org
Sat Aug 30 08:25:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit 6705be2379aaf88bf3c8c25ab3ab7ac8fe2da716
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Mon Jun 23 15:02:51 2014 +0100
v2v: Create a shared StringMap module.
---
po/POTFILES-ml | 1 +
v2v/Makefile.am | 1 +
v2v/convert_linux.ml | 2 --
v2v/lib_linux.ml | 5 +----
v2v/stringMap.ml | 21 +++++++++++++++++++++
5 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/po/POTFILES-ml b/po/POTFILES-ml
index f8262d2..c46b187 100644
--- a/po/POTFILES-ml
+++ b/po/POTFILES-ml
@@ -87,6 +87,7 @@ v2v/convert_linux_grub.ml
v2v/convert_windows.ml
v2v/lib_linux.ml
v2v/source_libvirt.ml
+v2v/stringMap.ml
v2v/target_local.ml
v2v/types.ml
v2v/utils.ml
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index cdfa908..7735507 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -34,6 +34,7 @@ SOURCES_MLI = \
xml.mli
SOURCES_ML = \
+ stringMap.ml \
types.ml \
utils.ml \
xml.ml \
diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index a876c1e..50955db 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -34,8 +34,6 @@ open Types
module G = Guestfs
-module StringMap = Map.Make (String)
-
let rec convert ?(keep_serial_console = true) verbose (g : G.guestfs)
({ i_root = root; i_apps = apps }
as inspect) source =
diff --git a/v2v/lib_linux.ml b/v2v/lib_linux.ml
index 57a171a..dc33607 100644
--- a/v2v/lib_linux.ml
+++ b/v2v/lib_linux.ml
@@ -24,9 +24,6 @@ open Common_utils
open Types
open Utils
-module StringMap = Map.Make (String)
-let keys map = StringMap.fold (fun k _ ks -> k :: ks) map []
-
(* Wrappers around aug_init & aug_load which can dump out full Augeas
* parsing problems when debugging is enabled.
*)
@@ -68,7 +65,7 @@ and augeas_debug_errors g =
) map detail_paths
) StringMap.empty errors in
- let filenames = keys map in
+ let filenames = StringMap.keys map in
let filenames = List.sort compare filenames in
List.iter (
diff --git a/v2v/stringMap.ml b/v2v/stringMap.ml
new file mode 100644
index 0000000..159506b
--- /dev/null
+++ b/v2v/stringMap.ml
@@ -0,0 +1,21 @@
+(* virt-v2v
+ * Copyright (C) 2009-2014 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+include Map.Make (String)
+
+let keys map = fold (fun k _ ks -> k :: ks) map []
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list