package/libvirt: new package
PATCH v5 1/1 package/libvirt: new package
From: Carlos Santos <[email protected]>
Libvirt is collection of software that provides a convenient way to manage virtual machines and other virtualization functionality, such as storage and network interface management. These software pieces include an API library, a daemon (libvirtd), and a command line utility (virsh).
Thanks-to: DATACOM for providing hardware and software tools used to
develop and test this package.
https://www.datacom.com.br/en/produtos/network-appliance
---
Supersedes: https://patchwork.ozlabs.org/patch/841613/
---
History:
v1: primitive package, for experimental purposes only v1->v2:
- Clarify dependence on !BR2_TOOLCHAIN_USES_MUSL
- Add run-time dependence on dnsmask
- Add dependence on eudev and libpciaccess when eudev is selected (thus detected by configure).v2->v3:
- Condition the use of libtirpc to !BR2_TOOLCHAIN_HAS_NATIVE_RPC
- Check for BR2_PACKAGE_HAS_UDEV instead of BR2_PACKAGE_EUDEVv3->v4:
- Fix version history :-).
- Add optional dependency on several packages (e.g. attr, libpcap), depending on wether they are selected or not, and explicitly disable features whose required packages are not selected. This is very important to prevent selection of features based on leaks from the host environment (e.g. finding /usr/bin/numad on the host machine).
- Enable the "interface" driver if either udev or netcf is available.
- Disable pm-utils support, since there is no package for Buildroot.
- Use either openssl or gnutls, if available.
- Run qemu as user "qemu", group "kvm", not as root.
- Add a LIBVIRT_USERS variable to create user "qemu" an group "kvm".
- Add a device table file to set the ownership and permissions of the libvirt directories under /etc, /run and /var.
- If udev is not available, add an init script to set the ownership and permissions of /dev/kvm to root:kvm and 0660; otherwise create a corresponding /etc/udev/rules.d/90-kvm.rules file.
- Enable support for systemd, if applicable; otherwise install an init script to start/stop/restart libvirtd.
- Ensure that a modern netcat is available.v4->v5:
- Changed SOB, since I don't work for DATACOM anymore.
- Bump to version 5.8.0.
- Add hash for license file.
- Drop OpenSSL options, since it's not supported anymore.
- Use https to access libvirt.org, since http is always redirected to https.
- Make libvirt daemon optional. If not selected, build only the client utilities. Reorganize run-time dependencies accordingly.
- Load all vfio modules on startup, if they exist, otherwise virtual machines that depend on the PCI Passthrough feature fail to load. vfio-pci is not enough. Other modules, like vfio_iommu_type1, may be necessary.
- Fix stopping dnsmasq in start/stop script. dnsmasq is not always started by libvirtd, so we must chech if it is running before attempting to stop it.
- Move /etc/libvirt/{qemu,secrets,storage} to /var/lib/libvirt. It may be necessary to create persistent files (e.g. VM definitions) in these directories. Move them to /var/lib because /etc may be on a read-only or volatile (initramfs) filesystem. We could tweak the code to change these paths but the patch would be large and would break compatibility with ordinary installations and with the documentation.
- Prevent an error message if pid file dissappears. start-stop-daemon sends a TERM signal to the process but does not wait for its termination, so we may reach rm_stale_pidfile while libvirtd.pid still exists but execute the cat command when the file is already gone, which leads cat to show an error message. We could use the '--retry' option to wait for the process termination but it is not supported by BusyBox. Let's just send the error messages to /dev/null and attempt to remove the file if any command fails, since 'rm -f' does nothing if the file does not exist.
- Move device table creation to LIBVIRT_DEVICES instead of using the device_table.txt file.
- Select libseccomp to enable seccomp support in qemu, as required by libvirt.
- Select hwdata (pci.ids). It is required by libvirt to show device names when we use virtual machine manager to add hardware via PCI passthrough, otherwise only the PCI bus information (slot, port, function) is shown.
- Add systemd support.
- Restrict to libvirt with udev support. Drop netcf usage, which requires a new package and is hard to test. Support for non-udev systems will be added later.
- Remove package/libvirt/S30devkvmperms
- Fine-tune the configuration and pass host/target executable paths in ac_cv_path_* variables via LIBVIRT_CONF_ENV.
- Use LIBVIRT_PERMISSIONS to set directory permissions.
- Drop hook to set user/group in /etc/libvirt/qemu.conf, since it's not necessary.
- Pull two upstream patches that fix building with musl.
- Do not check for executables existence in the startup script.
- Use separate init scripts for virtlogd and libvirtd. Make them compliant to the current pattern (as much as possible).
- Do not start/stop virtlockd, since it is controlled by libvirtd.
--- package/Config.in | 1 + .../0001-qemu-fix-build-with-musl-libc.patch | 80 ++++ ...002-storage-fix-build-with-musl-libc.patch | 52 +++ package/libvirt/90-kvm.rules | 1 + package/libvirt/Config.in | 110 +++++ package/libvirt/S91virtlogd | 65 +++ package/libvirt/S92libvirtd | 132 ++++++ package/libvirt/libvirt.hash | 3 + package/libvirt/libvirt.mk | 377 ++++++++++++++++++ 9 files changed, 821 insertions(+) create mode 100644 package/libvirt/0001-qemu-fix-build-with-musl-libc.patch create mode 100644 package/libvirt/0002-storage-fix-build-with-musl-libc.patch create mode 100644 package/libvirt/90-kvm.rules create mode 100644 package/libvirt/Config.in create mode 100644 package/libvirt/S91virtlogd create mode 100644 package/libvirt/S92libvirtd create mode 100644 package/libvirt/libvirt.hash create mode 100644 package/libvirt/libvirt.mk
package/Config.in +1 -0
@@ -2243,6 +2243,7 @@ menu "System tools" source "package/kmod/Config.in" source "package/kvmtool/Config.in" source "package/libostree/Config.in" + source "package/libvirt/Config.in" source "package/lxc/Config.in" source "package/mender/Config.in" source "package/mender-grubenv/Config.in"
package/libvirt/0001-qemu-fix-build-with-musl-libc.patch new file +80 -0
80 lines not on this page · raw message
package/libvirt/0002-storage-fix-build-with-musl-libc.patch new file +52 -0
52 lines not on this page · raw message
package/libvirt/90-kvm.rules new file +1 -0
@@ -0,0 +1 @@ +KERNEL=="kvm", OWNER="root", GROUP="kvm", MODE="0660"
package/libvirt/Config.in new file +110 -0
110 lines not on this page · raw message
package/libvirt/S91virtlogd new file +65 -0
65 lines not on this page · raw message
package/libvirt/S92libvirtd new file +132 -0
132 lines not on this page · raw message
package/libvirt/libvirt.hash new file +3 -0
@@ -0,0 +1,3 @@ +# locally computed +sha256 e23328289b18bdedc1e966f6c26402b2983149c660ed8bd52cda6feab0c20c55 libvirt-5.8.0.tar.xz +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
package/libvirt/libvirt.mk new file +377 -0
377 lines not on this page · raw message
Signature · 1 line
2.18.1