aboutsummaryrefslogtreecommitdiffstats
path: root/fileutil
Commit message (Collapse)AuthorAgeFilesLines
* pkg/fileutil: move from fileutilDmitry Vyukov2017-06-032-175/+0
|
* fileutil: remove unused CopyFile argDmitry Vyukov2017-06-031-11/+2
|
* config: use dense indices for VMsDmitry Vyukov2016-11-252-28/+13
| | | | | | | | | | | | | | 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.
* ipc: umount all mounts before removing temp dirsDmitry Vyukov2016-01-111-0/+14
| | | | | This is needed if unshare(CLONE_NEWNS) is not implemented. Otherwise, os.RemoveAll fails.
* sys: add union typeDmitry Vyukov2015-12-291-1/+1
|
* fileutil: fix race in ProcessTempDirDmitry Vyukov2015-12-292-2/+93
| | | | | | | | | | | | One goroutine decides that it needs to clean up an instance, but before it tries to delete pid file it is preempted. Then another goroutine cleans up this instances and creates a new instances in the same dir. Then first goroutine removes already new pid file and removes the used dir. Fix this by using flock on a lock file. Add a test.
* vm: improve VM interfaceDmitry Vyukov2015-12-231-1/+51
| | | | | | | Current interface is suitable only for running syz-fuzzer. Make the interface more generic (boot, copy file, run an arbitrary command). This allows to build other tools on top of vm package (e.g. reproducer creation).
* fileutil: new packageDmitry Vyukov2015-12-231-0/+44
Move some file utilities into a separate package.