[tools 2/3] testbot/LibvirtTool: Fix detecting the 'high privileges' TestAgentd.

Francois Gouget fgouget at codeweavers.com
Thu Feb 24 12:01:03 CST 2022


The SetTime() leeway should be 0 otherwise it may skip actually setting
the time and thus not fail if privileges are insufficient.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
The 'high privileges' detection is usually only done once and before the 
VM's time has been updated. Since this normally happens a lot more than 
30 seconds after the live snapshot has been created this is normally not 
an issue. It would likely fail for powered-off snapshots however since 
they update their time on boot.
---
 testbot/bin/LibvirtTool.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index 5e3e7afb6c..ff834efdc7 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -278,7 +278,7 @@ sub GetPrivilegedTA($)
   my ($TA) = @_;
 
   # Use SetTime() to detect if privileged operations are allowed.
-  return $TA->SetTime() ? $TA : $VM->GetAgent(1);
+  return $TA->SetTime(0) ? $TA : $VM->GetAgent(1);
 }
 
 sub RunAndWait($$)
@@ -582,7 +582,7 @@ sub PrepareVM($)
   # during the build some ccache versions will return a compilation error).
   my $PTA = GetPrivilegedTA($TA);
   FatalError("$VMKey has no privileged TestAgent server\n") if (!$PTA);
-  if (!$PTA->SetTime())
+  if (!$PTA->SetTime(0))
   {
     FatalError("Setting the $VMKey system time failed: ". $PTA->GetLastError() ."\n");
   }
-- 
2.30.2




More information about the wine-devel mailing list