<?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=Sunshout</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=Sunshout"/>
	<link rel="alternate" type="text/html" href="https://linux-kvm.org/page/Special:Contributions/Sunshout"/>
	<updated>2026-04-21T16:56:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Hotadd_pci_devices&amp;diff=5011</id>
		<title>Hotadd pci devices</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Hotadd_pci_devices&amp;diff=5011"/>
		<updated>2014-01-10T11:13:44Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using PCI Hotplug Support ==&lt;br /&gt;
PCI Hotplug support is now available in kvm.git, here is how to use it.&lt;br /&gt;
&lt;br /&gt;
== Install PCI Hotplug drivers in the guest (Linux) ==&lt;br /&gt;
I loaded the following modules to get pci hotplug working:&lt;br /&gt;
* acpiphp                                               &lt;br /&gt;
* pci_hotplug                                           &lt;br /&gt;
&lt;br /&gt;
You can either add these to your distro&#039;s module list to load on boot, or run a command like this.&lt;br /&gt;
&lt;br /&gt;
 for m in acpiphp pci_hotplug; do sudo modprobe ${m}; done&lt;br /&gt;
&lt;br /&gt;
== Use QEMU monitor to hot add device ==&lt;br /&gt;
&lt;br /&gt;
 (qemu) drive_add 0 file=/storage/10G.img,format=qcow2,id=drive-virtio-disk1,if=none &lt;br /&gt;
 (qemu) device_add virtio-blk-pci,scsi=on,drive=drive-virtio-disk1&lt;br /&gt;
&lt;br /&gt;
* check attached PCI devices&lt;br /&gt;
 (qemu) info pci&lt;br /&gt;
&lt;br /&gt;
* notice&lt;br /&gt;
** &#039;&#039;&#039;pci_add&#039;&#039;&#039; is old style, instead use &#039;&#039;&#039;device_add&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Use QEMU monitor to hot add devices ==&lt;br /&gt;
&lt;br /&gt;
The QEMU monitor has a new command, &#039;&#039;&#039;pci_add&#039;&#039;&#039;, which is used to hotadd the pci devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 QEMU 0.9.1 monitor - type &#039;help&#039; for more information&lt;br /&gt;
 (qemu) help pci_add &lt;br /&gt;
 pci_add bus nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]... -- hot-add PCI device&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a NIC ===&lt;br /&gt;
The following command in the QEMU monitor hot-adds a nic to the guest.&lt;br /&gt;
* &#039;&#039;&#039;pci_add auto nic model=e1000&#039;&#039;&#039;                                   &lt;br /&gt;
You can replace &#039;&#039;&#039;model=e1000&#039;&#039;&#039; with either &#039;&#039;&#039;model=rtl8139&#039;&#039;&#039;, &#039;&#039;&#039;model=virtio&#039;&#039;&#039;, or &#039;&#039;&#039;model=ne2k_pci&#039;&#039;&#039;. Note that &#039;&#039;&#039;model=ne2000&#039;&#039;&#039; isn&#039;t pci-based but rather ISA-based and cannot be used for hotplug. &lt;br /&gt;
                                   &lt;br /&gt;
 (qemu) pci_add auto nic  model=e1000 WARNING: PCI region size must be pow2 type=0x0, size=0x60000  OK bus 0, slot 5, function 0 (devfn 40)&lt;br /&gt;
                                                                                                &lt;br /&gt;
&lt;br /&gt;
In the guest we can check if the device was added by looking at dmesg.&lt;br /&gt;
 [   91.808265] acpiphp: Slot [30] registered                          &lt;br /&gt;
 [   91.808276] acpiphp: Slot [31] registered                          &lt;br /&gt;
 [  110.828130] PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0     &lt;br /&gt;
 [  110.828333] decode_hpp: Could not get hotplug parameters. Use defaults&lt;br /&gt;
 [  110.903259] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI &lt;br /&gt;
 [  110.903264] Copyright (c) 1999-2006 Intel Corporation.                &lt;br /&gt;
 [  110.903489] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10         &lt;br /&gt;
 [  110.903492] ACPI: PCI Interrupt 0000:00:05.0[A] -&amp;gt; Link [LNKA] -&amp;gt; GSI 10 (level, high) -&amp;gt; IRQ 10&lt;br /&gt;
 [  111.238713] e1000: 0000:00:05.0: e1000_probe: (PCI:33MHz:32-bit) 52:54:00:12:34:57              &lt;br /&gt;
 [  111.292550] e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection                      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a disk ===&lt;br /&gt;
