qemu: assign e1000e network devices to PCIe slots when appropriate

The e1000e is an emulated network device based on the Intel 82574,
present in qemu 2.7.0 and later. Among other differences from the
e1000, it presents itself as a PCIe device rather than legacy PCI. In
order to get it assigned to a PCIe controller, this patch updates the
flags setting for network devices when the model name is "e1000e".

(Note that for some reason libvirt has never validated the network
device model names other than to check that there are no dangerous
characters in them. That should probably change, but is the subject of
another patch.)

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1343094
This commit is contained in:
Laine Stump
2016-08-08 05:23:57 -04:00
parent c7fc151eec
commit 9dfe733e99
6 changed files with 44 additions and 22 deletions

View File

@@ -17,7 +17,7 @@
<disk type='block' device='disk'>
<source dev='/dev/HostVG/QEMUGuest1'/>
<target dev='vdb' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
</disk>
<controller type='pci' index='0' model='pcie-root'/>
<controller type='pci' index='1' model='dmi-to-pci-bridge'>
@@ -90,10 +90,10 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
</controller>
<controller type='virtio-serial' index='0'>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
</controller>
<controller type='scsi' index='0' model='virtio-scsi'>
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</controller>
<controller type='usb' index='0' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
@@ -123,19 +123,24 @@
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</interface>
<interface type='user'>
<mac address='00:11:22:33:44:66'/>
<model type='e1000e'/>
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
</interface>
<input type='passthrough' bus='virtio'>
<source evdev='/dev/input/event1234'/>
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
</input>
<input type='mouse' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
</input>
<input type='keyboard' bus='virtio'>
<input type='mouse' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0c' slot='0x00' function='0x0'/>
</input>
<input type='tablet' bus='virtio'>
<input type='keyboard' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0d' slot='0x00' function='0x0'/>
</input>
<input type='tablet' bus='virtio'>
<address type='pci' domain='0x0000' bus='0x0e' slot='0x00' function='0x0'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<video>
@@ -143,12 +148,12 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
</memballoon>
<rng model='virtio'>
<rate bytes='123' period='1234'/>
<backend model='random'>/dev/urandom</backend>
<address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
<address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
</rng>
</devices>
</domain>

View File

@@ -123,6 +123,11 @@
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
</interface>
<interface type='user'>
<mac address='00:11:22:33:44:66'/>
<model type='e1000e'/>
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
</interface>
<input type='passthrough' bus='virtio'>
<source evdev='/dev/input/event1234'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x08' function='0x0'/>