From patchwork Fri Mar 27 18:15:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11462895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2D7B1667 for ; Fri, 27 Mar 2020 18:16:51 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C54052083E for ; Fri, 27 Mar 2020 18:16:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C54052083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtW1-00047B-Uq; Fri, 27 Mar 2020 18:15:33 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtW1-000471-Ey for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 18:15:33 +0000 X-Inumbo-ID: f27668f8-7056-11ea-92cf-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f27668f8-7056-11ea-92cf-bc764e2007e4; Fri, 27 Mar 2020 18:15:33 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jHtW0-0004UK-33; Fri, 27 Mar 2020 18:15:32 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 18:15:21 +0000 Message-Id: <20200327181526.19412-1-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [OSSTEST PATCH 1/6] TestSupport: export guest_find_lv X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" We'll need this in a moment. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 1c13e2af..5fb78468 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -114,7 +114,7 @@ BEGIN { prepareguest_part_xencfg guest_umount_lv guest_await guest_await_dhcp_tcp guest_checkrunning $guest_state_running_re - target_check_ip guest_find_ether + target_check_ip guest_find_ether guest_find_lv guest_find_domid guest_check_up guest_check_up_quick guest_get_state guest_await_reboot guest_await_shutdown guest_await_destroy guest_destroy From patchwork Fri Mar 27 18:15:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11462897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFB1A81 for ; Fri, 27 Mar 2020 18:16:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A33832083E for ; Fri, 27 Mar 2020 18:16:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A33832083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtW2-00047I-7U; Fri, 27 Mar 2020 18:15:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtW1-000473-K5 for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 18:15:33 +0000 X-Inumbo-ID: f29ec2da-7056-11ea-92cf-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f29ec2da-7056-11ea-92cf-bc764e2007e4; Fri, 27 Mar 2020 18:15:33 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jHtW0-0004UK-D8; Fri, 27 Mar 2020 18:15:32 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 18:15:22 +0000 Message-Id: <20200327181526.19412-2-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200327181526.19412-1-ian.jackson@eu.citrix.com> References: <20200327181526.19412-1-ian.jackson@eu.citrix.com> Subject: [Xen-devel] [OSSTEST PATCH 2/6] ts-logs-capture: Introduce @allguests containing even non-running X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Nothing looks at this yet. Signed-off-by: Ian Jackson --- ts-logs-capture | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ts-logs-capture b/ts-logs-capture index d16372f2..88b19658 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -39,7 +39,7 @@ if (!$ho) { exit 0; } -our @guests; +our (@allguests, @guests); sub find_guests () { my $sth= $dbh_tests->prepare(<finish(); + + @guests = grep { defined $_->{Domid} } @allguests; } sub try_fetch_logs ($$) { From patchwork Fri Mar 27 18:15:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11462901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D409E6CA for ; Fri, 27 Mar 2020 18:16:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B67AB2083E for ; Fri, 27 Mar 2020 18:16:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B67AB2083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtW7-00049Y-KP; Fri, 27 Mar 2020 18:15:39 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtW6-000498-FD for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 18:15:38 +0000 X-Inumbo-ID: f2bc5c28-7056-11ea-92cf-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f2bc5c28-7056-11ea-92cf-bc764e2007e4; Fri, 27 Mar 2020 18:15:33 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jHtW0-0004UK-Lr; Fri, 27 Mar 2020 18:15:32 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 18:15:23 +0000 Message-Id: <20200327181526.19412-3-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200327181526.19412-1-ian.jackson@eu.citrix.com> References: <20200327181526.19412-1-ian.jackson@eu.citrix.com> Subject: [Xen-devel] [OSSTEST PATCH 3/6] ts-logs-capture: Break logs up into general logs and host logs X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" We are going to fetch logs out of guests. @general_logs will contain the relevant patterns. Right now we just introduce the variable and split the list. The categorisation is roughly right... Signed-off-by: Ian Jackson --- ts-logs-capture | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ts-logs-capture b/ts-logs-capture index 88b19658..ae37d492 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -135,8 +135,7 @@ sub try_cmd_output_save ($;$) { close $fh or die $!; } -sub fetch_logs_host () { - my $logs= [qw( +our @general_logs = qw( /var/log/kern.log* /var/log/syslog* /var/log/daemon.log* @@ -149,6 +148,10 @@ sub fetch_logs_host () { /var/log/installer/syslog* /var/log/installer/partman* + ); + +sub fetch_logs_host () { + my $logs= [@general_logs, qw( /var/log/xen/xend.log* /var/log/xen/xend-debug.log* /var/log/xen/xen-hotplug.log* From patchwork Fri Mar 27 18:15:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11462903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4AF26CA for ; Fri, 27 Mar 2020 18:17:01 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8992A2083E for ; Fri, 27 Mar 2020 18:17:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8992A2083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtWC-0004Bb-Ts; Fri, 27 Mar 2020 18:15:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtWB-0004B2-F2 for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 18:15:43 +0000 X-Inumbo-ID: f2f9c676-7056-11ea-92cf-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f2f9c676-7056-11ea-92cf-bc764e2007e4; Fri, 27 Mar 2020 18:15:33 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jHtW0-0004UK-T6; Fri, 27 Mar 2020 18:15:33 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 18:15:24 +0000 Message-Id: <20200327181526.19412-4-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200327181526.19412-1-ian.jackson@eu.citrix.com> References: <20200327181526.19412-1-ian.jackson@eu.citrix.com> Subject: [Xen-devel] [OSSTEST PATCH 4/6] ts-logs-capture: Move some general logs onto @general_logs X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Now @general_logs contains logs we want from guests as well as hosts. Signed-off-by: Ian Jackson --- ts-logs-capture | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ts-logs-capture b/ts-logs-capture index ae37d492..418155ce 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -148,6 +148,11 @@ our @general_logs = qw( /var/log/installer/syslog* /var/log/installer/partman* + /boot/config* + + /home/osstest/osstest-confirm-booted.log + + /var/core/*.core ); sub fetch_logs_host () { @@ -172,14 +177,8 @@ sub fetch_logs_host () { /var/log/xen-tools/* - /boot/config* - /etc/xen/* - /home/osstest/osstest-confirm-booted.log - - /var/core/*.core - )]; if (!try_fetch_logs($ho, $logs)) { logm("log fetching failed, trying hard host reboot..."); From patchwork Fri Mar 27 18:15:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11462899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0958881 for ; Fri, 27 Mar 2020 18:16:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E161E208E4 for ; Fri, 27 Mar 2020 18:16:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E161E208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtWH-0004DV-7K; Fri, 27 Mar 2020 18:15:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtWG-0004DG-Fg for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 18:15:48 +0000 X-Inumbo-ID: f324e04a-7056-11ea-b34e-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f324e04a-7056-11ea-b34e-bc764e2007e4; Fri, 27 Mar 2020 18:15:34 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jHtW1-0004UK-8g; Fri, 27 Mar 2020 18:15:33 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 18:15:25 +0000 Message-Id: <20200327181526.19412-5-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200327181526.19412-1-ian.jackson@eu.citrix.com> References: <20200327181526.19412-1-ian.jackson@eu.citrix.com> Subject: [Xen-devel] [OSSTEST PATCH 5/6] ts-logs-capture: try_fetch_logs: Honour $fs_ and $out_prefix X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This allows us to add some stuff to add to each pattern, and each filename. This will be useful in a moment. None of the call sites pass this yet. Signed-off-by: Ian Jackson --- ts-logs-capture | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ts-logs-capture b/ts-logs-capture index 418155ce..6be77676 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -68,11 +68,13 @@ END @guests = grep { defined $_->{Domid} } @allguests; } -sub try_fetch_logs ($$) { - my ($lho, $logfilepats) = @_; +sub try_fetch_logs ($$;$$) { + my ($lho, $logfilepats, $fs_prefix,$out_prefix) = @_; + $fs_prefix //= ''; + $out_prefix //= ''; my $ok= 0; foreach my $logfilepat (@$logfilepats) { - my $logfileslist= $logfilepat; + my $logfileslist= $fs_prefix.$logfilepat; if ($logfileslist =~ m/[*?]/) { if (!eval { $logfileslist= @@ -91,8 +93,9 @@ END } foreach my $logfile (split / /, $logfileslist) { my $llogfile= $logfile; + $llogfile =~ s,^\Q$fs_prefix\E,,; $llogfile =~ s,/,-,g; - $llogfile= hostnamepath($lho)."--$llogfile"; + $llogfile= hostnamepath($lho)."-$out_prefix-$llogfile"; logm("fetching $logfile to $llogfile"); if (!eval { target_getfile_root($lho,60, $logfile,"$stash/$llogfile"); From patchwork Fri Mar 27 18:15:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11462905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFAFE81 for ; Fri, 27 Mar 2020 18:17:16 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 941D42083E for ; Fri, 27 Mar 2020 18:17:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 941D42083E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=eu.citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtWM-0004Fv-H8; Fri, 27 Mar 2020 18:15:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jHtWL-0004FU-G1 for xen-devel@lists.xenproject.org; Fri, 27 Mar 2020 18:15:53 +0000 X-Inumbo-ID: f34610c6-7056-11ea-a6c1-bc764e2007e4 Received: from chiark.greenend.org.uk (unknown [2001:ba8:1e3::]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f34610c6-7056-11ea-a6c1-bc764e2007e4; Fri, 27 Mar 2020 18:15:34 +0000 (UTC) Received: from [172.18.45.5] (helo=zealot.relativity.greenend.org.uk) by chiark.greenend.org.uk (Debian Exim 4.84_2 #1) with esmtp (return-path ijackson@chiark.greenend.org.uk) id 1jHtW1-0004UK-HO; Fri, 27 Mar 2020 18:15:33 +0000 From: Ian Jackson To: xen-devel@lists.xenproject.org Date: Fri, 27 Mar 2020 18:15:26 +0000 Message-Id: <20200327181526.19412-6-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200327181526.19412-1-ian.jackson@eu.citrix.com> References: <20200327181526.19412-1-ian.jackson@eu.citrix.com> Subject: [Xen-devel] [OSSTEST PATCH 6/6] ts-logs-capture: Fish some logs out of guest filesystem X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This involves shutting the guests down. We use this shell rune because xl doesn't provide a good way to ensure there are no guests running. Signed-off-by: Ian Jackson --- ts-logs-capture | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ts-logs-capture b/ts-logs-capture index 6be77676..c67856cd 100755 --- a/ts-logs-capture +++ b/ts-logs-capture @@ -261,10 +261,40 @@ sub fetch_logs_guest ($) { } } +sub shutdown_guests () { + target_cmd_root($ho, <<'END', 180); + set -x + ( + ( exec 2>/dev/null; sleep 30 ; echo y ) & + ( xl shutdown -a -F -w ; echo y ) & + ) | ( + read x + xl list | awk '!/^Domain-0 |^Name / {print $2}' \ + | xargs -t -r -n1 xl destroy ||: + ) +END +} + +sub extract_logs_guest ($) { + my ($gho) = @_; + if (!eval { + guest_find_lv($gho); + target_cmd_root($ho, "umount /mnt ||:"); + target_cmd_root($ho, "mount -r ".$gho->{Lvdev}." /mnt"); + try_fetch_logs($ho, \@general_logs, '/mnt', "$gho->{Guest}-"); + target_cmd_root($ho, "umount /mnt ||:"); + 1; + }) { + logm("failure extracting logs out of guest fs: $@"); + } +} + power_state($ho,1); find_guests(); fetch_xenctx_guest($_) foreach @guests; serial_fetch_logs($ho); fetch_logs_host(); fetch_logs_guest($_) foreach @guests; +shutdown_guests(); +extract_logs_guest($_) foreach @allguests; logm("logs captured to $stash");