
On Tue, Apr 07, 2020 at 12:48:26PM +0200, Marc-André Lureau wrote:
Hi
On Tue, Apr 7, 2020 at 10:55 AM Pavel Hrdina <phrdina@redhat.com> wrote:
On Mon, Apr 06, 2020 at 11:26:57PM +0200, marcandre.lureau@redhat.com wrote:
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Hi,
This is a small series that allows basic QEMU VM CGroup support with the help of machined --user: https://github.com/systemd/systemd/pull/15312
The first few patches are fixes to register dbus and slirp-helper correctly with the VM cgroup.
A few changes are done to the machined support, adding session support, and registering the VM to get a systemd scope cgroup under user machine.slice.
Hi,
Before we start with anything I would like to know what is the motivation behind having CGroup support for session VMs?
My initial motivation was to have a way to group VM processes and kill them altogether, because I tend to have a lot of them around after a while.
Given that systemd --user is very capable and based on https://www.freedesktop.org/wiki/Software/systemd/writing-vm-managers/, I thought that was probably the way to go.
Yes, it makes sense. It also should help us close a feature gap by enabling many of our resource tuning APIs to now work in session mode, since we can now use cgroups tuning.
From the systemd pull request it looks like you would like to have session VMs under the /sys/fs/cgroup/machine.slice which is completely wrong as we should not mix system and session VMs under the same slice.
No, it is under user.slice, ex with this series:
CGroup: /user.slice/user-1000.slice/user@1000.service ├─machine.slice │ └─machine-qemu\x2delmarco\x2d1\x2dfedora.scope │ ├─24714 /usr/bin/swtpm socket --daemon --ctrl type=unixio,path=/run/user/1000/libvirt/qemu/run/swtpm/1-fedora-swtpm.sock,mode=0600 --tpmstate dir=/home/elmarco/.config/libvirt/qemu/swtpm/053f84e7> │ ├─24716 /usr/bin/dbus-daemon --config-file=/run/user/1000/libvirt/qemu/run/dbus/1-fedora-dbus.conf │ ├─24719 /home/elmarco/src/libslirp-rs/target/debug/libslirp-helper --fd=27 --dbus-id=slirp-52:54:00:9c:bb:6c --dbus-address=unix:path=/run/user/1000/libvirt/qemu/run/dbus/1-fedora-dbus.sock --exi> │ ├─24722 /usr/bin/qemu-system-x86_64 -name guest=fedora,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/home/elmarco/.config/libvirt/qemu/lib/domain-1-fedora/master-key.aes -obje> │ └─emulator
Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|