&lt;br /&gt;
Hot-adding a disk means hot-adding a PCI device, so you need PCI hotplug support in the guest for this to work.&lt;br /&gt;
&lt;br /&gt;
The following command in the QEMU monitor will add a scsi disk to the guest:&lt;br /&gt;
  * &#039;&#039;&#039;pci_add auto storage file=/home/rharper/work/images/empty.img,if=scsi&#039;&#039;&#039;&lt;br /&gt;
You can replace &#039;&#039;&#039;if=scsi&#039;&#039;&#039; with &#039;&#039;&#039;if=virtio&#039;&#039;&#039;, but IDE is not hotpluggable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 QEMU 0.9.1 monitor - type &#039;help&#039; for more information&lt;br /&gt;
(qemu) pci_add auto storage file=/home/rharper/work/images/empty.img,if=scsi&lt;br /&gt;
 OK bus 0, slot 5, function 0 (devfn 40)                                  &lt;br /&gt;
                                                                  &lt;br /&gt;
In the guest we see via dmesg that the device was added.                 &lt;br /&gt;
&lt;br /&gt;
 [  150.581752] PCI: Enabling device 0000:00:05.0 (0000 -&amp;gt; 0003)&lt;br /&gt;
 [  150.582634] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10&lt;br /&gt;
 [  150.582637] ACPI: PCI Interrupt 0000:00:05.0[A] -&amp;gt; Link [LNKA] -&amp;gt; GSI 10 (level, high) -&amp;gt; IRQ 10&lt;br /&gt;
 [  150.585099] sym0: &amp;lt;895a&amp;gt; rev 0x0 at pci 0000:00:05.0 irq 10&lt;br /&gt;
 [  150.594628] sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking&lt;br /&gt;
 [  150.607861] sym0: SCSI BUS has been reset.&lt;br /&gt;
 [  150.607883] scsi2 : sym-2.2.3&lt;br /&gt;
 [  153.608433] scsi 2:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    0.9. PQ: 0 ANSI: 3                                                     &lt;br /&gt;
 [  153.608462]  target2:0:0: tagged command queuingenabled, command queue depth 16. &lt;br /&gt;
 [  153.608484]  target2:0:0: Beginning Domain Validation&lt;br /&gt;
 [  153.609517]  target2:0:0: Domain Validation skipping write tests&lt;br /&gt;
 [  153.609522]  target2:0:0: Ending Domain Validation&lt;br /&gt;
 [  153.618880] scsi 2:0:0:0: Attached scsi generic sg1 type 0&lt;br /&gt;
 [  153.749967] Driver &#039;sd&#039; needs updating - please use bus_type methods&lt;br /&gt;
 [  153.750204] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750253] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750255] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750354] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750478] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750253] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750255] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750354] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750478] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750534] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750536] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750634] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750637]  sda: unknown partition table&lt;br /&gt;
 [  153.759275] sd 2:0:0:0: [sda] Attached SCSI disk&lt;/div&gt;</summary>
		<author><name>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Hotadd_pci_devices&amp;diff=5010</id>
		<title>Hotadd pci devices</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Hotadd_pci_devices&amp;diff=5010"/>
		<updated>2014-01-10T11:12:56Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using PCI Hotplug Support ==&lt;br /&gt;
PCI Hotplug support is now available in kvm.git, here is how to use it.&lt;br /&gt;
&lt;br /&gt;
== Install PCI Hotplug drivers in the guest (Linux) ==&lt;br /&gt;
I loaded the following modules to get pci hotplug working:&lt;br /&gt;
* acpiphp                                               &lt;br /&gt;
* pci_hotplug                                           &lt;br /&gt;
&lt;br /&gt;
You can either add these to your distro&#039;s module list to load on boot, or run a command like this.&lt;br /&gt;
&lt;br /&gt;
 for m in acpiphp pci_hotplug; do sudo modprobe ${m}; done&lt;br /&gt;
&lt;br /&gt;
== Use QEMU monitor to hot add device ==&lt;br /&gt;
&lt;br /&gt;
 (qemu) drive_add 0 file=/storage/10G.img,format=qcow2,id=drive-virtio-disk1,if=none &lt;br /&gt;
 (qemu) device_add virtio-blk-pci,scsi=on,drive=drive-virtio-disk1&lt;br /&gt;
&lt;br /&gt;
* notice&lt;br /&gt;
** &#039;&#039;&#039;pci_add&#039;&#039;&#039; is old style, instead use &#039;&#039;&#039;device_add&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Use QEMU monitor to hot add devices ==&lt;br /&gt;
&lt;br /&gt;
The QEMU monitor has a new command, &#039;&#039;&#039;pci_add&#039;&#039;&#039;, which is used to hotadd the pci devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 QEMU 0.9.1 monitor - type &#039;help&#039; for more information&lt;br /&gt;
 (qemu) help pci_add &lt;br /&gt;
 pci_add bus nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]... -- hot-add PCI device&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a NIC ===&lt;br /&gt;
