[Pkg-libvirt-commits] [libguestfs] 02/146: v2v: Rename source field 's_dom_type' to 's_hypervisor'.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 17:00:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit e2bd2a65d283bf72a80e9d50d9084cf4fed473f2
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Nov 15 17:42:19 2014 +0000

    v2v: Rename source field 's_dom_type' to 's_hypervisor'.
    
    Also the source hypervisor cannot be "kvm".  Choose another example
    for the comment.
    
    For disks, set the source hypervisor string to "unknown".
    
    (cherry picked from commit 5920f7a56879d8d4ae2f13ba1978fb5235213a8b)
---
 v2v/input_disk.ml       | 2 +-
 v2v/input_libvirtxml.ml | 6 +++---
 v2v/input_ova.ml        | 2 +-
 v2v/types.ml            | 4 ++--
 v2v/types.mli           | 2 +-
 v2v/v2v.ml              | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml
index ef28b43..19dfbcb 100644
--- a/v2v/input_disk.ml
+++ b/v2v/input_disk.ml
@@ -80,7 +80,7 @@ class input_disk verbose input_format disk = object
     } in
 
     let source = {
-      s_dom_type = "kvm";
+      s_hypervisor = "unknown";
       s_name = name; s_orig_name = name;
       s_memory = 2048L *^ 1024L *^ 1024L; (* 2048 MB *)
       s_vcpu = 1;                         (* 1 vCPU is a safe default *)
diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index f06a1dd..b4ee9df 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -60,13 +60,13 @@ let parse_libvirt_xml ~verbose xml =
     )
   in
 
-  let dom_type = xpath_to_string "/domain/@type" "" in
+  let hypervisor = xpath_to_string "/domain/@type" "" in
   let name = xpath_to_string "/domain/name/text()" "" in
   let memory = xpath_to_int "/domain/memory/text()" (1024 * 1024) in
   let memory = Int64.of_int memory *^ 1024L in
   let vcpu = xpath_to_int "/domain/vcpu/text()" 1 in
 
-  if dom_type = "" then
+  if hypervisor = "" then
     error (f_"in the libvirt XML metadata, <domain type='...'> is missing or empty");
   if name = "" then
     error (f_"in the libvirt XML metadata, <name> is missing or empty");
@@ -247,7 +247,7 @@ let parse_libvirt_xml ~verbose xml =
     List.rev !nics in
 
   ({
-    s_dom_type = dom_type;
+    s_hypervisor = hypervisor;
     s_name = name; s_orig_name = name;
     s_memory = memory;
     s_vcpu = vcpu;
diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml
index d9928de..bff789b 100644
--- a/v2v/input_ova.ml
+++ b/v2v/input_ova.ml
@@ -285,7 +285,7 @@ object
     done;
 
     let source = {
-      s_dom_type = "vmware";
+      s_hypervisor = "vmware";
       s_name = name;
       s_orig_name = name;
       s_memory = memory;
diff --git a/v2v/types.ml b/v2v/types.ml
index c5a05f6..580ece0 100644
--- a/v2v/types.ml
+++ b/v2v/types.ml
@@ -21,7 +21,7 @@ open Printf
 (* Types.  See types.mli for documentation. *)
 
 type source = {
-  s_dom_type : string;
+  s_hypervisor : string;
   s_name : string;
   s_orig_name : string;
   s_memory : int64;
@@ -70,7 +70,7 @@ NICs:
 %s
 "
     s.s_name
-    s.s_dom_type
+    s.s_hypervisor
     s.s_memory
     s.s_vcpu
     (String.concat "," s.s_features)
diff --git a/v2v/types.mli b/v2v/types.mli
index 2123a41..f02acb2 100644
--- a/v2v/types.mli
+++ b/v2v/types.mli
@@ -19,7 +19,7 @@
 (** Types. *)
 
 type source = {
-  s_dom_type : string;                  (** Source domain type, eg "kvm" *)
+  s_hypervisor : string;                (** Source hypervisor, eg "vmware" *)
   s_name : string;                      (** Guest name. *)
   s_orig_name : string;                 (** Original guest name (if we rename
                                             the guest using -on, original is
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index dafbdbf..5b3bfa6 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -73,7 +73,7 @@ let rec main () =
 
   if verbose then printf "%s%!" (string_of_source source);
 
-  assert (source.s_dom_type <> "");
+  assert (source.s_hypervisor <> "");
   assert (source.s_name <> "");
   assert (source.s_memory > 0L);
   assert (source.s_vcpu >= 1);

-- 
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