v2v: Rename Domainxml -> Libvirt_utils.

The name 'Domainxml' made no sense.
This commit is contained in:
Richard W.M. Jones
2017-02-24 08:56:39 +00:00
parent 94f44b9983
commit ad9e9c98b5
13 changed files with 17 additions and 21 deletions

View File

@@ -388,6 +388,6 @@ utils/boot-analysis/boot-analysis.h
utils/boot-benchmark/boot-benchmark.c
utils/qemu-boot/qemu-boot.c
utils/qemu-speed-test/qemu-speed-test.c
v2v/domainxml-c.c
v2v/libvirt_utils-c.c
v2v/test-harness/dummy.c
v2v/utils-c.c

View File

@@ -30,7 +30,6 @@ SOURCES_MLI = \
convert_linux.mli \
convert_windows.mli \
DOM.mli \
domainxml.mli \
input_disk.mli \
input_libvirt.mli \
input_libvirt_other.mli \
@@ -39,6 +38,7 @@ SOURCES_MLI = \
input_libvirtxml.mli \
input_ova.mli \
inspect_source.mli \
libvirt_utils.mli \
linux.mli \
linux_bootloaders.mli \
linux_kernels.mli \
@@ -66,7 +66,7 @@ SOURCES_ML = \
utils.ml \
name_from_disk.ml \
vCenter.ml \
domainxml.ml \
libvirt_utils.ml \
DOM.ml \
changeuid.ml \
OVF.ml \
@@ -98,7 +98,7 @@ SOURCES_ML = \
v2v.ml
SOURCES_C = \
domainxml-c.c \
libvirt_utils-c.c \
utils-c.c
if HAVE_OCAML
@@ -161,7 +161,7 @@ virt_v2v_LINK = \
$(OBJECTS) -o $@
virt_v2v_copy_to_local_SOURCES = \
domainxml-c.c \
libvirt_utils-c.c \
utils-c.c
virt_v2v_copy_to_local_CPPFLAGS = \
-I. \
@@ -176,8 +176,8 @@ virt_v2v_copy_to_local_CFLAGS = \
COPY_TO_LOCAL_BOBJECTS = \
uefi.cmo \
utils.cmo \
libvirt_utils.cmo \
vCenter.cmo \
domainxml.cmo \
copy_to_local.cmo
COPY_TO_LOCAL_XOBJECTS = $(COPY_TO_LOCAL_BOBJECTS:.cmo=.cmx)

View File

@@ -130,7 +130,7 @@ read the man page virt-v2v-copy-to-local(1).
(* Get the remote libvirt XML. *)
message (f_"Fetching the remote libvirt XML metadata ...");
let xml = Domainxml.dumpxml ?password ~conn:input_conn guest_name in
let xml = Libvirt_utils.dumpxml ?password ~conn:input_conn guest_name in
debug "libvirt XML from remote server:\n%s" xml;

View File

