From 632803856701bd664f8f482a5bfcaed6715cd36e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 9 Oct 2014 18:07:33 +0100 Subject: [PATCH] v2v: Rename some modules to remove lib_ prefix. v2v/lib_ovf.ml -> v2v/OVF.ml v2v/lib_ovf.mli -> v2v/OVF.mli v2v/lib_linux.ml -> v2v/linux.ml v2v/lib_linux.mli -> v2v/linux.mli v2v/lib_esx.ml -> v2v/vCenter.ml v2v/lib_esx.mli -> v2v/vCenter.mli v2v/lib_xen.ml -> v2v/xen.ml v2v/lib_xen.mli -> v2v/xen.mli --- po/POTFILES-ml | 8 ++++---- v2v/Makefile.am | 16 ++++++++-------- v2v/{lib_ovf.ml => OVF.ml} | 0 v2v/{lib_ovf.mli => OVF.mli} | 0 v2v/convert_linux.ml | 26 +++++++++++++------------- v2v/input_libvirt.ml | 4 ++-- v2v/{lib_linux.ml => linux.ml} | 0 v2v/{lib_linux.mli => linux.mli} | 0 v2v/output_rhev.ml | 4 ++-- v2v/output_vdsm.ml | 4 ++-- v2v/{lib_esx.ml => vCenter.ml} | 0 v2v/{lib_esx.mli => vCenter.mli} | 0 v2v/{lib_xen.ml => xen.ml} | 0 v2v/{lib_xen.mli => xen.mli} | 0 14 files changed, 31 insertions(+), 31 deletions(-) rename v2v/{lib_ovf.ml => OVF.ml} (100%) rename v2v/{lib_ovf.mli => OVF.mli} (100%) rename v2v/{lib_linux.ml => linux.ml} (100%) rename v2v/{lib_linux.mli => linux.mli} (100%) rename v2v/{lib_esx.ml => vCenter.ml} (100%) rename v2v/{lib_esx.mli => vCenter.mli} (100%) rename v2v/{lib_xen.ml => xen.ml} (100%) rename v2v/{lib_xen.mli => xen.mli} (100%) diff --git a/po/POTFILES-ml b/po/POTFILES-ml index 8fd0f86bc..df39e7b53 100644 --- a/po/POTFILES-ml +++ b/po/POTFILES-ml @@ -84,6 +84,7 @@ sysprep/sysprep_operation_utmp.ml sysprep/sysprep_operation_yum_uuid.ml v2v/DOM.ml v2v/JSON.ml +v2v/OVF.ml v2v/cmdline.ml v2v/convert_linux.ml v2v/convert_windows.ml @@ -93,10 +94,7 @@ v2v/input_libvirt.ml v2v/input_libvirtxml.ml v2v/input_ova.ml v2v/kvmuid.ml -v2v/lib_esx.ml -v2v/lib_linux.ml -v2v/lib_ovf.ml -v2v/lib_xen.ml +v2v/linux.ml v2v/modules_list.ml v2v/output_glance.ml v2v/output_libvirt.ml @@ -109,4 +107,6 @@ v2v/stringMap.ml v2v/types.ml v2v/utils.ml v2v/v2v.ml +v2v/vCenter.ml +v2v/xen.ml v2v/xml.ml diff --git a/v2v/Makefile.am b/v2v/Makefile.am index 41b7aaa1c..8bf8f07d9 100644 --- a/v2v/Makefile.am +++ b/v2v/Makefile.am @@ -39,10 +39,7 @@ SOURCES_MLI = \ input_ova.mli \ JSON.mli \ kvmuid.mli \ - lib_esx.mli \ - lib_linux.mli \ - lib_ovf.mli \ - lib_xen.mli \ + linux.mli \ modules_list.mli \ output_glance.mli \ output_libvirt.mli \ @@ -51,8 +48,11 @@ SOURCES_MLI = \ output_qemu.mli \ output_rhev.mli \ output_vdsm.mli \ + OVF.mli \ stringMap.mli \ types.mli \ + vCenter.mli \ + xen.mli \ xml.mli SOURCES_ML = \ @@ -64,10 +64,10 @@ SOURCES_ML = \ DOM.ml \ JSON.ml \ kvmuid.ml \ - lib_esx.ml \ - lib_xen.ml \ - lib_ovf.ml \ - lib_linux.ml \ + vCenter.ml \ + xen.ml \ + OVF.ml \ + linux.ml \ modules_list.ml \ input_disk.ml \ input_libvirtxml.ml \ diff --git a/v2v/lib_ovf.ml b/v2v/OVF.ml similarity index 100% rename from v2v/lib_ovf.ml rename to v2v/OVF.ml diff --git a/v2v/lib_ovf.mli b/v2v/OVF.mli similarity index 100% rename from v2v/lib_ovf.mli rename to v2v/OVF.mli diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index 42a83bb8c..6c0c90349 100644 --- a/v2v/convert_linux.ml +++ b/v2v/convert_linux.ml @@ -80,7 +80,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = assert (inspect.i_package_format = "rpm"); (* We use Augeas for inspection and conversion, so initialize it early. *) - Lib_linux.augeas_init verbose g; + Linux.augeas_init verbose g; (* Clean RPM database. This must be done early to avoid RHBZ#1143866. *) let dbfiles = g#glob_expand "/var/lib/rpm/__db.00?" in @@ -148,7 +148,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = when name = "kernel" || string_prefix name "kernel-" -> (try (* For each kernel, list the files directly owned by the kernel. *) - let files = Lib_linux.file_list_of_package verbose g inspect name in + let files = Linux.file_list_of_package verbose g inspect name in (* Which of these is the kernel itself? *) let vmlinuz = List.find ( @@ -394,7 +394,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = List.exists (fun incl -> g#aug_get incl = grub_config) incls in if not incls_contains_conf then ( g#aug_set "/augeas/load/Grub/incl[last()+1]" grub_config; - Lib_linux.augeas_reload verbose g; + Linux.augeas_reload verbose g; ) | `Grub2 -> () (* Not necessary for grub2. *) @@ -416,7 +416,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = else None ) inspect.i_apps in - Lib_linux.remove verbose g inspect xenmods; + Linux.remove verbose g inspect xenmods; (* Undo related nastiness if kmod-xenpv was installed. *) if xenmods <> [] then ( @@ -431,7 +431,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = (* Check it's not owned by an installed application. *) let dirs = List.filter ( - fun d -> not (Lib_linux.is_file_owned verbose g inspect d) + fun d -> not (Linux.is_file_owned verbose g inspect d) ) dirs in (* Remove any unowned xenpv directories. *) @@ -489,7 +489,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = fun { G.app2_name = name } -> name = package_name ) inspect.i_apps in if has_guest_additions then - Lib_linux.remove verbose g inspect [package_name]; + Linux.remove verbose g inspect [package_name]; (* Guest Additions might have been installed from a tarball. The * above code won't detect this case. Look for the uninstall tool @@ -521,7 +521,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = ignore (g#command [| vboxuninstall |]); (* Reload Augeas to detect changes made by vbox tools uninst. *) - Lib_linux.augeas_reload verbose g + Linux.augeas_reload verbose g with G.Error msg -> warning ~prog (f_"VirtualBox Guest Additions were detected, but uninstallation failed. The error message was: %s (ignored)") @@ -600,7 +600,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = ); let remove = !remove in - Lib_linux.remove verbose g inspect remove; + Linux.remove verbose g inspect remove; (* VMware Tools may have been installed from a tarball, so the * above code won't remove it. Look for the uninstall tool and run @@ -612,7 +612,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = ignore (g#command [| uninstaller |]); (* Reload Augeas to detect changes made by vbox tools uninst. *) - Lib_linux.augeas_reload verbose g + Linux.augeas_reload verbose g with G.Error msg -> warning ~prog (f_"VMware tools was detected, but uninstallation failed. The error message was: %s (ignored)") @@ -627,7 +627,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = let pkgs = List.map (fun { G.app2_name = name } -> name) pkgs in if pkgs <> [] then ( - Lib_linux.remove verbose g inspect pkgs; + Linux.remove verbose g inspect pkgs; (* Installing these guest utilities automatically unconfigures * ttys in /etc/inittab if the system uses it. We need to put @@ -680,7 +680,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = g#ln_sf "/boot/grub/grub.conf" "/etc/grub.conf"; (* Reload Augeas to pick up new location of grub.conf. *) - Lib_linux.augeas_reload verbose g; + Linux.augeas_reload verbose g; ignore (g#command [| "grub-install"; dev |]) @@ -688,7 +688,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = (* EFI systems boot using grub2-efi, and probably don't have the * base grub2 package installed. *) - Lib_linux.install verbose g inspect ["grub2"]; + Linux.install verbose g inspect ["grub2"]; (* Relabel the EFI boot partition as a BIOS boot partition. *) g#part_set_gpt_type dev 1 "21686148-6449-6E6F-744E-656564454649"; @@ -1350,7 +1350,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source = if grub = `Grub2 then ignore (g#command [| "grub2-mkconfig"; "-o"; grub_config |]); - Lib_linux.augeas_reload verbose g + Linux.augeas_reload verbose g ); (* Delete blkid caches if they exist, since they will refer to the old diff --git a/v2v/input_libvirt.ml b/v2v/input_libvirt.ml index 9e8b51067..def58bda8 100644 --- a/v2v/input_libvirt.ml +++ b/v2v/input_libvirt.ml @@ -86,13 +86,13 @@ object | Some server, Some ("esx"|"gsx"|"vpx" as scheme) -> (* ESX *) error_if_libvirt_backend (); - let f = Lib_esx.map_path_to_uri verbose uri scheme server in + let f = VCenter.map_path_to_uri verbose uri scheme server in Some f, Some f | Some server, Some ("xen+ssh" as scheme) -> (* Xen over SSH *) error_if_libvirt_backend (); error_if_no_ssh_agent (); - let f = Lib_xen.map_path_to_uri verbose uri scheme server in + let f = Xen.map_path_to_uri verbose uri scheme server in Some f, Some f (* Old virt-v2v also supported qemu+ssh://. However I am diff --git a/v2v/lib_linux.ml b/v2v/linux.ml similarity index 100% rename from v2v/lib_linux.ml rename to v2v/linux.ml diff --git a/v2v/lib_linux.mli b/v2v/linux.mli similarity index 100% rename from v2v/lib_linux.mli rename to v2v/linux.mli diff --git a/v2v/output_rhev.ml b/v2v/output_rhev.ml index 9dd02ba87..0671e142b 100644 --- a/v2v/output_rhev.ml +++ b/v2v/output_rhev.ml @@ -245,7 +245,7 @@ object (* Generate the .meta file associated with each volume. *) let metas = - Lib_ovf.create_meta_files verbose output_alloc esd_uuid image_uuids + OVF.create_meta_files verbose output_alloc esd_uuid image_uuids targets in List.iter ( fun ({ target_file = target_file }, meta) -> @@ -278,7 +278,7 @@ object (* This is called after conversion to write the OVF metadata. *) method create_metadata source targets guestcaps inspect = (* Create the metadata. *) - let ovf = Lib_ovf.create_ovf verbose source targets guestcaps inspect + let ovf = OVF.create_ovf verbose source targets guestcaps inspect output_alloc vmtype esd_uuid image_uuids vol_uuids vm_uuid in (* Write it to the metadata file. *) diff --git a/v2v/output_vdsm.ml b/v2v/output_vdsm.ml index 451bf32ad..293f57ffe 100644 --- a/v2v/output_vdsm.ml +++ b/v2v/output_vdsm.ml @@ -131,7 +131,7 @@ object (* Generate the .meta files associated with each volume. *) let metas = - Lib_ovf.create_meta_files verbose output_alloc dd_uuid + OVF.create_meta_files verbose output_alloc dd_uuid vdsm_params.image_uuids targets in List.iter ( fun ({ target_file = target_file }, meta) -> @@ -157,7 +157,7 @@ object (* This is called after conversion to write the OVF metadata. *) method create_metadata source targets guestcaps inspect = (* Create the metadata. *) - let ovf = Lib_ovf.create_ovf verbose source targets guestcaps inspect + let ovf = OVF.create_ovf verbose source targets guestcaps inspect output_alloc vmtype dd_uuid vdsm_params.image_uuids vdsm_params.vol_uuids diff --git a/v2v/lib_esx.ml b/v2v/vCenter.ml similarity index 100% rename from v2v/lib_esx.ml rename to v2v/vCenter.ml diff --git a/v2v/lib_esx.mli b/v2v/vCenter.mli similarity index 100% rename from v2v/lib_esx.mli rename to v2v/vCenter.mli diff --git a/v2v/lib_xen.ml b/v2v/xen.ml similarity index 100% rename from v2v/lib_xen.ml rename to v2v/xen.ml diff --git a/v2v/lib_xen.mli b/v2v/xen.mli similarity index 100% rename from v2v/lib_xen.mli rename to v2v/xen.mli