mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-12 13:02:48 +01:00
Update compiler_server_virsh.pl
This commit is contained in:
parent
e7b348573f
commit
161488c850
@ -40,6 +40,7 @@ sub vm_start {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub vm_reset {
|
sub vm_reset {
|
||||||
|
return if $ENV{NORESET};
|
||||||
system("virsh detach-disk $DOMAIN_NAME vdb");
|
system("virsh detach-disk $DOMAIN_NAME vdb");
|
||||||
system("virsh snapshot-revert $DOMAIN_NAME 1");
|
system("virsh snapshot-revert $DOMAIN_NAME 1");
|
||||||
system("virsh attach-disk $DOMAIN_NAME --source /var/lib/libvirt/images/factdata.qcow2 --target vdb");
|
system("virsh attach-disk $DOMAIN_NAME --source /var/lib/libvirt/images/factdata.qcow2 --target vdb");
|
||||||
@ -55,7 +56,7 @@ sub execute {
|
|||||||
|
|
||||||
my ($ret, $result);
|
my ($ret, $result);
|
||||||
|
|
||||||
$SIG{CHLD} = 'IGNORE';
|
#$SIG{CHLD} = 'IGNORE';
|
||||||
|
|
||||||
my $child = fork;
|
my $child = fork;
|
||||||
|
|
||||||
@ -216,8 +217,8 @@ sub compiler_server {
|
|||||||
if(not defined $ret) {
|
if(not defined $ret) {
|
||||||
#print "parent continued\n";
|
#print "parent continued\n";
|
||||||
print "parent continued [$result]\n";
|
print "parent continued [$result]\n";
|
||||||
$timed_out = 1 if $result == 243; # -13 == 243
|
$timed_out = 1 if $result == 243 or $result == -13; # -13 == 243
|
||||||
$killed = 1 if $result == 242; # -14 = 242
|
$killed = 1 if $result == 242 or $result == -14; # -14 = 242
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,12 +247,11 @@ sub compiler_server {
|
|||||||
|
|
||||||
close $client;
|
close $client;
|
||||||
|
|
||||||
|
next unless ($timed_out or $killed);
|
||||||
|
|
||||||
vm_reset;
|
vm_reset;
|
||||||
next;
|
next;
|
||||||
|
|
||||||
#next unless ($timed_out or $killed);
|
|
||||||
#next unless $timed_out;
|
|
||||||
|
|
||||||
print "stopping vm\n";
|
print "stopping vm\n";
|
||||||
vm_stop;
|
vm_stop;
|
||||||
$running = 0;
|
$running = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user