On Tue, May 09, 2017 at 01:08:55PM +0200, Andrea Bolognani wrote:
On Wed, 2017-05-03 at 16:05 +0200, Ján Tomko wrote:
> Add a new <ioapic> element with a driver attribute.
>
> Possible values are qemu and kvm. With 'qemu', the I/O
> APIC can be put in the userspace even for KVM domains.
>
>
https://bugzilla.redhat.com/show_bug.cgi?id=1427005
> ---
> docs/formatdomain.html.in | 8 ++++++
> docs/schemas/domaincommon.rng | 15 ++++++++++
> src/conf/domain_conf.c | 33 +++++++++++++++++++++-
> src/conf/domain_conf.h | 11 ++++++++
> .../qemuxml2argv-intel-iommu-ioapic.xml | 29 +++++++++++++++++++
> .../qemuxml2xmlout-intel-iommu-ioapic.xml | 1 +
> tests/qemuxml2xmltest.c | 1 +
> 7 files changed, 97 insertions(+), 1 deletion(-)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-ioapic.xml
> create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-ioapic.xml
Please make sure that only x86 guests can use the <ioapic/>
feature, and all other guests get an error instead.
Also I didn't check whether this is the case already, but
the feature should be advertised the same way <apic/> is,
and in particular it should show up in the capabilities XML.
I have sent the capabilites as a separate patch.
Re: x86-only: would squashing this in do?
Jan
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index cc02c80..7805b76 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2807,6 +2807,22 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def)
static int
+qemuDomainDefVerifyFeatures(const virDomainDef *def)
+{
+ if (def->features[VIR_DOMAIN_FEATURE_IOAPIC] == VIR_TRISTATE_SWITCH_ON &&
+ !ARCH_IS_X86(def->os.arch)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("I/O APIC tuning is not supported "
+ "for '%s' architecture"),
+ virArchToString(def->os.arch));
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int
qemuDomainDefPostParse(virDomainDefPtr def,
virCapsPtr caps,
unsigned int parseFlags,
@@ -2861,6 +2877,9 @@ qemuDomainDefPostParse(virDomainDefPtr def,
qemuDomainDefEnableDefaultFeatures(def, qemuCaps);
+ if (qemuDomainDefVerifyFeatures(def) < 0)
+ goto cleanup;
+
if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0)
goto cleanup;