Adapt libvirtd to work with cgroupv2
This commit is contained in:
parent
ebd073a56c
commit
7375e560b4
5
Makefile
5
Makefile
@ -1,10 +1,11 @@
|
||||
.PHONY: imageLibvirtd test
|
||||
|
||||
REGISTRY_IP=docker.registry
|
||||
DOCKER_BUILDKIT=1
|
||||
|
||||
## build
|
||||
|
||||
shell_build_image = docker build -t $(REGISTRY_IP):5000/$(1) .; \
|
||||
shell_build_image = docker build --platform=linux/amd64 -t $(REGISTRY_IP):5000/$(1) .; \
|
||||
docker push $(REGISTRY_IP):5000/$(1);
|
||||
|
||||
imageLibvirtd:
|
||||
@ -29,4 +30,4 @@ download_centos:
|
||||
## management
|
||||
|
||||
status:
|
||||
@curl -s $(REGISTRY_IP):5000/v2/_catalog | jq
|
||||
@curl -s $(REGISTRY_IP):5000/v2/_catalog | jq
|
||||
|
14
libvirtd.sh
14
libvirtd.sh
@ -36,12 +36,14 @@ modprobe kvm_intel nested=1 -d /host
|
||||
|
||||
# If no cpuacct,cpu is present, symlink it to cpu,cpuacct
|
||||
# Otherwise libvirt and our emulator get confused
|
||||
if [ ! -d "/host/sys/fs/cgroup/cpuacct,cpu" ]; then
|
||||
echo "Creating cpuacct,cpu cgroup symlink"
|
||||
mount -o remount,rw /host/sys/fs/cgroup
|
||||
cd /host/sys/fs/cgroup
|
||||
ln -s cpu,cpuacct cpuacct,cpu
|
||||
mount -o remount,ro /host/sys/fs/cgroup
|
||||
if [ ! -f "/host/sys/fs/cgroup/cgroup.controllers" ]; then
|
||||
if [ ! -d "/host/sys/fs/cgroup/cpuacct,cpu" ]; then
|
||||
echo "Creating cpuacct,cpu cgroup symlink"
|
||||
mount -o remount,rw /host/sys/fs/cgroup
|
||||
cd /host/sys/fs/cgroup
|
||||
ln -s cpu,cpuacct cpuacct,cpu
|
||||
mount -o remount,ro /host/sys/fs/cgroup
|
||||
fi
|
||||
fi
|
||||
|
||||
mount --rbind /host/sys/fs/cgroup /sys/fs/cgroup
|
||||
|
Loading…
Reference in New Issue
Block a user