[PATCH] testbot/VMs: Make sure only one process uses a VM at a time.
Francois Gouget
fgouget at codeweavers.com
Wed Sep 11 10:02:37 CDT 2019
The TestBot should already be respecting that rule.
But starting a process to operate on a VM always goes through VM::Run()
so enforce this rule by checking that the VM's ChildPid field is not
already set before starting a new process.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
testbot/lib/WineTestBot/VMs.pm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 78e066fe9..2bf350435 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -154,6 +154,7 @@ use WineTestBot::LibvirtDomain;
use WineTestBot::Missions;
use WineTestBot::RecordGroups;
use WineTestBot::TestAgent;
+use WineTestBot::Utils;
sub _initialize($$)
@@ -374,9 +375,16 @@ sub OnSaved($)
sub Run($$$$$$)
{
my ($self, $NewStatus, $Args, $ChildTimeout, $ChildSetup, $SetupData) = @_;
-
my $Tool = basename($Args->[0]);
+ if (defined $self->ChildPid)
+ {
+ my $ErrMessage = "Cannot run ". ShArgv2Cmd(@$Args) ." because the ". $self->ChildPid ." process is already using the ". $self->Name ." VM";
+ require WineTestBot::Log;
+ WineTestBot::Log::LogMsg("$ErrMessage\n");
+ return $ErrMessage;
+ }
+
# There are two $VM->ChildPid race conditions to avoid:
# - Between the child process and new calls to ScheduleJobs().
# We cannot leave setting ChildPid to the child process because then it
--
2.20.1
More information about the wine-devel
mailing list