Skip to content

add KVM support

add KVM support #5

Workflow file for this run

name: Run module
on:
push:
pull_request:
jobs:
run:
runs-on: ubuntu-22.04
steps:
### DEPENDENCIES ###
# Hard turn-off interactive mode
- run: echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
# Install dependencies
- run: sudo apt update
- run: sudo apt -y install bison busybox-static cargo cmake coreutils cpio elfutils file flex gcc gcc-multilib git iproute2 jq kbd kmod libcap-dev libelf-dev libunwind-dev libvirt-clients libzstd-dev linux-headers-generic linux-tools-common linux-tools-generic make ninja-build pahole pkg-config python3-dev python3-pip python3-requests qemu-kvm rsync rustc stress-ng udev zstd
### END DEPENDENCIES ###
# Install virtme-ng
- run: pip install virtme-ng
# Checkout git repository
- uses: actions/checkout@v4
# Run `uname -r` using a vanilla v6.6 kernel
- run: vng -r v6.9 -- uname -r
# Setup KVM support
- name: "KVM support"
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# Re-run with KVM support
- name: "Check KVM support"
run: |
clocksource="/sys/devices/system/clocksource/clocksource0/current_clocksource"
[ "$(vng -r v6.9 -- cat "${clocksource}")" = "kvm-clock" ]