From patchwork Fri Jan 8 14:29:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 7986821 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 32651BEEE5 for ; Fri, 8 Jan 2016 14:32:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A064E20149 for ; Fri, 8 Jan 2016 14:32:42 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FCF820142 for ; Fri, 8 Jan 2016 14:32:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aHY3K-0004lq-BD; Fri, 08 Jan 2016 14:30:06 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aHY3I-0004lf-Od for xen-devel@lists.xen.org; Fri, 08 Jan 2016 14:30:04 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id FE/7D-31122-CE7CF865; Fri, 08 Jan 2016 14:30:04 +0000 X-Env-Sender: prvs=80839a509=Ian.Campbell@citrix.com X-Msg-Ref: server-7.tower-21.messagelabs.com!1452263391!9194023!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18849 invoked from network); 8 Jan 2016 14:30:03 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 8 Jan 2016 14:30:03 -0000 X-IronPort-AV: E=Sophos;i="5.20,538,1444694400"; d="scan'208";a="329856655" From: Ian Campbell To: , Date: Fri, 8 Jan 2016 14:29:48 +0000 Message-ID: <1452263399-14094-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1452263368.29416.39.camel@citrix.com> References: <1452263368.29416.39.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell Subject: [Xen-devel] [PATCH RFC OSSTEST v1 01/12] Debian: Abolish $suite and $xopts{Suite} from preseed_* interfaces. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Generating a preseed for a suite which does not match the ->{Suite} of the underlying guest or host object does not seem useful, so remove this option and use ->{Suite} instead. For guests ->{Suite} is set by debian_guest_suite() (which is called from preseed_guest_create(), although it is often also called prior to that) and by selectguest() For hosts $ho->{Suite} is initialised by selecthost if we are in the context of a $job (and if we aren't we had best not be trying to reinstall a host). Signed-off-by: Ian Campbell Acked-by: Ian Jackson --- Osstest/Debian.pm | 14 ++++++++------ ts-debian-di-install | 1 - ts-debian-hvm-install | 2 +- ts-host-install | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 76171c0..93b0ad4 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -794,8 +794,10 @@ sub debian_overlays ($) { $func->('overlay', 'overlay.tar'); } -sub preseed_base ($$$$;@) { - my ($ho,$suite,$sfx,$extra_packages,%xopts) = @_; +sub preseed_base ($$$;@) { + my ($ho,$sfx,$extra_packages,%xopts) = @_; + + my $suite = $ho->{Suite}; $xopts{ExtraPreseed} ||= ''; @@ -927,7 +929,7 @@ END sub preseed_create_guest ($$$;@) { my ($ho, $arch, $sfx, %xopts) = @_; - my $suite= $xopts{Suite} || $c{DebianSuite}; + my $suite= debian_guest_suite($ho); my $extra_packages = ""; if ($xopts{PvMenuLst}) { @@ -962,7 +964,7 @@ END } } - my $preseed_file= preseed_base($ho, $suite, $sfx, $extra_packages, %xopts); + my $preseed_file= preseed_base($ho, $sfx, $extra_packages, %xopts); $preseed_file.= (<{Suite}; my $d_i= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'. $c{TftpDiVersion}.'-'.$ho->{Suite}; @@ -1192,7 +1194,7 @@ END my $extra_packages = join(",",@extra_packages); - my $preseed_file= preseed_base($ho,$suite,$sfx,$extra_packages,%xopts); + my $preseed_file= preseed_base($ho,$sfx,$extra_packages,%xopts); $preseed_file .= (<$suite, PvMenuLst=>$pvmenulst); $extra_disk = ""; diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install index 96190a1..7521d57 100755 --- a/ts-debian-hvm-install +++ b/ts-debian-hvm-install @@ -55,7 +55,7 @@ our $gsuite; sub preseed () { - my $preseed_file = preseed_base($gho,$gsuite,'','',()); + my $preseed_file = preseed_base($gho,'','',()); my $disk = guest_var($gho,'diskdevice','/dev/xvda'); diff --git a/ts-host-install b/ts-host-install index cfa6044..eb740fa 100755 --- a/ts-host-install +++ b/ts-host-install @@ -59,7 +59,6 @@ sub install () { my ($ps_url,$ps_file)= preseed_create ($ho, '', - Suite => $ho->{Suite}, DiskDevice => $ho->{DiskDevice}, Properties => $ho->{Properties}, ExtraPreseed => <