libvirt/src
Pavel Hrdina 184245f53b vircgroup: introduce nested cgroup to properly work with systemd
When running on host with systemd we register VMs with machined.
In this case systemd creates the root VM cgroup for us. This has some
implications where one of them is that systemd owns all files inside
the root VM cgroup and we should not touch them.

We already use DBus calls for some of the APIs but for the remaining
ones we will continue accessing the files directly. Systemd doesn't
support threaded cgroups so we need to do this.

The reason why we don't use DBus for most of the APIs is that we already
have a code that works with files and we would have to check if systemd
supports each API.

This change introduces new topology on systemd hosts:

$ROOT
  |
  +- machine.slice
     |
     +- machine-qemu\x2d1\x2dvm1.scope
        |
        +- libvirt
           |
           +- emulator
           +- vcpu0
           +- vcpu0

compared to the previous topology:

$ROOT
  |
  +- machine.slice
     |
     +- machine-qemu\x2d1\x2dvm1.scope
        |
        +- emulator
        +- vcpu0
        +- vcpu0

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-02-10 13:37:12 +01:00
..
access access: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
admin admin: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:44 -05:00
bhyve bhyve: auto allocate nmdm console paths 2021-02-08 18:50:47 +04:00
conf conf: add reporting of "maximum" CPU mode in domain caps 2021-02-10 11:44:48 +00:00
cpu cpu: wire up support for maximum CPU mode 2021-02-10 11:44:48 +00:00
cpu_map cpu_map: Remove intel-pt from x86 CPU models 2021-01-26 15:44:50 +01:00
esx util: move virStorageSource code into conf 2021-01-22 11:10:27 +01:00
hyperv hypervFreeInvokeParams: Don't use VIR_DISPOSE_N for freeing 'params' 2021-02-03 13:07:12 +01:00
hypervisor hypervisor: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
interface interface: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
keycodemapdb@27acf0ef82
libxl lib: Substitute some STREQLEN with STRPREFIX 2021-02-10 11:51:59 +01:00
locking locking: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:44 -05:00
logging logging: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
lxc use g_autoptr for all virConnectPtrs used with virGetConnectNetwork() 2021-01-08 11:34:59 -05:00
network network: explicitly set the MTU of the bridge device. 2021-01-15 12:20:00 -05:00
node_device udevProcessCCW: Initialize variable 2021-02-02 15:00:55 +01:00
nwfilter util: hash: Retire 'virHashTable' in favor of 'GHashTable' 2020-11-06 10:40:51 +01:00
openvz openvzDomainMigratePrepare3Params: use g_auto 2020-11-19 15:21:59 +01:00
qemu qemu: wire up support for maximum CPU model 2021-02-10 11:44:48 +00:00
remote build: Fix generation of virtproxyd socket files 2021-02-09 11:39:40 -07:00
rpc rpc: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
secret secret: use g_new0 instead of VIR_ALLOC* 2020-10-01 12:34:13 +02:00
security security: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
storage storage: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:45 -05:00
storage_file conf: implement support for vhostuser disk 2021-02-03 18:56:34 +01:00
test test_driver: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:43 -05:00
util vircgroup: introduce nested cgroup to properly work with systemd 2021-02-10 13:37:12 +01:00
vbox vbox: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:44 -05:00
vmware vmx: Allow missing cdrom image file in virVMXParseFileName 2021-01-06 02:05:10 +01:00
vmx vmx: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:44 -05:00
vz vz: replace VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:44 -05:00
admin_protocol-structs
datatypes.c datatypes: replace VIR_FREE with g_free in all *Dispose() functions 2021-02-05 00:22:09 -05:00
datatypes.h define g_autoptr cleanup function for virNetworkDHCPLease 2020-07-20 19:08:07 -04:00
driver-hypervisor.h virDomainAuthorizedSSHKeysSet: Use uint for @nkeys 2020-11-23 13:35:16 +01:00
driver-interface.h
driver-network.h network: add public APIs for network port object 2019-06-17 15:19:54 +01:00
driver-nodedev.h
driver-nwfilter.h
driver-secret.h
driver-state.h libvirt: add stateShutdownPrepare/stateShutdownWait to drivers 2020-09-07 09:33:58 +03:00
driver-storage.h
driver-stream.h Use #pragma once in driver headers 2019-06-13 17:05:08 +02:00
driver.c log error if virConnectCacheOnceInit() fails 2021-02-02 00:27:27 -05:00
driver.h src: don't hide error in VIR_DRV_SUPPORTS_FEATURE 2021-01-06 17:10:10 +03:00
internal.h internal.h: Introduce and use VIR_IS_POW2() 2020-12-04 16:24:19 +01:00
libvirt_driver_modules.syms util: create new virmodule.{c,h} files for dlopen support code 2018-05-03 12:47:43 +01:00
libvirt_esx.syms
libvirt_internal.h libvirt: add stateShutdownPrepare/stateShutdownWait to drivers 2020-09-07 09:33:58 +03:00
libvirt_libssh2.syms
libvirt_libssh.syms
libvirt_linux.syms
libvirt_lxc.syms
libvirt_openvz.syms
libvirt_private.syms virsystemd: introduce virSystemdGetMachineUnitByPID 2021-02-10 13:37:11 +01:00
libvirt_probes.d drop libdbus from libvirt 2020-09-17 18:20:33 +02:00
libvirt_public.syms Introduce OpenSSH authorized key file mgmt APIs 2020-11-18 16:18:25 +01:00
libvirt_qemu.syms
libvirt_remote.syms virnetdaemon: Wait for "daemon-stop" thread to finish before quitting 2020-11-24 17:52:54 +01:00
libvirt_sasl.syms
libvirt_vmware.syms
libvirt_vmx.syms vmx: hide private helpers 2020-10-14 11:23:18 +02:00
libvirt-domain-checkpoint.c Fix name prefix of VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE 2020-11-09 16:29:06 +00:00
libvirt-domain-snapshot.c
libvirt-domain.c libvirtd: replace straggler VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:45 -05:00
libvirt-host.c src: adopt to VIR_DRV_SUPPORTS_FEATURE return -1 2021-01-06 17:10:01 +03:00
libvirt-interface.c
libvirt-lxc.c use more virStrcpy() and virStrcpyStatic() 2021-01-04 20:18:24 +01:00
libvirt-lxc.pc.in
libvirt-network.c libvirtd: replace straggler VIR_FREE with g_free in all vir*Free() functions 2021-02-05 00:20:45 -05:00
libvirt-nodedev.c virsh: nodedev: filter by AP Matrix capability 2020-12-09 14:03:05 +01:00
libvirt-nwfilter.c src: don't include ref count in debug messages / probes 2020-06-03 10:20:17 +01:00
libvirt-qemu.c
libvirt-qemu.pc.in meson: remove '.libs' from all relevant paths 2020-08-03 09:27:00 +02:00
libvirt-secret.c
libvirt-storage.c libvirt-storage: Document volume upload/download stream format 2020-08-24 13:32:53 +02:00
libvirt-stream.c src: libvirt-stream: use g_new0 instead of VIR_ALLOC* 2020-10-01 12:34:13 +02:00
libvirt.c src: adopt to VIR_DRV_SUPPORTS_FEATURE return -1 2021-01-06 17:10:01 +03:00
libvirt.conf
libvirt.pc.in
lock_protocol-structs
lxc_monitor_protocol-structs
lxc_protocol-structs build: add new file, for lxc_protocol checking 2013-01-15 12:01:22 -07:00
meson.build meson: Fix cross-building of dtrace probes 2021-01-26 10:59:45 +01:00
qemu_protocol-structs
README
remote_protocol-structs remote: Implement OpenSSH authorized key file mgmt APIs 2020-11-18 16:18:25 +01:00
virkeepaliveprotocol-structs
virnetprotocol-structs

       libvirt library code README
       ===========================

