From patchwork Tue Jun 17 15:26:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 32068 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DFDF8206A0 for ; Tue, 17 Jun 2014 15:28:10 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf25390547pab.7 for ; Tue, 17 Jun 2014 08:28:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=LTJpdIayDoHjfGcF3LkpGaSEeQNLggpaLWWicMCLD1Y=; b=Ta9gDosNDAL850Ddq7zFzVS8SZD33gqkUv1KMguqbenwblES//Og4ucWJH80teKW5l g4ToijyrrGRXgrNRiqxPRpuCbxsqj+gGNDkySZacp3emIy4K3f/GP5fgZurKnhH5N5Ng xUi6ZlxIKbAFrW3Vf3F2DwlxlxZHRBuU5lZOV6jee4TSNRBRYInUfjzewkE2rsND320s 8PRrsfZuCGSnqyZpjI5CD7VlJmxL9PXluT6yKOQFMba6sa2XpOX+Ok09hQM3JD/Ix1Iz SF+pmA0KEobb3jDBdEcRmEMFBg5oQrWcf2VwdKr1df3xZqX553xFKWlqQUOxxQbCqf2B nWQw== X-Gm-Message-State: ALoCoQkwyubUQujw1pmpEQjN3bBv2fgtO/HOk/T5PAk9AKBe4ADE8hisKcvI0hSho09fIIY8nNi7 X-Received: by 10.66.165.165 with SMTP id yz5mr1541308pab.37.1403018890217; Tue, 17 Jun 2014 08:28:10 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.165 with SMTP id 34ls2764372qgl.1.gmail; Tue, 17 Jun 2014 08:28:10 -0700 (PDT) X-Received: by 10.52.191.68 with SMTP id gw4mr824910vdc.65.1403018890103; Tue, 17 Jun 2014 08:28:10 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id s7si5609191vcl.50.2014.06.17.08.28.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id db11so7586249veb.26 for ; Tue, 17 Jun 2014 08:28:10 -0700 (PDT) X-Received: by 10.52.93.201 with SMTP id cw9mr794519vdb.80.1403018890018; Tue, 17 Jun 2014 08:28:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp217993vcb; Tue, 17 Jun 2014 08:28:09 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr18645950vdc.1.1403018889335; Tue, 17 Jun 2014 08:28:09 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id fd4si5612868vec.17.2014.06.17.08.28.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:28:09 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwvHk-0006FC-4K; Tue, 17 Jun 2014 15:26:56 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwvHi-0006DS-IM for xen-devel@lists.xen.org; Tue, 17 Jun 2014 15:26:54 +0000 Received: from [193.109.254.147:16954] by server-6.bemta-14.messagelabs.com id 3C/56-13066-D3E50A35; Tue, 17 Jun 2014 15:26:53 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1403018810!11891033!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4742 invoked from network); 17 Jun 2014 15:26:52 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Jun 2014 15:26:52 -0000 X-IronPort-AV: E=Sophos;i="5.01,494,1400025600"; d="scan'208";a="144521862" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 17 Jun 2014 15:26:51 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Tue, 17 Jun 2014 11:26:50 -0400 Received: from kazak.uk.xensource.com ([10.80.2.80] helo=kazak.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WwvHe-00010t-59; Tue, 17 Jun 2014 16:26:50 +0100 From: Ian Campbell To: Date: Tue, 17 Jun 2014 16:26:44 +0100 Message-ID: <1403018809-25509-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1403018758.25074.5.camel@kazak.uk.xensource.com> References: <1403018758.25074.5.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH RFC OSSTEST 4/9] TestSupport: always use xl for generic operations. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Unless the toolstack is xend (for compatibility with pre-xl Xen versions), when we use xm. For several operations in TestSupport.pm the actual toolstack isn't really relevant, since we want info straight from Xen. For simplicity just use xl (or xm) in these cases, to avoid needing to implement the following specially for each toolstack: - host_get_free_memory - guest_get_state - guest_find_domid Signed-off-by: Ian Campbell --- Osstest/TestSupport.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 6129e9e..11a036f 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -905,6 +905,13 @@ sub compress_stashed($) { #---------- other stuff ---------- +sub common_toolstack () { + my $tsname= $r{toolstack} || 'xend'; + my $ts = 'xl'; + $ts = 'xm' if $tsname eq 'xend'; + return $ts; +} + sub host_reboot ($) { my ($ho) = @_; target_reboot($ho); @@ -924,7 +931,7 @@ sub host_reboot ($) { sub host_get_free_memory($) { my ($ho) = @_; - my $toolstack = toolstack($ho)->{Command}; + my $toolstack = common_toolstack(); # The line is as followed: # free_memory : XXXX my $info = target_cmd_output_root($ho, "$toolstack info", 10); @@ -1558,7 +1565,7 @@ sub guest_check_up ($) { sub guest_get_state ($$) { my ($ho,$gho) = @_; - my $domains= target_cmd_output_root($ho, toolstack($ho)->{Command}." list"); + my $domains= target_cmd_output_root($ho, common_toolstack()." list"); $domains =~ s/^Name.*\n//; foreach my $l (split /\n/, $domains) { $l =~ m/^(\S+) (?: \s+ \d+ ){3} \s+ ([-a-z]+) \s/x or die "$l ?"; @@ -1763,7 +1770,7 @@ sub guest_find_domid ($$) { my ($ho,$gho) = @_; return if defined $gho->{Domid}; my $list= target_cmd_output_root($ho, - toolstack($ho)->{Command}." list $gho->{Name}"); + common_toolstack()." list $gho->{Name}"); $list =~ m/^(?!Name\s)(\S+)\s+(\d+)\s+(\d+)+(\d+)\s.*$/m or die "domain list: $list"; $1 eq $gho->{Name} or die "domain list name $1 expected $gho->{Name}";