From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH OSSTEST 01/12] toolstack: save / restore check Date: Wed, 11 Mar 2015 16:14:21 +0000 Message-ID: <1426090461.21353.303.camel@citrix.com> References: <1423480206-9729-1-git-send-email-wei.liu2@citrix.com> <1423480206-9729-2-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1423480206-9729-2-git-send-email-wei.liu2@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: Wei Liu Cc: jfehlig@suse.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2015-02-09 at 11:09 +0000, Wei Liu wrote: > +sub saverestore_check ($) { > + my ($self) = @_; > + my $ho = $self->{Host}; > + my $help = target_cmd_output_root($ho, $self->{_Command}." help"); > + my $rc = ($help =~ m/^\s*save/m) ? 0 : 1; > + logm("rc=$rc"); > + return $rc; You could refactor this and the migration_check into a more generic "check for a named command" helper. And you could prepare the libvirt one for the same once migration gets added I suppose. Everything else looks OK to me.