[pve-devel] [PATCH v2 container 6/7] add PVE::LXC::freeze_thaw

Wolfgang Bumiller w.bumiller at proxmox.com
Fri May 15 11:08:41 CEST 2020


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
Implementation of this was moved to the CGroup module, this sub is mostly for
convenience so that external users don't need to use the CGroup module (no
users of this have an instance ready yet) (also makes mocking in the
test suite easier)

 src/PVE/LXC.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index e079208..86a96a9 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -2376,4 +2376,12 @@ sub get_lxc_version() {
     return $version->@*;
 }
 
+sub freeze_thaw($$) {
+    my ($vmid, $freeze) = @_;
+
+    my $cgroup = PVE::LXC::CGroup->new($vmid);
+
+    $cgroup->freeze_thaw($freeze);
+}
+
 1;
-- 
2.20.1





More information about the pve-devel mailing list