[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-API] [PATCH] CA-40882: In the SLES 10SP2 kernel the 3 VIF limit was removed so remove this limit in the template



Hi Jonathan,

Please feel free to modify the patch and resubmit. I chose the cut'n'paste method because it was easier to get right, and I'm not an ocaml programmer :-)

Regards,

Alex

Jonathan Knowles wrote:
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



_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.