From: Ian Jackson Subject: Re: [PATCH v3] Set {ident}_suite runvar when install a Debian guest. Date: Tue, 24 Nov 2015 11:17:30 +0000 Message-ID: <22100.18250.523177.171252@mariner.uk.xensource.com> References: <1448275201.4973.36.camel@citrix.com> <1448357106-14875-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1448357106-14875-1-git-send-email-ian.campbell@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: Ian Campbell Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("[PATCH v3] Set {ident}_suite runvar when install a Debian guest."): > Currently those places which want this open code a lookup of the > {ident}_suite runvar with a fallback to the configuration file. > > However selecthost was missing such a lookup in the case where it is > constructing a nested L1 host (which begins from the selectguest > template), which lead to ts-xen-install on Jessie missing the > installation of libnl-route-3-200. > > Fix this by providing debian_guest_suite($gho) which as well as > initialising $gho->{Suite} stores an {ident}_suite runvar (taking care > to handle the case where one is already set by e.g. make-flight). For > convenience debian_guest_suite() also returns the suite name. > > ts-debian-install, ts-debian-di-install and ts-debian-hvm-install now > use debian_guest_suite instead of open coding the lookup. > > The final piece of the puzzle is to have selectguest() pickup the > {ident}_suite runvar (if it is set) and initialise $gho->{Suite} from > it. Acked-by: Ian Jackson > Signed-off-by: Ian Campbell > --- > I've kicked off an adhoc run testing: > + test-amd64-amd64-qemuu-nested);; # nested > + test-amd64-amd64-xl-qemuu-debianhvm-amd64);; # regular HVM > + test-amd64-amd64-xl-qcow2);; # DI install > + test-amd64-amd64-xl);; # Normal PV > with this change. This looks like you wrote a case statement in sh. Did you know about OSSTEST_JOBS_ONLY (see cs-job-create) ? FFR, I have some style tips: > +sub debian_guest_suite ($) { > + my ($gho) = @_; > + > + return $gho->{Suite} if $gho->{Suite}; > + > + $gho->{Suite} = guest_var($gho,'suite',undef); If you do this instead + $gho->{Suite} //= guest_var($gho,'suite',undef); the previous line (`return ... if') is not needed. > + if ( ! $gho->{Suite} ) { This is stylistically odd IMO. Seems to have been written by a hypervisor maintainer :-). > + $gho->{Suite} = $c{GuestDebianSuite}; > + store_runvar("$gho->{Guest}_suite", $gho->{Suite}); > + } > + return $gho->{Suite}; > +} But none of that really matters. Ian.