]> git.proxmox.com Git - pve-container.git/commit
add vm_stop helper
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 13 Oct 2017 11:25:50 +0000 (13:25 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 17 Oct 2017 09:31:50 +0000 (11:31 +0200)
commitb1bad293c4f7a6024bbd363b6784b3875ca5d098
treea9d4e1f97cf19b6429cfd776fedd346f393f375d
parent3b5070d437c1b637daa99aaac6cf507999fa8241
add vm_stop helper

Since we use a post-stop hook to unmount all file systems at
container shutdown rather than a stop hook (because at this
point there are still multiple mount namespaces around), we
need to wait for the lxc-start/monitor process to exit to be
sure all the unmounting has succeeded, because it will put
the container into a STOPPED state before executing the
post-stop hook, making lxc-wait and lxc-stop signal success
too early when waiting for the container to stop.

Introduce a vm_stop() helper which calls lxc-stop and then
waits for the command socket to close. Note that lxc-stop
already has the "hard-stop-after-timeout" mechanic built in,
so the 'forceStop' code path of the vm_stop api call removed
here was not actually necessary.
Technically we could pass --nokill for the behavior assumed
there, but for now this patch should not be causing any
actual behavior changes.
src/PVE/API2/LXC/Status.pm
src/PVE/LXC.pm
src/PVE/LXC/Config.pm
src/PVE/LXC/Migrate.pm
src/PVE/VZDump/LXC.pm
src/test/snapshot-test.pm