The following command in the QEMU monitor hot-adds a nic to the guest.&lt;br /&gt;
* &#039;&#039;&#039;pci_add auto nic model=e1000&#039;&#039;&#039;                                   &lt;br /&gt;
You can replace &#039;&#039;&#039;model=e1000&#039;&#039;&#039; with either &#039;&#039;&#039;model=rtl8139&#039;&#039;&#039;, &#039;&#039;&#039;model=virtio&#039;&#039;&#039;, or &#039;&#039;&#039;model=ne2k_pci&#039;&#039;&#039;. Note that &#039;&#039;&#039;model=ne2000&#039;&#039;&#039; isn&#039;t pci-based but rather ISA-based and cannot be used for hotplug. &lt;br /&gt;
                                   &lt;br /&gt;
 (qemu) pci_add auto nic  model=e1000 WARNING: PCI region size must be pow2 type=0x0, size=0x60000  OK bus 0, slot 5, function 0 (devfn 40)&lt;br /&gt;
                                                                                                &lt;br /&gt;
&lt;br /&gt;
In the guest we can check if the device was added by looking at dmesg.&lt;br /&gt;
 [   91.808265] acpiphp: Slot [30] registered                          &lt;br /&gt;
 [   91.808276] acpiphp: Slot [31] registered                          &lt;br /&gt;
 [  110.828130] PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0     &lt;br /&gt;
 [  110.828333] decode_hpp: Could not get hotplug parameters. Use defaults&lt;br /&gt;
 [  110.903259] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI &lt;br /&gt;
 [  110.903264] Copyright (c) 1999-2006 Intel Corporation.                &lt;br /&gt;
 [  110.903489] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10         &lt;br /&gt;
 [  110.903492] ACPI: PCI Interrupt 0000:00:05.0[A] -&amp;gt; Link [LNKA] -&amp;gt; GSI 10 (level, high) -&amp;gt; IRQ 10&lt;br /&gt;
 [  111.238713] e1000: 0000:00:05.0: e1000_probe: (PCI:33MHz:32-bit) 52:54:00:12:34:57              &lt;br /&gt;
 [  111.292550] e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection                      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a disk ===&lt;br /&gt;
&lt;br /&gt;
Hot-adding a disk means hot-adding a PCI device, so you need PCI hotplug support in the guest for this to work.&lt;br /&gt;
&lt;br /&gt;
The following command in the QEMU monitor will add a scsi disk to the guest:&lt;br /&gt;
  * &#039;&#039;&#039;pci_add auto storage file=/home/rharper/work/images/empty.img,if=scsi&#039;&#039;&#039;&lt;br /&gt;
You can replace &#039;&#039;&#039;if=scsi&#039;&#039;&#039; with &#039;&#039;&#039;if=virtio&#039;&#039;&#039;, but IDE is not hotpluggable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 QEMU 0.9.1 monitor - type &#039;help&#039; for more information&lt;br /&gt;
(qemu) pci_add auto storage file=/home/rharper/work/images/empty.img,if=scsi&lt;br /&gt;
 OK bus 0, slot 5, function 0 (devfn 40)                                  &lt;br /&gt;
                                                                  &lt;br /&gt;
In the guest we see via dmesg that the device was added.                 &lt;br /&gt;
&lt;br /&gt;
 [  150.581752] PCI: Enabling device 0000:00:05.0 (0000 -&amp;gt; 0003)&lt;br /&gt;
 [  150.582634] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10&lt;br /&gt;
 [  150.582637] ACPI: PCI Interrupt 0000:00:05.0[A] -&amp;gt; Link [LNKA] -&amp;gt; GSI 10 (level, high) -&amp;gt; IRQ 10&lt;br /&gt;
 [  150.585099] sym0: &amp;lt;895a&amp;gt; rev 0x0 at pci 0000:00:05.0 irq 10&lt;br /&gt;
 [  150.594628] sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking&lt;br /&gt;
 [  150.607861] sym0: SCSI BUS has been reset.&lt;br /&gt;
 [  150.607883] scsi2 : sym-2.2.3&lt;br /&gt;
 [  153.608433] scsi 2:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    0.9. PQ: 0 ANSI: 3                                                     &lt;br /&gt;
 [  153.608462]  target2:0:0: tagged command queuingenabled, command queue depth 16. &lt;br /&gt;
 [  153.608484]  target2:0:0: Beginning Domain Validation&lt;br /&gt;
 [  153.609517]  target2:0:0: Domain Validation skipping write tests&lt;br /&gt;
 [  153.609522]  target2:0:0: Ending Domain Validation&lt;br /&gt;
 [  153.618880] scsi 2:0:0:0: Attached scsi generic sg1 type 0&lt;br /&gt;
 [  153.749967] Driver &#039;sd&#039; needs updating - please use bus_type methods&lt;br /&gt;
 [  153.750204] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750253] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750255] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750354] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750478] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750253] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750255] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750354] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750478] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750534] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750536] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750634] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750637]  sda: unknown partition table&lt;br /&gt;
 [  153.759275] sd 2:0:0:0: [sda] Attached SCSI disk&lt;/div&gt;</summary>
		<author><name>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Hotadd_pci_devices&amp;diff=5009</id>
		<title>Hotadd pci devices</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Hotadd_pci_devices&amp;diff=5009"/>
		<updated>2014-01-10T11:08:34Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using PCI Hotplug Support ==&lt;br /&gt;
