mirror of
https://github.com/reactos/syzkaller.git
synced 2025-02-23 21:22:56 +00:00

CreateVMConfig uses fileutil.ProcessTempDir to assign indices to VMs. fileutil.ProcessTempDir generates unique indices globally across several processes. This was required for old vm/qemu code that used the index to choose unique ssh port for the VM. Now vm/qemu does not use index as port and this global index assignment started causing problems for adb and gce. Adb really needs indexes to be dense -- index is used to choose adb device id (if we have 2 devices, index 3 causes out of bounds panic). For gce it leads to creation of unnecessary VM instances (if I set count=4, I want at most 4 VMs created). Don't use fileutil.ProcessTempDir-generated index in CreateVMConfig and instead just use the dense indices passed by caller.