Hi Alex
Thanks for sending in this patch.
This patch duplicates the sles10 template function, so that we end
up with two almost identical copies of the same section of code:
On 27/04/10 15:58, Alex Zeffertt wrote:
+let sles10sp1_template name architecture flags =
+       let name = make_long_name name architecture in
+       let install_arch = technical_string_of_architecture architecture in
+       let bt = eli_install_template (default_memory_parameters 512L) name "sleslike" 
true "console=ttyS0 xencons=ttyS" in
+       { bt with
+               vM_other_config = (install_methods_otherconfig_key, "cdrom,nfs,http,ftp") 
:: ("install-arch",install_arch) :: bt.vM_other_config;
+               vM_recommendations = recommendations ~memory:32 ~vifs:3 ();
+       }
+
  let sles10_template name architecture flags =
        let name = make_long_name name architecture in
        let install_arch = technical_string_of_architecture architecture in
        let bt = eli_install_template (default_memory_parameters 512L) name "sleslike" 
true "console=ttyS0 xencons=ttyS" in
        { bt with
                vM_other_config = (install_methods_otherconfig_key, "cdrom,nfs,http,ftp") 
:: ("install-arch",install_arch) :: bt.vM_other_config;
-               vM_recommendations = recommendations ~memory:32 ~vifs:3 ();
+               vM_recommendations = recommendations ~memory:32 ();
        }
Why not instead parameterize the function, so that we have 
something like:
  let sles10_template name architecture flags ?vifs =
        let name = make_long_name name architecture in
        let install_arch = technical_string_of_architecture architecture in
        let bt = eli_install_template (default_memory_parameters 512L) name "sleslike" 
true "console=ttyS0 xencons=ttyS" in
        { bt with
                vM_other_config = (install_methods_otherconfig_key, "cdrom,nfs,http,ftp") 
:: ("install-arch",install_arch) :: bt.vM_other_config;
                vM_recommendations = recommendations ~memory:32 ?vifs ();
        }
And then at the call sites we can write:
        sles_9_template "SUSE Linux Enterprise Server 9 SP4"  X32 [    ]  ;
        sles10_template "SUSE Linux Enterprise Server 10 SP1" X32 [    ] 3;
        sles10_template "SUSE Linux Enterprise Server 10 SP2" X32 [    ]  ;
        sles11_template "SUSE Linux Enterprise Server 11"     X32 [    ]  ;
        sles10_template "SUSE Linux Enterprise Server 10 SP1" X64 [    ] 3;
        sles10_template "SUSE Linux Enterprise Server 10 SP2" X64 [    ]  ;
        sles10_template "SUSE Linux Enterprise Server 10 SP3" X64 [    ]  ;
        sles11_template "SUSE Linux Enterprise Server 11"     X64 [    ]  ;
Or similar?
Cheers,
Jonathan