[libvirt] [PATCH 2/2] qemu: format eim on intel-iommu command line

Andrea Bolognani abologna at redhat.com
Wed May 24 15:02:27 UTC 2017


On Thu, 2017-05-18 at 11:09 +0200, Ján Tomko wrote:
> This option turns on extended interrupt mode,
> which allows more than 255 vCPUs.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1451282
> ---
>  src/qemu/qemu_capabilities.c                         |  2 ++
>  src/qemu/qemu_capabilities.h                         |  1 +
>  src/qemu/qemu_command.c                              | 11 +++++++++++
>  src/qemu/qemu_domain.c                               | 20 ++++++++++++++++++++
>  tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml     |  1 +
>  tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml     |  1 +
>  .../qemuxml2argv-intel-iommu-eim.args                | 19 +++++++++++++++++++
>  tests/qemuxml2argvtest.c                             |  7 +++++++
>  8 files changed, 62 insertions(+)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-eim.args

[...]
> @@ -2663,6 +2663,9 @@ qemuDomainRecheckInternalPaths(virDomainDefPtr def,
>  }
>  
>  
> +#define QEMU_MAX_VCPUS_WITHOUT_EIM 255

This define is very far from the code that actually uses it,
can you please move it right before qemuDomainDefValidate()?

You could even...

> +
> +
>  static int
>  qemuDomainDefVcpusPostParse(virDomainDefPtr def)
>  {
> @@ -3071,6 +3074,23 @@ qemuDomainDefValidate(const virDomainDef *def,
>          }
>      }

... define it here, and...

> +    if (ARCH_IS_X86(def->os.arch) &&
> +        virDomainDefGetVcpusMax(def) > QEMU_MAX_VCPUS_WITHOUT_EIM) {
> +        if (!qemuDomainIsQ35(def)) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +                           _("more than %d vCPUs are only supported on "
> +                             "q35-based machine types"),
> +                           QEMU_MAX_VCPUS_WITHOUT_EIM);
> +            goto cleanup;
> +        }
> +        if (!def->iommu || def->iommu->eim != VIR_TRISTATE_SWITCH_ON) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +                           _("more than %d vCPUs require extended interrupt "
> +                             "mode enabled on the iommu device"),
> +                           QEMU_MAX_VCPUS_WITHOUT_EIM);
> +        }
> +    }

.. undefine it here. Either solution is fine with me.


Reviewed-by: Andrea Bolognani <abologna at redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list