http://bugs.winehq.org/show_bug.cgi?id=35946
Bug ID: 35946 Summary: Cannot mark a VM for maintenance if it is running a task Product: Wine-Testbot Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: unknown Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
To mark a VM for maintenance one sets its status to 'maintenance'. The problem is that when a VM runs a task its status is 'running' and once its done the task script blindly sets its status to 'dirty' hence overwriting the 'maintenance' status.
Note that even setting the VM role to 'retired' does not work although the task script does not explicitly change it. It seems like the whole VM's row gets rewritten when the the task script saves the new status.
So the task script should refresh its view of the VM status and check that it's still 'running' before changing it. That still leaves open a small window for races but that's probably acceptable.
The same problem exists in the RevrtVM.pl script with the 'reverting' and 'sleeping' states.