From: Ian Jackson Subject: [OSSTEST PATCH 17/24] ts-xen-install: Properly handle hosts without a static IP address Date: Fri, 13 Nov 2015 12:03:45 +0000 Message-ID: <1447416232-12699-18-git-send-email-ian.jackson@eu.citrix.com> References: <1447416232-12699-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZxD5U-0001eb-Lw for xen-devel@lists.xenproject.org; Fri, 13 Nov 2015 12:04:16 +0000 In-Reply-To: <1447416232-12699-1-git-send-email-ian.jackson@eu.citrix.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: xen-devel@lists.xenproject.org Cc: Robert Ho , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: Robert Ho Check IpStatic, and if it is not set, provide a dhcp stanza in /etc/network/interfaces, rather than an `inet static' one. This is necessary for L1 nested hosts, because they don't have a static IP address. In principle this makes matters more correct for physical hosts without static IP addresses, but these are currently not supported by selecthost(). Signed-off-by: Robert Ho Signed-off-by: Ian Jackson Tested-by: Robert Ho Acked-by: Ian Campbell --- v14: Only use `inet dhcp' if !$ho->{IpStatic}. --- ts-xen-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts-xen-install b/ts-xen-install index b511e2b..d9aa694 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -320,11 +320,14 @@ END /auto $iface\n/x; if (m/^\s* iface \s+ (?: $physif | xenbr0 ) \s+ inet \s /x) { $suppress= 1; - print EO <{IpStatic} ? <{Ip} netmask $netmask gateway $gateway +END +iface $iface inet dhcp +END $bridgex END } -- 1.7.10.4