@@ -37,7 +37,7 @@ let error_if_libvirt_does_not_support_json_backingfile () =
let libguestfs_backend = (open_guestfs ())#get_backend () in
let libguestfs_backend, _ = String.split ":" libguestfs_backend in
if libguestfs_backend = "libvirt" then (
if Domainxml.libvirt_get_version () < (2, 1, 0) then
if Libvirt_utils.libvirt_get_version () < (2, 1, 0) then
error (f_"because of libvirt bug https://bugzilla.redhat.com/1134878 you must EITHER upgrade to libvirt >= 2.1.0 OR set this environment variable:\n\nexport LIBGUESTFS_BACKEND=direct\n\nand then rerun the virt-v2v command.")
)
@@ -76,7 +76,7 @@ object
(* Get the libvirt XML. This also checks (as a side-effect)
* that the domain is not running. (RHBZ#1138586)
*)
let xml = Domainxml.dumpxml ?password ?conn:libvirt_uri guest in
let xml = Libvirt_utils.dumpxml ?password ?conn:libvirt_uri guest in
let source, disks =
Input_libvirtxml.parse_libvirt_xml ?conn:libvirt_uri xml in

View File

@@ -64,7 +64,7 @@ object
(* Get the libvirt XML. This also checks (as a side-effect)
* that the domain is not running. (RHBZ#1138586)
*)
let xml = Domainxml.dumpxml ?password ?conn:libvirt_uri guest in
let xml = Libvirt_utils.dumpxml ?password ?conn:libvirt_uri guest in
let source, disks = parse_libvirt_xml ?conn:libvirt_uri xml in
(* Find the <vmware:datacenterpath> element from the XML, if it

View File

@@ -44,7 +44,7 @@ object
(* Get the libvirt XML. This also checks (as a side-effect)
* that the domain is not running. (RHBZ#1138586)
*)
let xml = Domainxml.dumpxml ?password ?conn:libvirt_uri guest in
let xml = Libvirt_utils.dumpxml ?password ?conn:libvirt_uri guest in
let source, disks = parse_libvirt_xml ?conn:libvirt_uri xml in
(* Map the <source/> filename (which is relative to the remote

View File

@@ -277,7 +277,7 @@ let parse_libvirt_xml ?conn xml =
(match xpath_string "source/@pool", xpath_string "source/@volume" with
| None, None | Some _, None | None, Some _ -> ()
| Some pool, Some vol ->
let xml = Domainxml.vol_dumpxml ?conn pool vol in
let xml = Libvirt_utils.vol_dumpxml ?conn pool vol in
let doc = Xml.parse_memory xml in
let xpathctx = Xml.xpath_new_context doc in
let xpath_string = Xpath_helpers.xpath_string xpathctx in

View File

@@ -35,7 +35,7 @@ let libvirt_supports_json_raw_driver () =
let libguestfs_backend = (open_guestfs ())#get_backend () in
let libguestfs_backend, _ = String.split ":" libguestfs_backend in
if libguestfs_backend = "libvirt" then (
let sup = Domainxml.libvirt_get_version () >= (3, 1, 0) in
let sup = Libvirt_utils.libvirt_get_version () >= (3, 1, 0) in
debug "libvirt supports \"raw\" driver in json URL: %B" sup;
sup
)

View File

@@ -487,10 +487,6 @@ v2v_domain_exists (value connv, value domnamev)
CAMLreturn (Val_bool (domain_exists));
}
/* XXX This function is stuffed here for convenience (accessing
* libvirt), not because it belongs logically with the rest of the
* functions in this file.
*/
value
v2v_libvirt_get_version (value unitv)
{

View File

@@ -358,7 +358,7 @@ class output_libvirt oc output_pool = object
method prepare_targets source targets =
(* Get the capabilities from libvirt. *)
let xml = Domainxml.capabilities ?conn:oc () in
let xml = Libvirt_utils.capabilities ?conn:oc () in
debug "libvirt capabilities XML:\n%s" xml;
(* This just checks that the capabilities XML is well-formed,
@@ -373,7 +373,7 @@ class output_libvirt oc output_pool = object
capabilities_doc <- Some doc;
(* Does the domain already exist on the target? (RHBZ#889082) *)
if Domainxml.domain_exists ?conn:oc source.s_name then (
if Libvirt_utils.domain_exists ?conn:oc source.s_name then (
if source.s_hypervisor = Physical then (* virt-p2v user *)
error (f_"a libvirt domain called '%s' already exists on the target.\n\nIf using virt-p2v, select a different 'Name' in the 'Target properties'. Or delete the existing domain on the target using the 'virsh undefine' command.")
source.s_name
@@ -385,7 +385,7 @@ class output_libvirt oc output_pool = object
(* Connect to output libvirt instance and check that the pool exists
* and dump out its XML.
*)
let xml = Domainxml.pool_dumpxml ?conn:oc output_pool in
let xml = Libvirt_utils.pool_dumpxml ?conn:oc output_pool in
let doc = Xml.parse_memory xml in
let xpathctx = Xml.xpath_new_context doc in
let xpath_string = xpath_string xpathctx in

View File

@@ -52,7 +52,7 @@ let rec main () =
*)
if verbose () then (
try
let major, minor, release = Domainxml.libvirt_get_version () in
let major, minor, release = Libvirt_utils.libvirt_get_version () in
debug "libvirt version: %d.%d.%d" major minor release
with _ -> ()
);