Adapt libvirtd to work with cgroupv2
This commit is contained in:
parent
ebd073a56c
commit
7375e560b4
3
Makefile
3
Makefile
@ -1,10 +1,11 @@
|
|||||||
.PHONY: imageLibvirtd test
|
.PHONY: imageLibvirtd test
|
||||||
|
|
||||||
REGISTRY_IP=docker.registry
|
REGISTRY_IP=docker.registry
|
||||||
|
DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
## build
|
## 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);
|
docker push $(REGISTRY_IP):5000/$(1);
|
||||||
|
|
||||||
imageLibvirtd:
|
imageLibvirtd:
|
||||||
|
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
|
# If no cpuacct,cpu is present, symlink it to cpu,cpuacct
|
||||||
# Otherwise libvirt and our emulator get confused
|
# Otherwise libvirt and our emulator get confused
|
||||||
if [ ! -d "/host/sys/fs/cgroup/cpuacct,cpu" ]; then
|
if [ ! -f "/host/sys/fs/cgroup/cgroup.controllers" ]; then
|
||||||
echo "Creating cpuacct,cpu cgroup symlink"
|
if [ ! -d "/host/sys/fs/cgroup/cpuacct,cpu" ]; then
|
||||||
mount -o remount,rw /host/sys/fs/cgroup
|
echo "Creating cpuacct,cpu cgroup symlink"
|
||||||
cd /host/sys/fs/cgroup
|
mount -o remount,rw /host/sys/fs/cgroup
|
||||||
ln -s cpu,cpuacct cpuacct,cpu
|
cd /host/sys/fs/cgroup
|
||||||
mount -o remount,ro /host/sys/fs/cgroup
|
ln -s cpu,cpuacct cpuacct,cpu
|
||||||
|
mount -o remount,ro /host/sys/fs/cgroup
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount --rbind /host/sys/fs/cgroup /sys/fs/cgroup
|
mount --rbind /host/sys/fs/cgroup /sys/fs/cgroup
|
||||||
|
Loading…
Reference in New Issue
Block a user