[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-API] [PATCH] [PATCH] Fix sparseness (again) on copy, import
# 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 _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |