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

Re: [Xen-API] [PATCH] CA-40882: In the SLES 10SP2 kernel the 3 VIF limit

To: Jonathan Knowles <Jonathan.Knowles@xxxxxxxxxxxxx>
Subject: Re: [Xen-API] [PATCH] CA-40882: In the SLES 10SP2 kernel the 3 VIF limit was removed so remove this limit in the template
From: Alex Zeffertt <alex.zeffertt@xxxxxxxxxxxxx>
Date: Tue, 27 Apr 2010 17:32:20 +0100
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 27 Apr 2010 09:32:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BD71012.9020804@xxxxxxxxxxxxx>
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>
References: <05274dded7d6c3a78b44.1272380329@galois> <4BD71012.9020804@xxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
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

<Prev in Thread] Current Thread [Next in Thread>