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

Re: [Xen-devel] [OSSTEST Nested PATCH v8 3/7] Edit some APIs in TestSupport.pm for nested test



On Mon, 2015-04-13 at 17:19 -0400, longtao.pang wrote:
> 1. Designate vif model by make-flight.
> 2. In L2 installation context, its host (L1) IP address is not queried
> from DNS, but after running "ts-nested-setup + host + nested", L1 IP is
> stored in runvar.
> 
> Signed-off-by: longtao.pang <longtaox.pang@xxxxxxxxx>
> ---
> Changes in v8:
> Remove the unnecessary symbol of ';' in 'TestSupport.pm'.
> ---
>  Osstest/TestSupport.pm |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
> index 1bde67d..4cdacfc 100644
> --- a/Osstest/TestSupport.pm
> +++ b/Osstest/TestSupport.pm
> @@ -818,6 +818,10 @@ sub selecthost ($) {
>       logm("Host $name is in HostGroup $ho->{Properties}{HostGroup}");
>      }
>  
> +    if ( $r{"${name}_ip"} ) {
> +        $setprop->("IpAddr", $r{"${name}_ip"});
> +    }

This is one for Ian I think, but I suspect this should use ${ident}
rather than ${name}. 

${ident} is e.g. 'host' or 'srchost' or 'nestedl1' it is the prefer used
on the runvar names. ${name} is the specific value assigned, i.e. an
actual host name.

For such properties we usually prefer ${ident}_foo. Ian, correct me if
I'm wrong please.

> +
>      # Next, we use the config file's general properites as defaults
>      foreach my $k (keys %c) {
>       next unless $k =~ m/^HostProp_([A-Z].*)$/;
> @@ -1548,11 +1552,13 @@ sub prepareguest_part_xencfg ($$$$$) {
>      my $oncrash= $xopts->{OnCrash} || 'preserve';
>      my $vcpus= guest_var($gho, 'vcpus', $xopts->{DefVcpus} || 2);
>      my $xoptcfg= $xopts->{ExtraConfig};
> +    my $vif= guest_var($gho, 'vifmodel','');
> +    my $vifmodel= $vif ? "model=$vif" : '';
>      $xoptcfg='' unless defined $xoptcfg;
>      my $xencfg= <<END;
>  name        = '$gho->{Name}'
>  memory = ${ram_mb}
> -vif         = [ 'type=ioemu,mac=$gho->{Ether}' ]
> +vif         = [ 'type=ioemu,${vifmodel},mac=$gho->{Ether}' ]

If $vifmodel=='' then this will end up with a literal ",," in the
configuration. I've not checked if this is allowed but for forms sake I
would suggest to add the necessary , to $vifmodel when it is != ''. e.g.

+    my $vifmodel= $vif ? ",model=$vif" : '';
[...]
+vif         = [ 'type=ioemu,mac=$gho->{Ether}${vifmodel}' ]

Ian


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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