The directory provides the bulk of the libvirt codebase. Everything
except for the libvirtd daemon and client tools. The build uses a
large number of libtool convenience libraries - one for each child
directory, and then links them together for the final libvirt.so,
although some bits get linked directly to libvirtd daemon instead.

The files directly in this directory are supporting the public API
entry points & data structures.

There are two core shared modules to be aware of:

 * util/  - a collection of shared APIs that can be used by any
            code. This directory is always in the include path
            for all things built

 * conf/  - APIs for parsing / manipulating all the official XML
            files used by the public API. This directory is only
            in the include path for driver implementation modules

 * vmx/   - VMware VMX config handling (used by esx/ and vmware/)


Then there are the hypervisor implementations:

 * bhyve         - bhyve - The BSD Hypervisor
 * esx/          - VMware ESX and GSX support using vSphere API over SOAP
 * hyperv/       - Microsoft Hyper-V support using WinRM
 * lxc/          - Linux Native Containers
 * openvz/       - OpenVZ containers using cli tools
 * qemu/         - QEMU / KVM using qemu CLI/monitor
 * remote/       - Generic libvirt native RPC client
 * test/         - A "mock" driver for testing
 * vbox/         - Virtual Box using native API
 * vmware/       - VMware Workstation and Player using the vmrun tool
 * xen/          - Xen using hypercalls, XenD SEXPR & XenStore


Finally some secondary drivers that are shared for several HVs.
Currently these are used by LXC, OpenVZ, QEMU and Xen drivers.
The ESX, Hyper-V, Remote, Test & VirtualBox drivers all
implement the secondary drivers directly

 * cpu/          - CPU feature management
 * interface/    - Host network interface management
 * network/      - Virtual NAT networking
 * nwfilter/     - Network traffic filtering rules
 * node_device/  - Host device enumeration
 * secret/       - Secret management
 * security/     - Mandatory access control drivers
 * storage/      - Storage management drivers


Since both the hypervisor and secondary drivers can be built as
dlopen()able modules, it is *FORBIDDEN* to have build dependencies
between these directories. Drivers are only allowed to depend on
the public API, and the internal APIs in the util/ and conf/
directories