]> git.proxmox.com Git - pve-container.git/commit
fix: cloning a locked container creates an empty config
authorDaniel Tschlatscher <d.tschlatscher@proxmox.com>
Fri, 17 Jun 2022 10:40:01 +0000 (12:40 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 5 Jul 2022 07:03:57 +0000 (09:03 +0200)
commitbecea45d45aaa4844cc6abce195d38680c264f7b
tree4dc1846693683f850a32f677fa264ea914e6270a
parent4be329cba8493cb4bce9b8fa20fa1a8b7683832e
fix: cloning a locked container creates an empty config

When an attempt was made to clone a locked container the API would
correctly present the error 'CT is locked (disk)' but create the
config files for the new container anyway.

There was also a potential problem when the config of the new ct would
already be present and the creation of the container failed. In this
case the config of the new CT would be incorrectly removed.
The config locks for the new and the old configs should now be
correctly released depending on from which call a problem originates.

Futhermore, I moved some related function calls into the eval block to
avoid similar problems with leftover config files in the future.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
src/PVE/API2/LXC.pm