[libvirt] [PATCH] docs: schema: Add missing <interleave> to devices

Han Han posted 1 patch 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180622052402.30290-1-hhan@redhat.com
Test syntax-check passed
docs/schemas/domaincommon.rng | 60 +++++++++++++++++++----------------
1 file changed, 33 insertions(+), 27 deletions(-)
[libvirt] [PATCH] docs: schema: Add missing <interleave> to devices
Posted by Han Han 5 years, 10 months ago
For input,hub,redirdev devices, their sub-elements should be interleaved.

input device: interleave for <driver>, <alias>, <address>
hub device: interleave for <alias>, <address>
redirdev device: interleave for <source>, <alias>, <address>, <boot>

Signed-off-by: Han Han <hhan@redhat.com>
---
 docs/schemas/domaincommon.rng | 60 +++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 27 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 4a454dddb4..d262eb2b1b 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4270,11 +4270,19 @@
 
   <define name="input">
     <element name="input">
-      <optional>
-        <element name="driver">
-          <ref name="virtioOptions"/>
-        </element>
-      </optional>
+      <interleave>
+        <optional>
+          <element name="driver">
+            <ref name="virtioOptions"/>
+          </element>
+        </optional>
+        <optional>
+          <ref name="alias"/>
+        </optional>
+        <optional>
+          <ref name="address"/>
+        </optional>
+      </interleave>
       <choice>
         <group>
           <attribute name="type">
@@ -4309,12 +4317,6 @@
           </element>
         </group>
       </choice>
-      <optional>
-        <ref name="alias"/>
-      </optional>
-      <optional>
-        <ref name="address"/>
-      </optional>
     </element>
   </define>
   <define name="hub">
@@ -4322,12 +4324,14 @@
       <attribute name="type">
         <value>usb</value>
       </attribute>
-      <optional>
-        <ref name="alias"/>
-      </optional>
-      <optional>
-        <ref name="address"/>
-      </optional>
+      <interleave>
+        <optional>
+          <ref name="alias"/>
+        </optional>
+        <optional>
+          <ref name="address"/>
+        </optional>
+      </interleave>
     </element>
   </define>
   <define name="redirdev">
@@ -4338,16 +4342,18 @@
       <attribute name="type">
         <ref name="qemucdevSrcTypeChoice"/>
       </attribute>
-      <ref name="qemucdevSrcDef"/>
-      <optional>
-        <ref name="alias"/>
-      </optional>
-      <optional>
-        <ref name="address"/>
-      </optional>
-      <optional>
-        <ref name="deviceBoot"/>
-      </optional>
+      <interleave>
+        <ref name="qemucdevSrcDef"/>
+        <optional>
+          <ref name="alias"/>
+        </optional>
+        <optional>
+          <ref name="address"/>
+        </optional>
+        <optional>
+          <ref name="deviceBoot"/>
+        </optional>
+      </interleave>
     </element>
   </define>
   <define name="redirfilter">
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] docs: schema: Add missing <interleave> to devices
Posted by Michal Prívozník 5 years, 9 months ago
On 06/22/2018 07:24 AM, Han Han wrote:
> For input,hub,redirdev devices, their sub-elements should be interleaved.
> 
> input device: interleave for <driver>, <alias>, <address>
> hub device: interleave for <alias>, <address>
> redirdev device: interleave for <source>, <alias>, <address>, <boot>
> 
> Signed-off-by: Han Han <hhan@redhat.com>
> ---
>  docs/schemas/domaincommon.rng | 60 +++++++++++++++++++----------------
>  1 file changed, 33 insertions(+), 27 deletions(-)
> 
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index 4a454dddb4..d262eb2b1b 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -4270,11 +4270,19 @@
>  
>    <define name="input">
>      <element name="input">
> -      <optional>
> -        <element name="driver">
> -          <ref name="virtioOptions"/>
> -        </element>
> -      </optional>
> +      <interleave>
> +        <optional>
> +          <element name="driver">
> +            <ref name="virtioOptions"/>
> +          </element>
> +        </optional>
> +        <optional>
> +          <ref name="alias"/>
> +        </optional>
> +        <optional>
> +          <ref name="address"/>
> +        </optional>
> +      </interleave>
>        <choice>
>          <group>
>            <attribute name="type">

This is not that simple. In between these two hunks there's another
possible element defined <source/> for this kind of <input/> device:

    <input type='passthrough' bus='virtio'>
      <driver iommu='on' ats='on'/>
      <source evdev='/dev/input/event1234'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x12'
function='0x0'/>
    </input>

What we need is to put the whole <element name="input"/> body into
<interleave/>.


Fixed, ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list