Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 853937 Details for
Bug 1056640
virt-v2v OVA/OVF import fails when no (optional) ovf:capacityAllocationUnits is specified
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch to solve a few disk sizing issues
proposed-1056640.patch (text/plain), 2.24 KB, created by
Ronald van Zantvoort
on 2014-01-22 16:07:51 UTC
(
hide
)
Description:
Proposed patch to solve a few disk sizing issues
Filename:
MIME Type:
Creator:
Ronald van Zantvoort
Created:
2014-01-22 16:07:51 UTC
Size:
2.24 KB
patch
obsolete
>--- /usr/share/perl5/vendor_perl/Sys/VirtConvert/Connection/VMwareOVASource.pm 2013-08-09 00:02:58.000000000 +0200 >+++ ./VMwareOVASource-p1056640.pm 2014-01-22 17:05:01.749831803 +0100 >@@ -1,4 +1,4 @@ >-# Sys::VirtConvert::Connection::VMwareOVASource >+# # Sys::VirtConvert::Connection::VMwareOVASource > # Copyright (C) 2012 Red Hat Inc. > # > # This library is free software; you can redistribute it and/or >@@ -243,6 +243,43 @@ > return $input_number; > } > >+#Translate a unit field into bytes per unit >+sub _get_byte_units >+{ >+ my $units = @_; >+ >+ #$1 = kilo,mega,giga >+ #$2 = s >+ #$3 = group w/calc >+ #$4 = 2 | 10 (^$5) >+ #$5 = ^digit >+ $units =~ /^(kilo|mega|giga){0,1}byte(s){0,1}([\s]*\*[\s]*(\d+)[\s]*\^[\s]*(\d+)){0,1}[\s]*$/i or die "Unexpected unit specification: $units"; >+ >+ my $byte_size; >+ #Can't find references in the OVA spec to binary/decimal counting, >+ #other than that units are supposed to be logical. >+ #In the case of any computer, binary logic is logical. >+ #In the case of HD's and SI in general, HW vendors like decimal. >+ #OVF doesn't seem to allow the -bi syntax, >+ #leaving the issue out to dry. I'm going to assume binary. >+ if(defined($1)) { >+ if ($1 =~ "[Kk]ilo"){ >+ $byte_size = 1024; >+ } elsif ($1 =~ "[Mm]ega"){ >+ $byte_size = 1024 * 1024; >+ } elsif ($1 =~ "[Gg]iga"){ >+ $byte_size = 1024 * 1024 * 1024; >+ } else { >+ die "Unexpected unit specification: $units"; >+ } >+ } else { >+ $byte_size = 1; >+ } >+ >+ if(defined($3)) { >+ $byte_size = $byte_size * $4 ** $5; >+ } >+} > > # to double check for errors > >@@ -307,9 +344,11 @@ > my $usage = _node_val($disk, '@ovf:populatedSize'); > > my $units = _node_val($disk, '@ovf:capacityAllocationUnits'); >- $units =~ /^byte \* 2\^(\d+)$/ >- or die "Unexpected ovf:capacityAllocationUnits: $units"; >- $units = 2 ** $1; >+ if (defined($units)){ >+ $units = _get_byte_units($units); >+ } else { >+ $units = 1; >+ } > my $size = _node_val($disk, '@ovf:capacity') * $units; > > my $is_block = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1056640
: 853937