[packages/qemu] - kvm kernel modules loading support on x86 archs

baggins baggins at pld-linux.org
Sun Nov 3 21:30:07 CET 2013


commit 41ed6e2cd0e64a63be5b9ca873cce0d498fff77a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Nov 3 21:10:56 2013 +0100

    - kvm kernel modules loading support on x86 archs

 80-kvm.rules          |  1 +
 kvm-modules-load.conf |  4 ++++
 qemu.spec             | 15 +++++++++++++++
 3 files changed, 20 insertions(+)
---
diff --git a/qemu.spec b/qemu.spec
index f4acf33..3bca68a 100644
--- a/qemu.spec
+++ b/qemu.spec
@@ -23,6 +23,10 @@ License:	GPL v2+
 Group:		Applications/Emulators
 Source0:	http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2
 # Source0-md5:	3a897d722457c5a895cd6ac79a28fda0
+# Loads kvm kernel modules at boot
+Source3:	kvm-modules-load.conf
+# Creates /dev/kvm
+Source4:	80-kvm.rules
 # KSM control scripts
 Source5:	ksm.service
 Source6:	ksm.sysconfig
@@ -652,6 +656,12 @@ cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/qemu-ifup
 
 EOF
 
+%ifarch %{ix86} %{x8664}
+install scripts/kvm/kvm_stat $RPM_BUILD_ROOT%{_bindir}
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/modules-load.d/kvm.conf
+install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d
+%endif
+
 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/ksm.service
 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ksm
 install -p ksmctl $RPM_BUILD_ROOT%{_sbindir}
@@ -850,6 +860,11 @@ fi
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/qemu-system-i386
 %attr(755,root,root) %{_bindir}/qemu-system-x86_64
+%ifarch %{ix86} %{x8664}
+%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/kvm.conf
+%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/80-kvm.rules
+%attr(755,root,root) %{_bindir}/kvm_stat
+%endif
 
 %files system-xtensa
 %defattr(644,root,root,755)
diff --git a/80-kvm.rules b/80-kvm.rules
new file mode 100644
index 0000000..c2f7317
--- /dev/null
+++ b/80-kvm.rules
@@ -0,0 +1 @@
+KERNEL=="kvm", GROUP="kvm", MODE="0660"
diff --git a/kvm-modules-load.conf b/kvm-modules-load.conf
new file mode 100644
index 0000000..d36f522
--- /dev/null
+++ b/kvm-modules-load.conf
@@ -0,0 +1,4 @@
+# we can safely try both, incompatible module just won't load
+kvm-intel
+kvm-amd
+vhost-net
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/qemu.git/commitdiff/18e669280f9110eed077132bcbd5a37101cc89bf



More information about the pld-cvs-commit mailing list