[Pkg-libvirt-commits] [libguestfs] 165/266: v2v: -i libvirt: Select sensible defaults if <memory> or <vcpu> is missing from input XML.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:57 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 318a1b17a6be2e20245ca05a68448b5dcd048884
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Aug 21 23:38:34 2014 +0100

    v2v: -i libvirt: Select sensible defaults if <memory> or <vcpu> is missing from input XML.
    
    If the <memory> or <vcpu> elements was missing from the source
    metadata then we would choose useless defaults, resulting in (for
    example) <vcpu>0</vcpu> being written to the output.
    
    Choose sensible defaults for these integer values.
---
 v2v/input_libvirt.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/v2v/input_libvirt.ml b/v2v/input_libvirt.ml
index fed6438..c2d156e 100644
--- a/v2v/input_libvirt.ml
+++ b/v2v/input_libvirt.ml
@@ -60,9 +60,9 @@ object
 
     let dom_type = xpath_to_string "/domain/@type" "" in
     let name = xpath_to_string "/domain/name/text()" "" in
-    let memory = xpath_to_int "/domain/memory/text()" 0 in
+    let memory = xpath_to_int "/domain/memory/text()" (1024L *^ 1024L) in
     let memory = Int64.of_int memory *^ 1024L in
-    let vcpu = xpath_to_int "/domain/vcpu/text()" 0 in
+    let vcpu = xpath_to_int "/domain/vcpu/text()" 1 in
     let arch = xpath_to_string "/domain/os/type/@arch" "" in
 
     let 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