Commit 9e6ad51e authored by Leigh Stoller's avatar Leigh Stoller

Use libvnode_xen version domainStatus(), which fixes a bug (I think)

with disk images being corrupted.
parent 37660030
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -133,16 +133,8 @@ else {
die("Tainted output filename: $filename");
}
sub domainStatus($)
{
my ($id) = @_;
my $status = `$sudo xm list --long $id 2>/dev/null`;
if ($status =~ /\(state ([\w-]+)\)/) {
return $1;
}
return "";
}
# So we can use domainStatus().
libvnode_xen::init(`hostname`);
#
# Check contaner status. If it is running, we need to stop it,
......@@ -150,7 +142,7 @@ sub domainStatus($)
#
# XEN: Any status means it is running and needs to halted.
#
my $status = domainStatus($vnodeid);
my $status = libvnode_xen::domainStatus($vnodeid);
#
# Boss has already arranged for prepare to run; we cannot exec a
......@@ -161,7 +153,7 @@ my $status = domainStatus($vnodeid);
if ($status ne "") {
for (my $i = 20; $i >= 0; $i--) {
sleep(5);
$status = domainStatus($vnodeid);
$status = libvnode_xen::domainStatus($vnodeid);
if ($status eq "") {
$status = "stopped";
last;
......@@ -172,6 +164,8 @@ if ($status ne "") {
die("Container would not stop!\n");
}
}
# Settling time :-)
sleep(10);
if ($aspack) {
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment