From 3801831cdf64cb040047b579d02942fe34ff31b5 Mon Sep 17 00:00:00 2001
From: Laine Stump
Date: Wed, 25 Jan 2012 11:20:49 -0500
Subject: [PATCH] qemu: add "romfile" support to specify device boot ROM
This patch addresses: https://bugzilla.redhat.com/show_bug.cgi?id=781562
Along with the "rombar" option that controls whether or not a boot rom
is made visible to the guest, qemu also has a "romfile" option that
allows specifying a binary file to present as the ROM BIOS of any
emulated or passthrough PCI device. This patch adds support for
specifying romfile to both passthrough PCI devices, and emulated
network devices that attach to the guest's PCI bus (just about
everything other than ne2k_isa).
One example of the usefulness of this option is described in the
bugzilla report: 82576 sriov network adapters don't provide a ROM BIOS
for the cards virtual functions (VF), but an image of such a ROM is
available, and with this ROM visible to the guest, it can PXE boot.
In libvirt's xml, the new option is configured like this:
...
...
).
---
docs/formatdomain.html.in | 22 ++++++++---
docs/schemas/domaincommon.rng | 19 +++++++---
src/conf/domain_conf.c | 37 +++++++++++--------
src/conf/domain_conf.h | 1 +
src/qemu/qemu_command.c | 8 ++--
.../qemuxml2argv-pci-rom.args | 7 ++--
.../qemuxml2argvdata/qemuxml2argv-pci-rom.xml | 3 +-
7 files changed, 63 insertions(+), 34 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e90e99f56..ab84730b8 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1741,7 +1741,7 @@
<address bus='0x06' slot='0x02' function='0x0'/>
</source>
<boot order='1'/>
- <rom bar='off'/>
+ <rom bar='on' file='/etc/fake/boot.bin'/>
</hostdev>
</devices>
...
@@ -1783,7 +1783,7 @@
Since 0.8.8
rom
The rom element is used to change how a PCI
- device's ROM is presented to the guest. The bar
+ device's ROM is presented to the guest. The optional bar
attribute can be set to "on" or "off", and determines whether
or not the device's ROM will be visible in the guest's memory
map. (In PCI documentation, the "rombar" setting controls the
@@ -1791,7 +1791,13 @@
bar is specified, the qemu default will be used (older
versions of qemu used a default of "off", while newer qemus
have a default of "on"). Since
- 0.9.7
+ 0.9.7 (QEMU and KVM only). The optional
+ file attribute is used to point to a binary file
+ to be presented to the guest as the device's ROM BIOS. This
+ can be useful, for example, to provide a PXE boot ROM for a
+ virtual function of an sr-iov capable ethernet device (which
+ has no boot ROMs for the VFs).
+ Since 0.9.10 (QEMU and KVM only).
address
The address element for USB devices has a
@@ -2492,7 +2498,7 @@ qemu-kvm -net nic,model=? /dev/null
<interface type='network'>
<source network='default'/>
<target dev='vnet1'/>
- <rom bar='off'/>
+ <rom bar='on' file='/etc/fake/boot.bin'/>
</interface>
</devices>
...
@@ -2506,8 +2512,12 @@ qemu-kvm -net nic,model=? /dev/null
presence of the Base Address Register for the ROM). If no rom
bar is specified, the qemu default will be used (older
versions of qemu used a default of "off", while newer qemus
- have a default of "on"). Since
- 0.9.10 (QEMU and KVM only)
+ have a default of "on").
+ The optional file attribute is used to point to a
+ binary file to be presented to the guest as the device's ROM
+ BIOS. This can be useful to provide an alternative boot ROM for a
+ network device.
+ Since 0.9.10 (QEMU and KVM only).