[Pkg-libvirt-commits] [libguestfs] 194/266: v2v: -i libvirt/libvirtxml: Check that domain type, name, arch are not missing.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:42:01 UTC 2014


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

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit 7aced6ffb20c27af725040abc4faecf3ddc61010
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Aug 27 14:42:44 2014 +0100

    v2v: -i libvirt/libvirtxml: Check that domain type, name, arch are not missing.
    
    This can lead to incorrect output.
---
 v2v/input_libvirtxml.ml | 7 +++++++
 v2v/virt-v2v.pod        | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index 6b9bfdf..663a2f5 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -58,6 +58,13 @@ let parse_libvirt_xml ?(map_source_file = identity) ?(map_source_dev = identity)
   let vcpu = xpath_to_int "/domain/vcpu/text()" 1 in
   let arch = xpath_to_string "/domain/os/type/@arch" "" in
 
+  if dom_type = "" 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");
+  if arch = "" then
+    error (f_"in the libvirt XML metadata, <os><type arch='...'> is missing or empty");
+
   let features =
     let features = ref [] in
     let obj = Xml.xpath_eval_expression xpathctx "/domain/features/*" in
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index 5b4edcc..5b3393e 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -624,7 +624,7 @@ that instead.
    <memory>1048576</memory>
    <vcpu>2</vcpu>
    <os>
-     <type>hvm</type>
+     <type arch='x86_64'>hvm</type>
      <boot dev='hd'/>
    </os>
    <features>

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