(maybe) fixes #1229: fix port reservation
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 16 Feb 2017 08:24:18 +0000 (09:24 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 16 Feb 2017 14:02:55 +0000 (15:02 +0100)
commit3c476ed580e5a934ce4d29a63612364c909fbd83
tree6dea93b13278f2e765a620323bb438fd6a9138be
parent813a5c0d263fd98da93b5765730b029ef343a4e1
(maybe) fixes #1229: fix port reservation

when reserving ports, we use lock_file to lock the
reservation file, but then use file_set_content which
writes a new file and renames it, making the lock invalid
and different processes waiting for the lock get inconsistent
data

instead we use a designated lock file for the lock, so that we don't
lose the lock when writing the reservation file

this should fix the problem that sometimes multiple vms get the
same vnc/spice port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/Tools.pm