From acb8c98b4bb5b84bc425a1a628247c9e055d7795 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 23 Aug 2021 12:33:03 +0200 Subject: [qemu] Use existing distro service to setup QEMU/KVM properly --- .../qemu/data/etc/systemd/system/qemu.service | 2 ++ .../qemu/data/opt/openslx/scripts/systemd-qemu_env | 29 ---------------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/core/modules/qemu/data/etc/systemd/system/qemu.service b/core/modules/qemu/data/etc/systemd/system/qemu.service index 7a1d3b4d..4d0e7a19 100644 --- a/core/modules/qemu/data/etc/systemd/system/qemu.service +++ b/core/modules/qemu/data/etc/systemd/system/qemu.service @@ -2,8 +2,10 @@ Description=Sets up the QEMU hypervisor Requires=run-virt-env.service Requires=libvirtd.service +Requires=qemu-kvm.service After=run-virt-env.service After=libvirtd.service +After=qemu-kvm.service [Service] Type=oneshot diff --git a/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env b/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env index ffa54ce1..d0c6ea3a 100755 --- a/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env +++ b/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env @@ -16,35 +16,6 @@ # - This is the preparation script for the configuration of QEMU on Linux. ################################################################################ -# -# load general KVM module -# -modprobe "kvm" || slxlog "qemu" "Could not load 'kvm' kernel modul!" - -# -# load CPU specific KVM implementation -# -virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)') || true - -if [ "${virt}" = "vmx" ]; then - kmod="kvm_intel" -elif [ "${virt}" = "svm" ]; then - kmod="kvm_amd" -else - slxlog "qemu" "CPU does not support KVM extensions!" - exit 1 -fi - -modprobe "${kmod}" || slxlog "qemu" "Could not load '${kmod}' kernel modul!" - -# -# check that the KVM exposed device exists -# -if [ ! -e /dev/kvm ]; then - slxlog "qemu" "/dev/kvm not found! Missing kvm kernel module(s)?" - exit 1 -fi - # # create and setup Intel GVT-g mediated device instance for passthrough if Intel GVT-g is enabled # -- cgit v1.2.3-55-g7522