<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spooch</id>
	<title>KVM - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://linux-kvm.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spooch"/>
	<link rel="alternate" type="text/html" href="https://linux-kvm.org/page/Special:Contributions/Spooch"/>
	<updated>2026-04-22T02:14:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Code&amp;diff=2255</id>
		<title>Code</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Code&amp;diff=2255"/>
		<updated>2009-04-27T13:29:53Z</updated>

		<summary type="html">&lt;p&gt;Spooch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code=&lt;br /&gt;
&lt;br /&gt;
[[Category:Architechture]]&lt;br /&gt;
== kernel git tree ==&lt;br /&gt;
The kvm kernel code is available through a git tree.  To create a repository using git, type&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git&lt;br /&gt;
&lt;br /&gt;
Alternatively, it is also accessible through the kernel.org gitweb interface:               &lt;br /&gt;
[http://git.kernel.org/?p=linux/kernel/git/avi/kvm.git;a=summary]&lt;br /&gt;
&lt;br /&gt;
For subsequent upgrades use the command&lt;br /&gt;
                                       &lt;br /&gt;
 git-pull&lt;br /&gt;
in the git working dir.&lt;br /&gt;
&lt;br /&gt;
== userspace git tree ==&lt;br /&gt;
The kvm userspace code (libkvm and qemu) is available through a git tree. To create a repository using git, type&lt;br /&gt;
                                                                                      &lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git&lt;br /&gt;
&lt;br /&gt;
Alternatively, it is also accessible through the kernel.org gitweb interface:         &lt;br /&gt;
[http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=summary]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== linux guest drivers kit ==&lt;br /&gt;
This kit converts a virtio-capable kernel into a package that can generate linux guest drivers for older kernels.                                                                                                 &lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-guest-drivers-linux.git&lt;br /&gt;
&lt;br /&gt;
The corresponding kernel tree can found in the &amp;lt;code&amp;gt;virtio&amp;lt;/code&amp;gt; branch of &amp;lt;code&amp;gt;kvm.git&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== building an external module with older kernels ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This only works for the x86 architecture.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. If you wish to use a distribution kernel (or just some random kernel you like) with kvm,&lt;br /&gt;
you can get both the userspace and kernel (via git).  In the userspace                  &lt;br /&gt;
toplevel directory, type:&lt;br /&gt;
                                                                                        &lt;br /&gt;
 ./configure [--kerneldir=/path/to/kernel/dir]&lt;br /&gt;
&lt;br /&gt;
2. If you are using a released kvm-XX.tar.gz, skip to step 3. If you got the source from git, you need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 cd kernel&lt;br /&gt;
 make sync LINUX=/path/to/kvm/git/tree&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
3. Finally, build KVM and the KVM modules:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three important directories in this scenario:&lt;br /&gt;
{|border=1&lt;br /&gt;
! kvm-userspace&lt;br /&gt;
| Contains a &amp;lt;code&amp;gt;kernel&amp;lt;/code&amp;gt; subdirectory. If you got the source from git, it needs to be populated with files from the kvm.git repository (using &amp;lt;code&amp;gt;make sync&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
! host kernel tree&lt;br /&gt;
| Older kernel you want to use newer KVM modules with. Refer to it with &amp;lt;code&amp;gt;configure --kerneldir&amp;lt;/code&amp;gt;.&lt;br /&gt;
You need to point to a &#039;&#039;&#039;configured&#039;&#039;&#039; kernel source tree corresponding to the kernel you are building modules for. The default is to look for the sources of the running kernel at &amp;lt;code&amp;gt;/lib/modules/`uname -r`/build&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
! kvm kernel tree (from git)&lt;br /&gt;
| A clone of the kvm.git repository. Used as the source of the KVM modules. Refer to it with &amp;lt;code&amp;gt;LINUX=path&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;make sync&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tip about building against Red Hat Enterprise Linux kernels ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;kvm-userspace/kernel&amp;lt;/code&amp;gt; has some compat code to allow it to compile against older kernels, and also some code specific to features that are normally not present on older kernels but are present on RHEL kernels.&lt;br /&gt;
&lt;br /&gt;
So, when building against a RHEL kernel tree, check if the &amp;lt;code&amp;gt;RHEL_*&amp;lt;/code&amp;gt; macros at &amp;lt;code&amp;gt;${kerneldir}/include/linux/version.h&amp;lt;/code&amp;gt; are defined correctly, corresponding to the RHEL version where the kernel source comes from. If those macros aren&#039;t defined correctly, the compat code that allows compilation against RHEL kernels will break and you will get build errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release tags ==&lt;br /&gt;
&lt;br /&gt;
kvm releases are tagged with &amp;lt;code&amp;gt;kvm-nn&amp;lt;/code&amp;gt; where &#039;&#039;nn&#039;&#039; is the release number.&lt;br /&gt;
&lt;br /&gt;
== Binary Packages ==&lt;br /&gt;
=== CentOS / RHEL ===&lt;br /&gt;
&lt;br /&gt;
Unofficial packages of latest releases can be found at&lt;br /&gt;
http://www.lfarkas.org/linux/packages/centos/5/&lt;br /&gt;
&lt;br /&gt;
== nightly snapshots ==&lt;br /&gt;
&lt;br /&gt;
Nightly snapshots, for those who are uncomfortable with git, are [http://people.qumranet.com/avi/snapshots available].  When reporting a problem with a snapshot, please quote the snapshot name (which includes the date) and the contents of the SOURCES file in the snapshot tarball.&lt;/div&gt;</summary>
		<author><name>Spooch</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Code&amp;diff=2254</id>
		<title>Code</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Code&amp;diff=2254"/>
		<updated>2009-04-27T13:28:34Z</updated>

		<summary type="html">&lt;p&gt;Spooch: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code=&lt;br /&gt;
&lt;br /&gt;
[[Category:Architechture]]&lt;br /&gt;
== kernel git tree ==&lt;br /&gt;
The kvm kernel code is available through a git tree.  To create a repository using git, type&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git&lt;br /&gt;
&lt;br /&gt;
Alternatively, it is also accessible through the kernel.org gitweb interface:               &lt;br /&gt;
[http://git.kernel.org/?p=linux/kernel/git/avi/kvm.git;a=summary]&lt;br /&gt;
&lt;br /&gt;
For subsequent upgrades use the command&lt;br /&gt;
                                       &lt;br /&gt;
 git-pull&lt;br /&gt;
in the git working dir.&lt;br /&gt;
&lt;br /&gt;
== userspace git tree ==&lt;br /&gt;
The kvm userspace code (libkvm and qemu) is available through a git tree. To create a repository using git, type&lt;br /&gt;
                                                                                      &lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git&lt;br /&gt;
&lt;br /&gt;
Alternatively, it is also accessible through the kernel.org gitweb interface:         &lt;br /&gt;
[http://git.kernel.org/?p=pub/scm/virt/kvm/qemu-kvm.git;a=summary]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== linux guest drivers kit ==&lt;br /&gt;
This kit converts a virtio-capable kernel into a package that can generate linux guest drivers for older kernels.                                                                                                 &lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-guest-drivers-linux.git&lt;br /&gt;
&lt;br /&gt;
The corresponding kernel tree can found in the &amp;lt;code&amp;gt;virtio&amp;lt;/code&amp;gt; branch of &amp;lt;code&amp;gt;kvm.git&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== building an external module with older kernels ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This only works for the x86 architecture.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. If you wish to use a distribution kernel (or just some random kernel you like) with kvm,&lt;br /&gt;
you can get both the userspace and kernel (via git).  In the userspace                  &lt;br /&gt;
toplevel directory, type:&lt;br /&gt;
                                                                                        &lt;br /&gt;
 ./configure [--kerneldir=/path/to/kernel/dir]&lt;br /&gt;
&lt;br /&gt;
2. If you are using a released kvm-XX.tar.gz, skip to step 3. If you got the source from git, you need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 cd kernel&lt;br /&gt;
 make sync LINUX=/path/to/kvm/git/tree&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
3. Finally, build KVM and the KVM modules:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three important directories in this scenario:&lt;br /&gt;
{|border=1&lt;br /&gt;
! kvm-userspace&lt;br /&gt;
| Contains a &amp;lt;code&amp;gt;kernel&amp;lt;/code&amp;gt; subdirectory. If you got the source from git, it needs to be populated with files from the kvm.git repository (using &amp;lt;code&amp;gt;make sync&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
! host kernel tree&lt;br /&gt;
| Older kernel you want to use newer KVM modules with. Refer to it with &amp;lt;code&amp;gt;configure --kerneldir&amp;lt;/code&amp;gt;.&lt;br /&gt;
You need to point to a &#039;&#039;&#039;configured&#039;&#039;&#039; kernel source tree corresponding to the kernel you are building modules for. The default is to look for the sources of the running kernel at &amp;lt;code&amp;gt;/lib/modules/`uname -r`/build&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
! kvm kernel tree (from git)&lt;br /&gt;
| A clone of the kvm.git repository. Used as the source of the KVM modules. Refer to it with &amp;lt;code&amp;gt;LINUX=path&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;make sync&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tip about building against Red Hat Enterprise Linux kernels ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;kvm-userspace/kernel&amp;lt;/code&amp;gt; has some compat code to allow it to compile against older kernels, and also some code specific to features that are normally not present on older kernels but are present on RHEL kernels.&lt;br /&gt;
&lt;br /&gt;
So, when building against a RHEL kernel tree, check if the &amp;lt;code&amp;gt;RHEL_*&amp;lt;/code&amp;gt; macros at &amp;lt;code&amp;gt;${kerneldir}/include/linux/version.h&amp;lt;/code&amp;gt; are defined correctly, corresponding to the RHEL version where the kernel source comes from. If those macros aren&#039;t defined correctly, the compat code that allows compilation against RHEL kernels will break and you will get build errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release tags ==&lt;br /&gt;
&lt;br /&gt;
kvm releases are tagged with &amp;lt;code&amp;gt;kvm-nn&amp;lt;/code&amp;gt; where &#039;&#039;nn&#039;&#039; is the release number.&lt;br /&gt;
&lt;br /&gt;
== Binary Packages ==&lt;br /&gt;
=== CentOS / RHEL ===&lt;br /&gt;
&lt;br /&gt;
Unofficial packages of latest releases can be found at&lt;br /&gt;
http://www.lfarkas.org/linux/packages/centos/5/&lt;br /&gt;
&lt;br /&gt;
== nightly snapshots ==&lt;br /&gt;
&lt;br /&gt;
Nightly snapshots, for those who are uncomfortable with git, are [http://people.qumranet.com/avi/snapshots available].  When reporting a problem with a snapshot, please quote the snapshot name (which includes the date) and the contents of the SOURCES file in the snapshot tarball.&lt;/div&gt;</summary>
		<author><name>Spooch</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Code&amp;diff=2253</id>
		<title>Code</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Code&amp;diff=2253"/>
		<updated>2009-04-27T13:20:16Z</updated>

		<summary type="html">&lt;p&gt;Spooch: adjusting kvm-userspace to qemu-kvm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code=&lt;br /&gt;
&lt;br /&gt;
[[Category:Architechture]]&lt;br /&gt;
== kernel git tree ==&lt;br /&gt;
The kvm kernel code is available through a git tree.  To create a repository using git, type&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm.git&lt;br /&gt;
&lt;br /&gt;
Alternatively, it is also accessible through the kernel.org gitweb interface:               &lt;br /&gt;
[http://git.kernel.org/?p=linux/kernel/git/avi/kvm.git;a=summary]&lt;br /&gt;
&lt;br /&gt;
For subsequent upgrades use the command&lt;br /&gt;
                                       &lt;br /&gt;
 git-pull&lt;br /&gt;
in the git working dir.&lt;br /&gt;
&lt;br /&gt;
== userspace git tree ==&lt;br /&gt;
The kvm userspace code (libkvm and qemu) is available through a git tree. To create a repository using git, type&lt;br /&gt;
                                                                                      &lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git&lt;br /&gt;
&lt;br /&gt;
Alternatively, it is also accessible through the kernel.org gitweb interface:         &lt;br /&gt;
[http://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git;a=summary]&lt;br /&gt;
&lt;br /&gt;
== linux guest drivers kit ==&lt;br /&gt;
This kit converts a virtio-capable kernel into a package that can generate linux guest drivers for older kernels.                                                                                                 &lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-guest-drivers-linux.git&lt;br /&gt;
&lt;br /&gt;
The corresponding kernel tree can found in the &amp;lt;code&amp;gt;virtio&amp;lt;/code&amp;gt; branch of &amp;lt;code&amp;gt;kvm.git&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== building an external module with older kernels ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This only works for the x86 architecture.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. If you wish to use a distribution kernel (or just some random kernel you like) with kvm,&lt;br /&gt;
you can get both the userspace and kernel (via git).  In the userspace                  &lt;br /&gt;
toplevel directory, type:&lt;br /&gt;
                                                                                        &lt;br /&gt;
 ./configure [--kerneldir=/path/to/kernel/dir]&lt;br /&gt;
&lt;br /&gt;
2. If you are using a released kvm-XX.tar.gz, skip to step 3. If you got the source from git, you need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 cd kernel&lt;br /&gt;
 make sync LINUX=/path/to/kvm/git/tree&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
3. Finally, build KVM and the KVM modules:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three important directories in this scenario:&lt;br /&gt;
{|border=1&lt;br /&gt;
! kvm-userspace&lt;br /&gt;
| Contains a &amp;lt;code&amp;gt;kernel&amp;lt;/code&amp;gt; subdirectory. If you got the source from git, it needs to be populated with files from the kvm.git repository (using &amp;lt;code&amp;gt;make sync&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
! host kernel tree&lt;br /&gt;
| Older kernel you want to use newer KVM modules with. Refer to it with &amp;lt;code&amp;gt;configure --kerneldir&amp;lt;/code&amp;gt;.&lt;br /&gt;
You need to point to a &#039;&#039;&#039;configured&#039;&#039;&#039; kernel source tree corresponding to the kernel you are building modules for. The default is to look for the sources of the running kernel at &amp;lt;code&amp;gt;/lib/modules/`uname -r`/build&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
! kvm kernel tree (from git)&lt;br /&gt;
| A clone of the kvm.git repository. Used as the source of the KVM modules. Refer to it with &amp;lt;code&amp;gt;LINUX=path&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;make sync&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tip about building against Red Hat Enterprise Linux kernels ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;kvm-userspace/kernel&amp;lt;/code&amp;gt; has some compat code to allow it to compile against older kernels, and also some code specific to features that are normally not present on older kernels but are present on RHEL kernels.&lt;br /&gt;
&lt;br /&gt;
So, when building against a RHEL kernel tree, check if the &amp;lt;code&amp;gt;RHEL_*&amp;lt;/code&amp;gt; macros at &amp;lt;code&amp;gt;${kerneldir}/include/linux/version.h&amp;lt;/code&amp;gt; are defined correctly, corresponding to the RHEL version where the kernel source comes from. If those macros aren&#039;t defined correctly, the compat code that allows compilation against RHEL kernels will break and you will get build errors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== release tags ==&lt;br /&gt;
&lt;br /&gt;
kvm releases are tagged with &amp;lt;code&amp;gt;kvm-nn&amp;lt;/code&amp;gt; where &#039;&#039;nn&#039;&#039; is the release number.&lt;br /&gt;
&lt;br /&gt;
== Binary Packages ==&lt;br /&gt;
=== CentOS / RHEL ===&lt;br /&gt;
&lt;br /&gt;
Unofficial packages of latest releases can be found at&lt;br /&gt;
http://www.lfarkas.org/linux/packages/centos/5/&lt;br /&gt;
&lt;br /&gt;
== nightly snapshots ==&lt;br /&gt;
&lt;br /&gt;
Nightly snapshots, for those who are uncomfortable with git, are [http://people.qumranet.com/avi/snapshots available].  When reporting a problem with a snapshot, please quote the snapshot name (which includes the date) and the contents of the SOURCES file in the snapshot tarball.&lt;/div&gt;</summary>
		<author><name>Spooch</name></author>
	</entry>
</feed>