[pve-devel] [PATCH qemu-server 1/3] add PVE::QemuServer::Cgroup

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Nov 24 12:09:04 CET 2020


qemu doesn't actually have a limiting namespace subdirectory, so I'll
just replace this with:

    sub get_subdir {
        my ($self, $controller, $limiting) = @_;
        my $vmid = $self->{vmid};
        return "qemu.slice/$vmid.scope/";
    }

On Fri, Oct 30, 2020 at 10:42:34AM +0100, Alexandre Derumier wrote:
> ---
>  PVE/QemuServer/CGroup.pm | 25 +++++++++++++++++++++++++
>  PVE/QemuServer/Makefile  |  1 +
>  2 files changed, 26 insertions(+)
>  create mode 100644 PVE/QemuServer/CGroup.pm
> 
> diff --git a/PVE/QemuServer/CGroup.pm b/PVE/QemuServer/CGroup.pm
> new file mode 100644
> index 0000000..7ca0826
> --- /dev/null
> +++ b/PVE/QemuServer/CGroup.pm
> @@ -0,0 +1,25 @@
> +package PVE::QemuServer::CGroup;
> +
> +use strict;
> +use warnings;
> +use PVE::CGroup;
> +use base('PVE::CGroup');
> +
> +sub get_subdir {
> +    my ($self, $controller, $limiting) = @_;
> +
> +    my $entry_name = $controller || 'unified';
> +    my $entry = ($self->{controllers}->{$entry_name} //= {});
> +
> +    my $kind = $limiting ? 'limit' : 'ns';
> +    my $path = $entry->{$kind};
> +
> +    return $path if defined $path;
> +
> +    my $vmid = $self->{vmid};
> +    $path = "qemu.slice/$vmid.scope/";
> +
> +    return $path;
> +}
> +
> +1;
> diff --git a/PVE/QemuServer/Makefile b/PVE/QemuServer/Makefile
> index fd8cfbb..e4ed184 100644
> --- a/PVE/QemuServer/Makefile
> +++ b/PVE/QemuServer/Makefile
> @@ -9,6 +9,7 @@ SOURCES=PCI.pm		\
>  	Monitor.pm	\
>  	Machine.pm	\
>  	CPUConfig.pm	\
> +	CGroup.pm	\
>  	Drive.pm	\
>  
>  .PHONY: install
> -- 
> 2.20.1





More information about the pve-devel mailing list