PCI Hotplug support is now available in kvm.git, here is how to use it.&lt;br /&gt;
&lt;br /&gt;
== Install PCI Hotplug drivers in the guest (Linux) ==&lt;br /&gt;
I loaded the following modules to get pci hotplug working:&lt;br /&gt;
* acpiphp                                               &lt;br /&gt;
* pci_hotplug                                           &lt;br /&gt;
&lt;br /&gt;
You can either add these to your distro&#039;s module list to load on boot, or run a command like this.&lt;br /&gt;
&lt;br /&gt;
 for m in acpiphp pci_hotplug; do sudo modprobe ${m}; done&lt;br /&gt;
&lt;br /&gt;
* notice&lt;br /&gt;
** &#039;&#039;&#039;pci_add&#039;&#039;&#039; is old style, instead use &#039;&#039;&#039;device_add&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Use QEMU monitor to hot add devices ==&lt;br /&gt;
&lt;br /&gt;
The QEMU monitor has a new command, &#039;&#039;&#039;pci_add&#039;&#039;&#039;, which is used to hotadd the pci devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 QEMU 0.9.1 monitor - type &#039;help&#039; for more information&lt;br /&gt;
 (qemu) help pci_add &lt;br /&gt;
 pci_add bus nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]... -- hot-add PCI device&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a NIC ===&lt;br /&gt;
The following command in the QEMU monitor hot-adds a nic to the guest.&lt;br /&gt;
* &#039;&#039;&#039;pci_add auto nic model=e1000&#039;&#039;&#039;                                   &lt;br /&gt;
You can replace &#039;&#039;&#039;model=e1000&#039;&#039;&#039; with either &#039;&#039;&#039;model=rtl8139&#039;&#039;&#039;, &#039;&#039;&#039;model=virtio&#039;&#039;&#039;, or &#039;&#039;&#039;model=ne2k_pci&#039;&#039;&#039;. Note that &#039;&#039;&#039;model=ne2000&#039;&#039;&#039; isn&#039;t pci-based but rather ISA-based and cannot be used for hotplug. &lt;br /&gt;
                                   &lt;br /&gt;
 (qemu) pci_add auto nic  model=e1000 WARNING: PCI region size must be pow2 type=0x0, size=0x60000  OK bus 0, slot 5, function 0 (devfn 40)&lt;br /&gt;
                                                                                                &lt;br /&gt;
&lt;br /&gt;
In the guest we can check if the device was added by looking at dmesg.&lt;br /&gt;
 [   91.808265] acpiphp: Slot [30] registered                          &lt;br /&gt;
 [   91.808276] acpiphp: Slot [31] registered                          &lt;br /&gt;
 [  110.828130] PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0     &lt;br /&gt;
 [  110.828333] decode_hpp: Could not get hotplug parameters. Use defaults&lt;br /&gt;
 [  110.903259] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI &lt;br /&gt;
 [  110.903264] Copyright (c) 1999-2006 Intel Corporation.                &lt;br /&gt;
 [  110.903489] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10         &lt;br /&gt;
 [  110.903492] ACPI: PCI Interrupt 0000:00:05.0[A] -&amp;gt; Link [LNKA] -&amp;gt; GSI 10 (level, high) -&amp;gt; IRQ 10&lt;br /&gt;
 [  111.238713] e1000: 0000:00:05.0: e1000_probe: (PCI:33MHz:32-bit) 52:54:00:12:34:57              &lt;br /&gt;
 [  111.292550] e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection                      &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a disk ===&lt;br /&gt;
&lt;br /&gt;
Hot-adding a disk means hot-adding a PCI device, so you need PCI hotplug support in the guest for this to work.&lt;br /&gt;
&lt;br /&gt;
The following command in the QEMU monitor will add a scsi disk to the guest:&lt;br /&gt;
  * &#039;&#039;&#039;pci_add auto storage file=/home/rharper/work/images/empty.img,if=scsi&#039;&#039;&#039;&lt;br /&gt;
