[Pkg-libvirt-commits] [libguestfs] 05/12: v2v: -o rhev/vdsm: In --no-copy case, use estimate for ovf:actual_size (RHBZ#1140156).
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:45:28 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.45-1
in repository libguestfs.
commit 88dea548031db0eaccc08b63c4ee1e3644cd0e83
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Sat Sep 13 16:44:47 2014 +0100
v2v: -o rhev/vdsm: In --no-copy case, use estimate for ovf:actual_size (RHBZ#1140156).
---
v2v/lib_ovf.ml | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/v2v/lib_ovf.ml b/v2v/lib_ovf.ml
index 5a56af4..cac1012 100644
--- a/v2v/lib_ovf.ml
+++ b/v2v/lib_ovf.ml
@@ -329,17 +329,20 @@ and add_disks targets guestcaps output_alloc sd_uuid image_uuid vol_uuids ovf =
let size_gb =
Int64.to_float ov.ov_virtual_size /. 1024. /. 1024. /. 1024. in
let usage_gb =
- (* In the --no-copy case it can happen that the target file
- * does not exist. In that case we simply omit the
- * ovf:actual_size attribute.
- *)
if Sys.file_exists t.target_file then (
let usage_mb = du_m t.target_file in
if usage_mb > 0L then (
let usage_gb = Int64.to_float usage_mb /. 1024. in
Some usage_gb
) else None
- ) else None in
+ ) else (
+ (* In the --no-copy case the target file does not exist. In
+ * that case we use the estimated size.
+ *)
+ match t.target_estimated_size with
+ | None -> None
+ | Some size -> Some (Int64.to_float size /. 1024. /. 1024. /. 1024.)
+ ) in
let format_for_rhev =
match t.target_format with
--
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