REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.79 KB
Close
//proc/self/root/proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/websiteisolation/limits.py
Text
Base64
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2026 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENSE.TXT """Kernel-side LVP/LVE operations via pylve bindings.""" from lve_utils.pylve_wrapper import PyLve from .exceptions import LvdError try: import pylve except ImportError: pylve = None def get_pylve(): """Initialize and return a PyLve instance.""" if pylve is None: raise LvdError("pylve module not available") py = PyLve(pylve) py.initialize() if not py.domains_supported(): raise LvdError("kernel does not support per-domain limits " "(requires lve_lvp_create2)") return py def settings_from_limits(py, limits): """Create liblve_settings from a limits dict.""" settings = py.liblve_settings() if 'cpu' in limits: settings.ls_cpu = int(limits['cpu']) if 'pmem' in limits: settings.ls_memory_phy = int(limits['pmem']) if 'io' in limits: settings.ls_io = int(limits['io']) if 'nproc' in limits: settings.ls_nproc = int(limits['nproc']) if 'iops' in limits: settings.ls_iops = int(limits['iops']) return settings def settings_to_dict(settings): """Convert liblve_settings to a dict of limit fields.""" return { 'cpu': settings.ls_cpu, 'pmem': settings.ls_memory_phy, 'io': settings.ls_io, 'nproc': settings.ls_nproc, 'iops': settings.ls_iops, } def lvp_setup_direct(domain_id, settings): """Call pylve.lve_lvp_setup directly, bypassing the lveapi wrapper. The lveapi wrapper iterates /proc/lve/resellers/ which doesn't exist for nested domain LVPs (they are leaf containers).""" rc = pylve.lve_lvp_setup(domain_id, settings) return rc
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-04-09 07:00:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
commands.py
6.55 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
config.py
8.22 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
exceptions.py
261 B
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
id_registry.py
4.54 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
limits.py
1.79 KB
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
180 B
lrw-r--r--
2026-03-12 11:00:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).