2011-09-05 15:07:01 +08:00
|
|
|
<domain type='qemu'>
|
|
|
|
<name>QEMUGuest1</name>
|
|
|
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
2012-02-23 08:48:38 +08:00
|
|
|
<memory unit='KiB'>219136</memory>
|
2012-02-23 12:18:39 +08:00
|
|
|
<currentMemory unit='KiB'>219136</currentMemory>
|
2012-05-09 00:04:36 +08:00
|
|
|
<vcpu placement='static'>1</vcpu>
|
2011-09-05 15:07:01 +08:00
|
|
|
<os>
|
|
|
|
<type arch='i686' machine='pc'>hvm</type>
|
|
|
|
<boot dev='hd'/>
|
|
|
|
</os>
|
|
|
|
<devices>
|
|
|
|
<emulator>/usr/bin/qemu</emulator>
|
|
|
|
<memballoon model='virtio'/>
|
|
|
|
|
|
|
|
<controller type='usb' index='0' model='piix3-uhci'>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='1' function='2'/>
|
|
|
|
</controller>
|
|
|
|
|
|
|
|
<controller type='usb' index='1' model='ich9-ehci1'>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='4' function='7'/>
|
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='1' model='ich9-uhci1'>
|
|
|
|
<master startport='0'/>
|
qemu: make PCI multifunction support more manual
When support for was added for PCI multifunction cards (in commit
9f8baf, first included in libvirt 0.9.3), it was done by always
turning on the multifunction bit for all PCI devices. Since that time
it has been realized that this is not an ideal solution, and that the
multifunction bit must be selectively turned on. For example, see
https://bugzilla.redhat.com/show_bug.cgi?id=728174
and the discussion before and after
https://www.redhat.com/archives/libvir-list/2011-September/msg01036.html
This patch modifies multifunction support so that the multifunction=on
option is only added to the qemu commandline for a device if its PCI
<address> definition has the attribute "multifunction='on'", e.g.:
<address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0' multifunction='on'/>
In practice, the multifunction bit should only be turned on if
function='0' AND other functions will be used in the same slot - it
usually isn't needed for functions 1-7 (although there are apparently
some exceptions, e.g. the Intel X53 according to the QEMU source
code), and should never be set if only function 0 will be used in the
slot. The test cases have been changed accordingly to illustrate.
With this patch in place, if a user attempts to assign multiple
functions in a slot without setting the multifunction bit for function
0, libvirt will issue an error when the domain is defined, and the
define operation will fail. In the future, we may decide to detect
this situation and automatically add multifunction=on to avoid the
error; even then it will still be useful to have a manual method of
turning on multifunction since, as stated above, there are some
devices that excpect it to be turned on for all functions in a slot.
A side effect of this patch is that attempts to use the same PCI
address for two different devices will now log an error (previously
this would cause the domain define operation to fail, but there would
be no log message generated). Because the function doing this log was
almost completely rewritten, I didn't think it worthwhile to make a
separate patch for that fix (the entire patch would immediately be
obsoleted).
2011-09-30 01:00:32 +08:00
|
|
|
<address type='pci' domain='0' bus='0' slot='4' function='0' multifunction='on'/>
|
2011-09-05 15:07:01 +08:00
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='1' model='ich9-uhci2'>
|
|
|
|
<master startport='2'/>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='4' function='1'/>
|
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='1' model='ich9-uhci3'>
|
|
|
|
<master startport='4'/>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='4' function='2'/>
|
|
|
|
</controller>
|
|
|
|
|
|
|
|
<controller type='usb' index='2' model='ich9-ehci1'>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='5' function='7'/>
|
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='2' model='ich9-uhci1'>
|
|
|
|
<master startport='0'/>
|
qemu: make PCI multifunction support more manual
When support for was added for PCI multifunction cards (in commit
9f8baf, first included in libvirt 0.9.3), it was done by always
turning on the multifunction bit for all PCI devices. Since that time
it has been realized that this is not an ideal solution, and that the
multifunction bit must be selectively turned on. For example, see
https://bugzilla.redhat.com/show_bug.cgi?id=728174
and the discussion before and after
https://www.redhat.com/archives/libvir-list/2011-September/msg01036.html
This patch modifies multifunction support so that the multifunction=on
option is only added to the qemu commandline for a device if its PCI
<address> definition has the attribute "multifunction='on'", e.g.:
<address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0' multifunction='on'/>
In practice, the multifunction bit should only be turned on if
function='0' AND other functions will be used in the same slot - it
usually isn't needed for functions 1-7 (although there are apparently
some exceptions, e.g. the Intel X53 according to the QEMU source
code), and should never be set if only function 0 will be used in the
slot. The test cases have been changed accordingly to illustrate.
With this patch in place, if a user attempts to assign multiple
functions in a slot without setting the multifunction bit for function
0, libvirt will issue an error when the domain is defined, and the
define operation will fail. In the future, we may decide to detect
this situation and automatically add multifunction=on to avoid the
error; even then it will still be useful to have a manual method of
turning on multifunction since, as stated above, there are some
devices that excpect it to be turned on for all functions in a slot.
A side effect of this patch is that attempts to use the same PCI
address for two different devices will now log an error (previously
this would cause the domain define operation to fail, but there would
be no log message generated). Because the function doing this log was
almost completely rewritten, I didn't think it worthwhile to make a
separate patch for that fix (the entire patch would immediately be
obsoleted).
2011-09-30 01:00:32 +08:00
|
|
|
<address type='pci' domain='0' bus='0' slot='5' function='0' multifunction='on'/>
|
2011-09-05 15:07:01 +08:00
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='2' model='ich9-uhci2'>
|
|
|
|
<master startport='2'/>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='5' function='1'/>
|
|
|
|
</controller>
|
|
|
|
<controller type='usb' index='2' model='ich9-uhci3'>
|
|
|
|
<master startport='4'/>
|
|
|
|
<address type='pci' domain='0' bus='0' slot='5' function='2'/>
|
|
|
|
</controller>
|
|
|
|
|
|
|
|
<input type='tablet' bus='usb'>
|
|
|
|
<address type='usb' bus='0' port='2'/>
|
|
|
|
</input>
|
|
|
|
|
|
|
|
<hub type='usb'>
|
|
|
|
<address type='usb' bus='1' port='1'/>
|
|
|
|
</hub>
|
|
|
|
|
|
|
|
<hostdev mode='subsystem' type='usb'>
|
|
|
|
<source>
|
|
|
|
<address bus='14' device='6'/>
|
|
|
|
</source>
|
|
|
|
<address type='usb' bus='2' port='1'/>
|
|
|
|
</hostdev>
|
|
|
|
|
|
|
|
<hostdev mode='subsystem' type='usb'>
|
|
|
|
<source>
|
|
|
|
<address bus='14' device='7'/>
|
|
|
|
</source>
|
|
|
|
<address type='usb' bus='2' port='2'/>
|
|
|
|
</hostdev>
|
|
|
|
|
|
|
|
</devices>
|
|
|
|
</domain>
|