]> git.proxmox.com Git - pve-container.git/commit
fix #889: api create: reserver config with create lock early
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 28 Jan 2019 07:06:48 +0000 (08:06 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 29 Jan 2019 10:36:10 +0000 (11:36 +0100)
commit6178332186d4813cf664f5fc5040c785d49f15e4
treec6564635e1030d3fc094ff48938b341c4da1e9a2
parentd7d48be607448d8dbf1370bcbdbf35ed441ede36
fix #889: api create: reserver config with create lock early

allows to remove some checks as we can be sure the config belongs to
us once we have it resered, either for restore or new creation.

This is similar to the qemu-server approach[0][1], adapted to the
LXC code. We need to cleanup a bit less if something fails, as the
LXC code path always removed the config and all created volumes in
this case, which means the 'create' reserve lock is gone too.

The early reserve on API entry, instead of doing it after forked
worker entry, allows to workaround the issues reported in #889 as
successful return from the API call means that the VMID is locked.

[0]: https://git.proxmox.com/?p=qemu-server.git;a=commit;h=8ba8418ca1d1a76a7e24c34045ca7702b0cd969d
[1]: https://git.proxmox.com/?p=qemu-server.git;a=commit;h=4fedc13b453d2011b35352df246cf9ea396e942b

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/LXC.pm