diff options
author | Manuel Bentele | 2021-08-23 12:33:03 +0200 |
---|---|---|
committer | Manuel Bentele | 2021-08-23 12:33:03 +0200 |
commit | acb8c98b4bb5b84bc425a1a628247c9e055d7795 (patch) | |
tree | 02e8a98a54fa0bdeb2863605639f6d51674564ce | |
parent | [qemu] Fix null pointer exception during automatic HW downgrade (diff) | |
download | mltk-acb8c98b4bb5b84bc425a1a628247c9e055d7795.tar.gz mltk-acb8c98b4bb5b84bc425a1a628247c9e055d7795.tar.xz mltk-acb8c98b4bb5b84bc425a1a628247c9e055d7795.zip |
[qemu] Use existing distro service to setup QEMU/KVM properly
-rw-r--r-- | core/modules/qemu/data/etc/systemd/system/qemu.service | 2 | ||||
-rwxr-xr-x | core/modules/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 @@ -17,35 +17,6 @@ ################################################################################ # -# 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 # source /opt/openslx/vmchooser/plugins/qemukvm/includes/kernel-cmdln.inc |