[tools 3/3] testbot/LibvirtTool: Avoid a race between shutdown.exe and TestAgentd.

Francois Gouget fgouget at codeweavers.com
Thu Feb 10 12:51:55 CST 2022


"shutdown.exe /p" waits for no process which may give it a slight edge
in not getting stuck; but it also does not wait for TestAgentd to reply
to the Run() RPC.
"shutdown.exe /s" does not seem to have this problem (and supports /t if
need be).

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/LibvirtTool.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index db85f43e2f..e2f2fd3c46 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -293,7 +293,7 @@ sub ShutDown()
   Debug(Elapsed($Start), " Performing a clean shutdown of $VMKey/$CurrentSnapshot\n");
   LogMsg "Performing a clean shutdown of $VMKey/$CurrentSnapshot\n";
   my $Cmd = $VM->Type =~ /^win(?:32|64)$/ ?
-            ["shutdown.exe", "/p", "/d", "00:00"] :
+            ["shutdown.exe", "/s", "/d", "00:00", "/t", "0"] :
             ["/sbin/shutdown", "--poweroff", "now"];
   Debug(Elapsed($Start), " Running @$Cmd\n");
   my $PTA = GetPrivilegedTA($VM->GetAgent());
-- 
2.30.2



More information about the wine-devel mailing list