From: Ian Jackson Subject: Re: [OSSTest Nested v12 21/21] await_tcp(): check_ip for each loop iteration Date: Wed, 16 Sep 2015 15:35:20 +0100 Message-ID: <22009.32296.45454.764431@mariner.uk.xensource.com> References: <1440774490-16725-1-git-send-email-robert.hu@intel.com> <1440774490-16725-22-git-send-email-robert.hu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1440774490-16725-22-git-send-email-robert.hu@intel.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: Robert Ho Cc: gordon.jin@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, di.zheng@intel.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Robert Ho writes ("[OSSTest Nested v12 21/21] await_tcp(): check_ip for each loop iteration"): > await_tcp usually invoked after a reboot, $ho IP may change, > especially when $ho 'client name' of DHCP request changes. > Therefore, await_tcp() check will fail if we don't update $ho->{IP} > accordingly. > But, if $ho has static IP, this won't apply. > Also, this patch add $ho->{Ip} in its $what message, so that we can > observe clearly if $ho->{Ip} changes. > > To use $ho->{IpStatic} to indicate what its name means, we have to > correct its assignment: we assign value to it only from configuration > or DNS query. We already have $ho->{Ip}, which shall indicate $ho > IP address in dhcp cases. I don't think I'm quite convinced by this reasoning. This patch is effectively turning await_tcp into most of guest_await_dhcp_tcp. I think perhaps instead target_reboot and target_reboot hard should unset $ho->{Ip} and await_tcp should call guest_check_ip only if $ho->{Ip} is not set. The unsetting of $ho->{Ip} should probably actually involve also a call to the part of selecthost which sets it from IpStatic and gethostbyname etc. That would have to be made conditional on $ho->{Fqdn} existing because L1 nested hosts don't have a useful fqdn. Ian.