Commit Graph

5 Commits

Author SHA1 Message Date
modeco80
405e88bd1b cvmts: Allow specifying cgroup cpu period
probably limited utility wise but it's there now
2024-11-03 13:10:57 -05:00
modeco80
fe82973b9f Only try enabling cpuset controller if required
Additionally, "handle" (in many airquotes) errors trying to set controller values.
2024-11-02 18:01:07 -04:00
modeco80
e7a06b7141 cvmts: Delete cgroup on VM stop
Makes clean shutdown with systemd actually work.

I've also made superqemu version a SemVer thing so that we don't need to bump it as often, only on a major or minor bump.
2024-11-02 11:58:35 -04:00
modeco80
86f1345a2d cvmts: Only target QEMU vCPU threads by default
Previous behaviour was to limit the whole QEMU process; this only limits the vCPU threads. A bit (very) hacky how I did this but it does work.
2024-11-02 07:46:59 -04:00
modeco80
e780ecabf0 cvmts: Add support for cgroup process resource limits on Linux
Using systemd's `Delegate=` option, it is possible to get it to let you manage your own cgroup subtree, therefore allowing you to set options and other fun stuff.

This commit adds support for doing so and configuring the resource limits in config.toml.

For later: The cgroup created has to be a threaded one. Iin theory, we can actually wait for the QEMU process to handshake qmp, grab the vCPU threads, and only limit those. For now, just limiting the entire QEMU process works, though and is the least complicated.

NOTE: Windows support should still work, even if you have resource limits configured. If you do, it should only warn and complain, but still function.
2024-11-02 06:08:26 -04:00