[libvirt] [PATCHv2 1/6] conf: add <irqchip mode> to <features>

John Ferlan jferlan at redhat.com
Mon Apr 24 21:40:07 UTC 2017



On 04/20/2017 08:19 AM, Ján Tomko wrote:
> Add a new <irqchip> element with a mode attribute.
> 
> Possible values are off, split or on.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1427005
> ---
>  docs/formatdomain.html.in                          | 10 +++++++
>  docs/schemas/domaincommon.rng                      | 16 ++++++++++
>  src/conf/domain_conf.c                             | 34 +++++++++++++++++++++-
>  src/conf/domain_conf.h                             | 12 ++++++++
>  .../qemuxml2argv-intel-iommu-irqchip.xml           | 29 ++++++++++++++++++
>  .../qemuxml2xmlout-intel-iommu-irqchip.xml         |  1 +
>  tests/qemuxml2xmltest.c                            |  1 +
>  7 files changed, 102 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
>  create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irqchip.xml
> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index b1e38f0..abf089a 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -1643,6 +1643,7 @@
>    </kvm>
>    <pvspinlock state='on'/>
>    <gic version='2'/>
> +  <irqchip mode='split'/>
>  
>  </features>
>  ...</pre>
> @@ -1804,6 +1805,15 @@
>            for hypervisor to decide.
>            <span class="since">Since 2.1.0</span>
>        </dd>
> +      <dt><code>irqchip</code></dt>
> +      <dd>Tune the in-kernel irqchip. Possible values for the
> +          <code>mode</code> attribute are:
> +          <code>on</code>, <code>split</code> and <code>off</code>.
> +          <code>split</code> is useful for using interrupt remapping
> +          with the <a href="#elementsIommu">IOMMU device</a>.

Something that isn't implemented until the subsequent patch, but I'm not
against describing this feature a bit more here...

I think most importantly what setting this feature will "do" would be
useful.  How does someone know they need this? And secondarily what
would it be required for? What does "on" really do?  IOW: What the
difference between split and on.

> +          The default is left for hypervisor to decide.
> +          <span class="since">Since 3.3.0</span> (QEMU only)
> +      </dd>
>      </dl>
>  
>      <h3><a name="elementsTime">Time keeping</a></h3>

...

> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
> new file mode 100644
> index 0000000..cc895af
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
> @@ -0,0 +1,29 @@
> +<domain type='qemu'>
> +  <name>QEMUGuest1</name>
> +  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> +  <memory unit='KiB'>219100</memory>
> +  <currentMemory unit='KiB'>219100</currentMemory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='x86_64' machine='q35'>hvm</type>
> +    <boot dev='hd'/>
> +  </os>
> +  <features>
> +    <irqchip mode='split'/>
> +  </features>
> +  <clock offset='utc'/>
> +  <on_poweroff>destroy</on_poweroff>
> +  <on_reboot>restart</on_reboot>
> +  <on_crash>destroy</on_crash>
> +  <devices>
> +    <emulator>/usr/bin/qemu-system-x86_64</emulator>
> +    <controller type='pci' index='0' model='pcie-root'/>
> +    <controller type='sata' index='0'>
> +      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
> +    </controller>
> +    <input type='mouse' bus='ps2'/>
> +    <input type='keyboard' bus='ps2'/>
> +    <memballoon model='none'/>
> +    <iommu model='intel'/>
> +  </devices>
> +</domain>

Could a few devices be added so that future patches will actually
generate a command line that would should the code conforms to the
requirement that the "-device intel-iommu" appears in the command list
before the "rest of the devices".

John

> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irqchip.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irqchip.xml
> new file mode 120000
> index 0000000..58a0199
> --- /dev/null
> +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-intel-iommu-irqchip.xml
> @@ -0,0 +1 @@
> +../qemuxml2argvdata/qemuxml2argv-intel-iommu-irqchip.xml
> \ No newline at end of file
> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
> index e4b510f..c7d4788 100644
> --- a/tests/qemuxml2xmltest.c
> +++ b/tests/qemuxml2xmltest.c
> @@ -1121,6 +1121,7 @@ mymain(void)
>      DO_TEST("intel-iommu-machine",
>              QEMU_CAPS_MACHINE_OPT,
>              QEMU_CAPS_MACHINE_IOMMU);
> +    DO_TEST("intel-iommu-irqchip", NONE);
>  
>      DO_TEST("cpu-check-none", NONE);
>      DO_TEST("cpu-check-partial", NONE);
> 




More information about the libvir-list mailing list