You can replace &#039;&#039;&#039;if=scsi&#039;&#039;&#039; with &#039;&#039;&#039;if=virtio&#039;&#039;&#039;, but IDE is not hotpluggable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 QEMU 0.9.1 monitor - type &#039;help&#039; for more information&lt;br /&gt;
(qemu) pci_add auto storage file=/home/rharper/work/images/empty.img,if=scsi&lt;br /&gt;
 OK bus 0, slot 5, function 0 (devfn 40)                                  &lt;br /&gt;
                                                                  &lt;br /&gt;
In the guest we see via dmesg that the device was added.                 &lt;br /&gt;
&lt;br /&gt;
 [  150.581752] PCI: Enabling device 0000:00:05.0 (0000 -&amp;gt; 0003)&lt;br /&gt;
 [  150.582634] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10&lt;br /&gt;
 [  150.582637] ACPI: PCI Interrupt 0000:00:05.0[A] -&amp;gt; Link [LNKA] -&amp;gt; GSI 10 (level, high) -&amp;gt; IRQ 10&lt;br /&gt;
 [  150.585099] sym0: &amp;lt;895a&amp;gt; rev 0x0 at pci 0000:00:05.0 irq 10&lt;br /&gt;
 [  150.594628] sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking&lt;br /&gt;
 [  150.607861] sym0: SCSI BUS has been reset.&lt;br /&gt;
 [  150.607883] scsi2 : sym-2.2.3&lt;br /&gt;
 [  153.608433] scsi 2:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    0.9. PQ: 0 ANSI: 3                                                     &lt;br /&gt;
 [  153.608462]  target2:0:0: tagged command queuingenabled, command queue depth 16. &lt;br /&gt;
 [  153.608484]  target2:0:0: Beginning Domain Validation&lt;br /&gt;
 [  153.609517]  target2:0:0: Domain Validation skipping write tests&lt;br /&gt;
 [  153.609522]  target2:0:0: Ending Domain Validation&lt;br /&gt;
 [  153.618880] scsi 2:0:0:0: Attached scsi generic sg1 type 0&lt;br /&gt;
 [  153.749967] Driver &#039;sd&#039; needs updating - please use bus_type methods&lt;br /&gt;
 [  153.750204] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750253] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750255] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750354] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750478] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750253] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750255] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750354] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750478] sd 2:0:0:0: [sda] 20971520 512-byte hardware sectors (10737 MB)&lt;br /&gt;
 [  153.750534] sd 2:0:0:0: [sda] Write Protect is off&lt;br /&gt;
 [  153.750536] sd 2:0:0:0: [sda] Mode Sense: 14 00 00 00&lt;br /&gt;
 [  153.750634] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn&#039;t support DPO or FUA&lt;br /&gt;
 [  153.750637]  sda: unknown partition table&lt;br /&gt;
 [  153.759275] sd 2:0:0:0: [sda] Attached SCSI disk&lt;/div&gt;</summary>
		<author><name>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=PCITodo&amp;diff=5002</id>
		<title>PCITodo</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=PCITodo&amp;diff=5002"/>
		<updated>2013-12-18T06:03:21Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page should cover all PCI related activity in KVM.&lt;br /&gt;
&lt;br /&gt;
TODO: add bugzilla entry links.&lt;br /&gt;
&lt;br /&gt;
=== projects in progress. contributions are still very welcome! ===&lt;br /&gt;
&lt;br /&gt;
* virtio device as PCI Express device&lt;br /&gt;
  Issue: Express spec requires device can work without IO,&lt;br /&gt;
  virtio requires IO at the moment.&lt;br /&gt;
  Plan: add support for memory BARs.&lt;br /&gt;
  Developer: Michael S. Tsirkin&lt;br /&gt;
&lt;br /&gt;
* Hotplug for devices behind PCI bridges&lt;br /&gt;
  Issue: QEMU lacks support for device hotplug behind&lt;br /&gt;
  pci bridges.&lt;br /&gt;
&lt;br /&gt;
   Plan:&lt;br /&gt;
    - each bus gets assigned a number 0-255&lt;br /&gt;
    - generated ACPI code writes this number&lt;br /&gt;
      to a new BSEL register, then uses existing&lt;br /&gt;
      UP/DOWN registers to probe slot status;&lt;br /&gt;
      to eject, write number to BSEL register,&lt;br /&gt;
      then slot into existing EJ&lt;br /&gt;
    This is to address the ACPI spec requirement to&lt;br /&gt;
    avoid config cycle access to any bus except PCI roots.&lt;br /&gt;
