]> git.proxmox.com Git - qemu-server.git/commit - test/snapshot-test.pm
refactor: split check_running into _exists_ and _running_
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 19 Nov 2019 11:23:46 +0000 (12:23 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Nov 2019 15:29:23 +0000 (16:29 +0100)
commitbabf613a08108bd6509104a8ff92691e6192f174
tree3b8af08384c7b3a16213df0285358d2e9e379391
parent24622ebed45510a63c0f40c658f145ea676a3035
refactor: split check_running into _exists_ and _running_

vm_exists_on_node in PVE::QemuConfig checks if a config file for a vmid
exists

vm_running_locally in PVE::QemuServer::Helpers checks if a VM is running
on the local machine by probing its pidfile and checking /proc/.../cmdline

check_running is left in QemuServer for compatibility, but changed to
simply call the two new helper functions.

Both methods are also correctly mocked for testing snapshots.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/QemuConfig.pm
PVE/QemuServer.pm
PVE/QemuServer/Helpers.pm
test/snapshot-test.pm