Blame SOURCES/0019-v2v-vcenter-Hoist-readahead-configurables-to-top-of-.patch

0d20ef
From 13eb44980b6d791d1e8264b84fb9dfcefd82577f Mon Sep 17 00:00:00 2001
0d20ef
From: "Richard W.M. Jones" <rjones@redhat.com>
0d20ef
Date: Mon, 20 Oct 2014 21:48:08 +0100
0d20ef
Subject: [PATCH] v2v: vcenter: Hoist readahead configurables to top of file.
0d20ef
0d20ef
No change, just code motion.
0d20ef
0d20ef
(cherry picked from commit 496d0c45bc5e8c361d2cccb20b0f3a64443b05ab)
0d20ef
---
0d20ef
 v2v/input_libvirt_vcenter_https.ml | 11 +++++++++--
0d20ef
 1 file changed, 9 insertions(+), 2 deletions(-)
0d20ef
0d20ef
diff --git a/v2v/input_libvirt_vcenter_https.ml b/v2v/input_libvirt_vcenter_https.ml
0d20ef
index 5d98a86..71c2edd 100644
0d20ef
--- a/v2v/input_libvirt_vcenter_https.ml
0d20ef
+++ b/v2v/input_libvirt_vcenter_https.ml
0d20ef
@@ -28,6 +28,10 @@ open Input_libvirt_other
0d20ef
 
0d20ef
 open Printf
0d20ef
 
0d20ef
+(* See RHBZ#1151033 and RHBZ#1153589. *)
0d20ef
+let readahead_for_conversion = None
0d20ef
+let readahead_for_copying = Some (64 * 1024 * 1024)
0d20ef
+
0d20ef
 (* Return the session cookie.  It is memoized, so you can call this
0d20ef
  * as often as required.
0d20ef
  *)
0d20ef
@@ -244,7 +248,9 @@ object
0d20ef
 
0d20ef
     let disks = List.map (
0d20ef
       fun ({ s_qemu_uri = path } as disk) ->
0d20ef
-        let qemu_uri = map_source_to_uri verbose parsed_uri scheme server path in
0d20ef
+        let readahead = readahead_for_conversion in
0d20ef
+        let qemu_uri = map_source_to_uri ?readahead
0d20ef
+	  verbose parsed_uri scheme server path in
0d20ef
 
0d20ef
         (* The libvirt ESX driver doesn't normally specify a format, but
0d20ef
          * the format of the -flat file is *always* raw, so force it here.
0d20ef
@@ -260,7 +266,8 @@ object
0d20ef
       try Hashtbl.find saved_source_paths overlay.ov_source.s_disk_id
0d20ef
       with Not_found -> failwith "internal error in adjust_overlay_parameters" in
0d20ef
     let backing_qemu_uri =
0d20ef
-      map_source_to_uri ~readahead:(64 * 1024 * 1024)
0d20ef
+      let readahead = readahead_for_copying in
0d20ef
+      map_source_to_uri ?readahead
0d20ef
         verbose parsed_uri scheme server orig_path in
0d20ef
 
0d20ef
     (* Rebase the qcow2 overlay to adjust the readahead parameter. *)
0d20ef
-- 
0d20ef
1.8.3.1
0d20ef