&lt;br /&gt;
    Note: ACPI doesn&#039;t support adding or removing bridges by hotplug.&lt;br /&gt;
    We should and prevent removal of bridges by hotplug,&lt;br /&gt;
    unless they were added by hotplug previously&lt;br /&gt;
    (and so, are not described by ACPI).&lt;br /&gt;
  Developer: Michael S. Tsirkin&lt;br /&gt;
&lt;br /&gt;
* Hotplug for Q35&lt;br /&gt;
   Issue: QEMU does not support hotplug for Q35&lt;br /&gt;
   Plan: since we need to support hotplug of PCI devices,&lt;br /&gt;
   let&#039;s use ACPI hotplug for everything&lt;br /&gt;
   Use same interface as we do for PCI, this way&lt;br /&gt;
   same ACPI code can be reused.&lt;br /&gt;
&lt;br /&gt;
   Developer: Michael S. Tsirkin&lt;br /&gt;
&lt;br /&gt;
* Support for different PCI express link width/speed settings&lt;br /&gt;
      Issue: QEMU currently emulates all links at minimal&lt;br /&gt;
      width and speed. This means we don&#039;t need to emulate&lt;br /&gt;
      link negotiation, but might in theory confuse guests&lt;br /&gt;
      for assigned devices.&lt;br /&gt;
      The issue is complicated by the fact that real link speed&lt;br /&gt;
      might be limited by the slot where assigned device is put.&lt;br /&gt;
      Plan: add management interface to control the max link&lt;br /&gt;
      speed and width for the slot.&lt;br /&gt;
      Teach management to query this at slot level.&lt;br /&gt;
      For device, query it from device itself.&lt;br /&gt;
      Support link width/speed negotiation  as per spec.&lt;br /&gt;
   Developer: Alex Williamson&lt;br /&gt;
&lt;br /&gt;
=== projects that are not started yet - no owner ===&lt;br /&gt;
&lt;br /&gt;
* PCI interrupts should be active-low&lt;br /&gt;
      Issue: PCI INT#x interrupts are normally active-low.&lt;br /&gt;
      QEMU emulates them as active high. Works fine for&lt;br /&gt;
      windows and linux but not guaranteed for other guests.       &lt;br /&gt;
      See http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/&lt;br /&gt;
&lt;br /&gt;
      Plan: add support for active-low interrupts in KVM.&lt;br /&gt;
            Enable this for PCI interrupts.&lt;br /&gt;
            Change DSDT appropriately.&lt;br /&gt;
&lt;br /&gt;
      Developer: &lt;br /&gt;
      Testing: stress-test devices with INT#x interrupts&lt;br /&gt;
      with interrupt sharing in particular&lt;br /&gt;
&lt;br /&gt;
* PCI master-abort is not emulated correctly&lt;br /&gt;
      Issue: access to disabled PCI memory normally returns&lt;br /&gt;
      all-ones (or read) and sets master abort&lt;br /&gt;
      detected bit in bridge.&lt;br /&gt;
      For express, it can also trigger AER reporting&lt;br /&gt;
      when enabled.&lt;br /&gt;
      QEMU does not emulate any of this: reads return 0,&lt;br /&gt;
      writes.&lt;br /&gt;
      Plan: add catch-all memory region with low priority&lt;br /&gt;
      in bridge, and trigger the required actions.&lt;br /&gt;
&lt;br /&gt;
* Better modeling for PCI INT#x&lt;br /&gt;
      Issue: for a device deep down a bridge hierarchy,&lt;br /&gt;
      we scan the tree upwards on each interrupt,&lt;br /&gt;
      calling map_irq at each level, this is bad for performance.&lt;br /&gt;
      Behaviour is also open-coded at each level, this is ugly.&lt;br /&gt;
      Plan: something similar to MemoryRegion API:&lt;br /&gt;
      add objects that represent PCI INT#x pings&lt;br /&gt;
      (maybe pins in general) model their connection at&lt;br /&gt;
      each level. Each time there&#039;s a change, re-map&lt;br /&gt;
      them. On data path, use pre-computed irq# to&lt;br /&gt;
      send/clear the interrupt quickly.&lt;br /&gt;
&lt;br /&gt;
* Subtractive decoding support&lt;br /&gt;
      Support subtractive decoding in PCI bridges.&lt;br /&gt;
&lt;br /&gt;
* Support VGA behind a PCI bridge&lt;br /&gt;
      Support VGA devices behind PCI bridges.&lt;br /&gt;
      Good for things like multiple VGA cards.&lt;br /&gt;
      Requires subtractive decoding.&lt;br /&gt;
