WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] [PATCH] Fix sparseness (again) on copy, import

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] [PATCH] Fix sparseness (again) on copy, import
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 23 Nov 2009 15:40:20 +0000
Delivery-date: Mon, 23 Nov 2009 07:35:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1258990688 0
# Node ID ab7344e2e59c715484bc85d858e69e2ce2786920
# Parent  1d27457a84aa1b55617205921ca46462300beaf5
Change the function which determines whether to explicitly write zeroes into 
VDIs during copies and imports.

We still default to not writing zeroes (hoping to preserve sparseness) but will 
write zeroes if:
* SM backend is one of [ lvm, lvmoiscsi, lvmohba ] AND EITHER (i) we've not 
"upgraded"; OR (ii) we've requested a "raw" volume
* SM backend is an Equalogic in "thick" mode
* SM backend is of type CSLG

Clearly this logic is in the wrong place...

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>
Acked-by: Jonathan Ludlam <jonathan.ludlam@xxxxxxxxxxxxx>

diff -r 1d27457a84aa -r ab7344e2e59c ocaml/xapi/sm_fs_ops.ml
--- a/ocaml/xapi/sm_fs_ops.ml   Fri Nov 20 08:35:32 2009 -0500
+++ b/ocaml/xapi/sm_fs_ops.ml   Mon Nov 23 15:38:08 2009 +0000
@@ -205,11 +205,23 @@
   let potentially_using_lvhd sr_r = List.mem (String.lowercase 
sr_r.API.sR_type) [ "lvm"; "lvmoiscsi"; "lvmohba" ] in
   let requested_raw_vdi vdi_r = List.mem (List.hd 
Xha_statefile.statefile_sm_config) vdi_r.API.vDI_sm_config in
   let upgraded_to_lvhd sr_r = List.mem ("use_vhd", "true") 
sr_r.API.sR_sm_config in
+
+  (* Equallogic arrays in 'thick' mode don't zero disks *)
+  let using_eql sr_r = String.lowercase sr_r.API.sR_type =  "equal" in
+  let using_eql_thick sr_r = List.mem ("allocation", "thick") (List.map (fun 
(x, y) -> String.lowercase x, String.lowercase y) sr_r.API.sR_sm_config) in
+
+  (* We presume that storagelink arrays don't zero disks either *)
+  let using_csl sr_r = String.lowercase sr_r.API.sR_type = "cslg" in
+
   (* Julian agreed with the following logic by email + chat: *)
-  potentially_using_lvhd sr_r
-  && ((requested_raw_vdi vdi_r) ||   (* requested RAW on an LVHD backend *)
-       (not (upgraded_to_lvhd sr_r))) (* => all VDIs will still be RAW *)
-  
+  false
+  || (potentially_using_lvhd sr_r
+         && ((requested_raw_vdi vdi_r) || (not (upgraded_to_lvhd sr_r)))
+        )
+  (* After speaking to Julian again: *)
+  || (using_eql sr_r && (using_eql_thick sr_r))
+  || (using_csl sr_r)
+
 
 let copy_vdi ~__context vdi_src vdi_dst = 
   TaskHelper.set_cancellable ~__context;
1 file changed, 16 insertions(+), 4 deletions(-)
ocaml/xapi/sm_fs_ops.ml |   20 ++++++++++++++++----


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] [PATCH] Fix sparseness (again) on copy, import, David Scott <=