Fix detection of guest minor version.
[import-to-ovirt.git] / import-to-ovirt.pl
index 2828172..7052cce 100755 (executable)
@@ -259,7 +259,7 @@ my $type = $g->inspect_get_type ($root);
 my $distro = $g->inspect_get_distro ($root);
 my $arch = $g->inspect_get_arch ($root);
 my $major_version = $g->inspect_get_major_version ($root);
-my $minor_version = $g->inspect_get_major_version ($root);
+my $minor_version = $g->inspect_get_minor_version ($root);
 my $product_name = $g->inspect_get_product_name ($root);
 my $product_variant = $g->inspect_get_product_variant ($root);
 
@@ -510,8 +510,9 @@ my %prefix_map = (
 );
 my @forced_ns_decls = keys %prefix_map;
 
+my $ovf = "";
 my $w = XML::Writer->new (
-    OUTPUT => "self",
+    OUTPUT => \$ovf,
     NAMESPACES => 1,
     PREFIX_MAP => \%prefix_map,
     FORCED_NS_DECLS => \@forced_ns_decls,
@@ -782,8 +783,6 @@ $w->endTag ("Content");
 $w->endTag ([$ovf_ns, "Envelope"]);
 $w->end ();
 
-my $ovf = $w->to_string;
-
 #print "OVF:\n$ovf\n";
 
 my $ovf_dir = "$esd_uuid_dir/master/vms/$vm_uuid";