&lt;br /&gt;
=== vague ideas: path to implementation not clear ===&lt;br /&gt;
* Way to figure out proper PCI connectivity options.&lt;br /&gt;
      Issue: How do you know where you can connect a device?&lt;br /&gt;
      For PCI, this includes the legal bus addresses,&lt;br /&gt;
      hotplug support for bus,&lt;br /&gt;
      how the secondary bus is named,&lt;br /&gt;
      and whether bridges support required addressing modes.&lt;br /&gt;
      For PCI Express, there are additional options:&lt;br /&gt;
      root or downstream port,&lt;br /&gt;
      virtual bridge in root complex/upstream port.&lt;br /&gt;
      management tools end up hard-coding this information,&lt;br /&gt;
      based simply on device name, but that&#039;s ugly.&lt;br /&gt;
      Vague idea: add interfaces to figure out what can be&lt;br /&gt;
      connected to what and how, or at least the function of each device.&lt;br /&gt;
      People to contact: Laine Stump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Fix AHCI for stability&lt;br /&gt;
      Not related to PCI directly but modern chipsets&lt;br /&gt;
      with PCI Express support all use AHCI.&lt;br /&gt;
      Issue1: AHCI is unstable with windows guests&lt;br /&gt;
       (win7 fails to boot sometimes)&lt;br /&gt;
      Issue2:  guests sometimes crash when doing ping pong migration&lt;br /&gt;
      People to contact: Alexander Graf&lt;/div&gt;</summary>
		<author><name>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=User:Sunshout&amp;diff=5001</id>
		<title>User:Sunshout</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=User:Sunshout&amp;diff=5001"/>
		<updated>2013-12-18T02:04:24Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KVM Features Table =&lt;br /&gt;
&lt;br /&gt;
= CPU =&lt;br /&gt;
&lt;br /&gt;
= Memory =&lt;br /&gt;
&lt;br /&gt;
= Disk =&lt;br /&gt;
&lt;br /&gt;
= Network =&lt;br /&gt;
&lt;br /&gt;
== Hot plugin ==&lt;br /&gt;
&lt;br /&gt;
netdev_add&lt;/div&gt;</summary>
		<author><name>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=User:Sunshout&amp;diff=5000</id>
		<title>User:Sunshout</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=User:Sunshout&amp;diff=5000"/>
		<updated>2013-12-18T02:02:03Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KVM Features Table =&lt;br /&gt;
&lt;br /&gt;
= CPU =&lt;br /&gt;
&lt;br /&gt;
= Memory =&lt;br /&gt;
&lt;br /&gt;
= Disk =&lt;br /&gt;
&lt;br /&gt;
= Network =&lt;/div&gt;</summary>
		<author><name>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Code&amp;diff=4999</id>
		<title>Code</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Code&amp;diff=4999"/>
		<updated>2013-12-18T01:55:07Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code=&lt;br /&gt;
