From 3284ac046fedc5b21c2bd153aa0f621a19a52e96 Mon Sep 17 00:00:00 2001
From: Laine Stump
Date: Tue, 24 Jan 2012 19:54:12 -0500
Subject: [PATCH] qemu: (and conf) support rombar for network devices
When support for the rombar option was added, it was only added for
PCI passthrough devices, configured with . The same option is
available for any network device that is attached to the guest's PCI
bus. This patch allows setting rombar for any PCI network device type.
After adding cases to test this to qemuxml2argv-hostdev-pci-rombar.*,
I decided to rename those files (to qemuxml2argv-pci-rom.*) to more
accurately reflect the additional tests, and also noticed that up to
now we've only been performing a domainschematest for that case, so I
added the "pci-rom" test to both qemuxml2argv and qemuxml2xml (and in
the process found some bugs whose fixes I squashed into previous
commits of this series).
---
docs/formatdomain.html.in | 27 ++++++++++
docs/schemas/domaincommon.rng | 25 +++++----
src/conf/domain_conf.c | 6 ++-
src/qemu/qemu_command.c | 54 ++++++++++++-------
.../qemuxml2argv-hostdev-pci-rombar.args | 5 --
.../qemuxml2argv-pci-rom.args | 11 ++++
...ci-rombar.xml => qemuxml2argv-pci-rom.xml} | 17 ++++++
tests/qemuxml2argvtest.c | 3 ++
tests/qemuxml2xmltest.c | 1 +
9 files changed, 114 insertions(+), 35 deletions(-)
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-rombar.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-rom.args
rename tests/qemuxml2argvdata/{qemuxml2argv-hostdev-pci-rombar.xml => qemuxml2argv-pci-rom.xml} (60%)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 464c4a33ca..e90e99f569 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1955,6 +1955,7 @@
<mac address='00:16:3e:5d:c7:9e'/>
<script path='vif-bridge'/>
<boot order='1'/>
+ <rom bar='off'/>
</interface>
</devices>
...
@@ -2483,6 +2484,32 @@ qemu-kvm -net nic,model=? /dev/null
Since 0.8.8
+ For hypervisors which support this, you can change how a PCI Network
+ device's ROM is presented to the guest. The 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
+ 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)
+