On Thu, 2015-04-23 at 00:34 +0000, Hu, Robert wrote:
> > -----Original Message-----
> > From: Ian Jackson [mailto:ian.jack...@eu.citrix.com]
> > Sent: Wednesday, April 22, 2015 8:50 PM
> > To: Ian Campbell
> > Cc: Pang, LongtaoX; xen-devel@lists.xen.org; wei.l...@citrix.com; Hu, Robert
> > Subject: Re: [OSSTEST Nested PATCH v8 3/7] Edit some APIs in TestSupport.pm
> > for nested test
> > 
> > Ian Campbell writes ("Re: [OSSTEST Nested PATCH v8 3/7] Edit some APIs in
> > TestSupport.pm for nested test"):
> > > It will, I think, need to be integrated with the existing assignment to
> > > $ho->{Ip} in select host, so something like:
> > >
> > >         if ( $r{"${ident}_ip"} ) {
> > >             $ho->{Ip}= $r{"${ident}_ip"};
> > >         } else {
> > >             $ho->{Ip}= $ho->{IpStatic};
> > >         }
> > 
> > Yes.
> Yes, otherwise the code would go 'die' somewhere later.
Seems inevitably run into die in our nested test case, since our l1 host
shall not have IpStatic, while currently seems this is a necessary.
$ho->{IpStatic} = get_host_property($ho,'ip-addr');
    if (!defined $ho->{IpStatic}) {
        my $ip_packed= gethostbyname($ho->{Fqdn});
        die "$ho->{Fqdn} ?" unless $ip_packed;
        $ho->{IpStatic}= inet_ntoa($ip_packed);
        die "$ho->{Fqdn} ?" unless defined $ho->{IpStatic};
    }
Shall we loosen this for nested l1 host? 
i.e. die "$ho->{Fqdn} ?" unless $ip_packed ||
$r{$ident_enable_nestedhvm} eq 'true';
> > 
> > > or perhaps:
> > >
> > >         $ho->{Ip} = $r{"${ident}_ip"} ? $r{"${ident}_ip"} : 
> > > $ho->{IpStatic};
> > 
> > The shortest way to spell this is to use //, eg:
> > 
> >       $ho->{Ip} = $r{"${ident}_ip"} // $ho->{IpStatic};
> Ah, yes!
> > 
> > Ian.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel



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

Reply via email to