&lt;br /&gt;
[[Category:Architechture]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== kernel git tree ==&lt;br /&gt;
&lt;br /&gt;
The kvm kernel code is available through a git tree (like the kernel itself).  To create a repository using git, type&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/virt/kvm/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/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;
&lt;br /&gt;
in the git working directory.&lt;br /&gt;
&lt;br /&gt;
== kernel git workflow ==&lt;br /&gt;
&lt;br /&gt;
See [[Kvm-Git-Workflow]]&lt;br /&gt;
&lt;br /&gt;
== userspace git tree ==&lt;br /&gt;
&lt;br /&gt;
As of QEMU 1.3, the KVM userspace code is in mainline QEMU.  Please use and develop with&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.qemu-project.org/qemu.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want to contribute code&#039;&#039;&#039;, please see the [http://wiki.qemu.org/Contribute/StartHere guidelines] and submit patches to qemu-devel@nongnu.org.&lt;br /&gt;
&lt;br /&gt;
The old qemu-kvm.git fork repository is still available but outdated, 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;
== 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 use the external module kit.  You will need the kvm-kmod repository:&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kiszka.org/kvm-kmod.git&lt;br /&gt;
 cd kvm-kmod&lt;br /&gt;
 git submodule update --init&lt;br /&gt;
 ./configure [--kerneldir=/path/to/kernel/dir]&lt;br /&gt;
 make sync&lt;br /&gt;
 make&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 stable releases (based off of Qemu&#039;s stable branch) are tagged with &amp;lt;code&amp;gt;kvm-qemu-0.NN.N&amp;lt;/code&amp;gt; where &#039;&#039;N&#039;&#039; equates to the upstream Qemu branch versions. Note that kvm has them tagged not branched.&lt;br /&gt;
&lt;br /&gt;
kvm development 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;
&lt;br /&gt;
=== CentOS / RHEL ===&lt;br /&gt;
&lt;br /&gt;
Unofficial packages of latest releases can be found at:&lt;br /&gt;
&amp;lt;code&amp;gt;http://www.lfarkas.org/linux/packages/centos/5/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
For Debian Lenny, please use packages from backports.debian.org - for &amp;lt;em&amp;gt;both&amp;lt;/em&amp;gt; qemu-kvm and kernel (at least 2.6.32).  It is important to use more recent kernel - 2.6.26 does not work well with kvm.&lt;br /&gt;
&lt;br /&gt;
Note that package &amp;quot;kvm&amp;quot; has been renamed to &amp;quot;qemu-kvm&amp;quot; in Squeeze and in Lenny backports (and kvm is now transitional package that installs qemu-kvm automatically).&lt;br /&gt;
&lt;br /&gt;
Debian Squeeze will have qemu-kvm based on 0.12, available in standard repositories.&lt;br /&gt;
&lt;br /&gt;
Experimental 0.13 packages are available at &lt;br /&gt;
&amp;lt;code&amp;gt;http://www.corpit.ru/debian/tls/kvm/0.13/&amp;lt;/code&amp;gt; , pending upload to debian -experimental.&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>Sunshout</name></author>
	</entry>
	<entry>
		<id>https://linux-kvm.org/index.php?title=Code&amp;diff=4998</id>
		<title>Code</title>
		<link rel="alternate" type="text/html" href="https://linux-kvm.org/index.php?title=Code&amp;diff=4998"/>
		<updated>2013-12-18T01:54:36Z</updated>

		<summary type="html">&lt;p&gt;Sunshout: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Code=&lt;br /&gt;
&lt;br /&gt;
[[Category:Architechture]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== kernel git tree ==&lt;br /&gt;
&lt;br /&gt;
The kvm kernel code is available through a git tree (like the kernel itself).  To create a repository using git, type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
git clone git://git.kernel.org/pub/scm/virt/kvm/kvm.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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/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;
&lt;br /&gt;
in the git working directory.&lt;br /&gt;
&lt;br /&gt;
== kernel git workflow ==&lt;br /&gt;
&lt;br /&gt;
See [[Kvm-Git-Workflow]]&lt;br /&gt;
&lt;br /&gt;
== userspace git tree ==&lt;br /&gt;
&lt;br /&gt;
As of QEMU 1.3, the KVM userspace code is in mainline QEMU.  Please use and develop with&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.qemu-project.org/qemu.git&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you want to contribute code&#039;&#039;&#039;, please see the [http://wiki.qemu.org/Contribute/StartHere guidelines] and submit patches to qemu-devel@nongnu.org.&lt;br /&gt;
&lt;br /&gt;
The old qemu-kvm.git fork repository is still available but outdated, 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;
== 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 use the external module kit.  You will need the kvm-kmod repository:&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kiszka.org/kvm-kmod.git&lt;br /&gt;
 cd kvm-kmod&lt;br /&gt;
 git submodule update --init&lt;br /&gt;
 ./configure [--kerneldir=/path/to/kernel/dir]&lt;br /&gt;
 make sync&lt;br /&gt;
 make&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 stable releases (based off of Qemu&#039;s stable branch) are tagged with &amp;lt;code&amp;gt;kvm-qemu-0.NN.N&amp;lt;/code&amp;gt; where &#039;&#039;N&#039;&#039; equates to the upstream Qemu branch versions. Note that kvm has them tagged not branched.&lt;br /&gt;
&lt;br /&gt;
kvm development 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;
&lt;br /&gt;
=== CentOS / RHEL ===&lt;br /&gt;
&lt;br /&gt;
Unofficial packages of latest releases can be found at:&lt;br /&gt;
&amp;lt;code&amp;gt;http://www.lfarkas.org/linux/packages/centos/5/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
For Debian Lenny, please use packages from backports.debian.org - for &amp;lt;em&amp;gt;both&amp;lt;/em&amp;gt; qemu-kvm and kernel (at least 2.6.32).  It is important to use more recent kernel - 2.6.26 does not work well with kvm.&lt;br /&gt;
&lt;br /&gt;
Note that package &amp;quot;kvm&amp;quot; has been renamed to &amp;quot;qemu-kvm&amp;quot; in Squeeze and in Lenny backports (and kvm is now transitional package that installs qemu-kvm automatically).&lt;br /&gt;
&lt;br /&gt;
Debian Squeeze will have qemu-kvm based on 0.12, available in standard repositories.&lt;br /&gt;
&lt;br /&gt;
Experimental 0.13 packages are available at &lt;br /&gt;
&amp;lt;code&amp;gt;http://www.corpit.ru/debian/tls/kvm/0.13/&amp;lt;/code&amp;gt; , pending upload to debian -experimental.&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>Sunshout</name></author>
	</entry>
</feed>