From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST Nested PATCH v8 3/7] Edit some APIs in TestSupport.pm for nested test Date: Tue, 21 Apr 2015 13:53:00 +0100 Message-ID: <1429620780.4743.67.camel@citrix.com> References: <1428959990-24199-1-git-send-email-longtaox.pang@intel.com> <1428959990-24199-4-git-send-email-longtaox.pang@intel.com> <1429611542.4743.22.camel@citrix.com> <21814.17314.479011.970684@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21814.17314.479011.970684@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: robert.hu@intel.com, "longtao.pang" , wei.liu2@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2015-04-21 at 13:33 +0100, Ian Jackson wrote: > Ian Campbell writes ("Re: [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: > > > --- a/Osstest/TestSupport.pm > > > +++ b/Osstest/TestSupport.pm > ... > > > + 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}. > > Yes. > > > ${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. > > Ian C is right. > > > But, I think actually the principle behind this change is wrong. > > It seems to be copying information from runvars into the in-memory > data structure for host properties. But host properties are (by > definition) matters of (fixed) configuration, not runtime definition. Remember that here the "host" is actual an L1 virtual machine, whose IP is not fixed (since it mac address isn't). I don't know if that affects your opinion at all? > I haven't looked at the rest of the series, but the same effect should > be achieved in a different way. Note that a $ho is a hash which > already contains (after selecthost, say) an element with key `Ip'. > > So the right place to do this is indeed probably somewhere around > selectguest or selecthost, but the information should be put into > $ho->{Ip} without going via host properties. > > Thanks, > Ian.