[PATCH] schema: Fix TPM version rules

Michal Privoznik posted 1 patch 3 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/a1da2ed3059f28d229617b554f147c59e4621080.1609930429.git.mprivozn@redhat.com
docs/schemas/domaincommon.rng | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
[PATCH] schema: Fix TPM version rules
Posted by Michal Privoznik 3 years, 3 months ago
According to our parser (virDomainTPMDefParseXML()) the version
is an optional attribute and independent of TPM backend type.
Therefore, it's not a choice group, which is what our RNG schema
suggests.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 docs/schemas/domaincommon.rng | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 712fb60562..86816e9b1d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4776,18 +4776,14 @@
           </optional>
         </group>
       </choice>
-      <choice>
-        <group>
-          <optional>
-            <attribute name="version">
-              <choice>
-                <value>1.2</value>
-                <value>2.0</value>
-              </choice>
-           </attribute>
-          </optional>
-        </group>
-      </choice>
+      <optional>
+        <attribute name="version">
+          <choice>
+            <value>1.2</value>
+            <value>2.0</value>
+          </choice>
+       </attribute>
+      </optional>
     </element>
   </define>
 
-- 
2.26.2

Re: [PATCH] schema: Fix TPM version rules
Posted by Daniel Henrique Barboza 3 years, 3 months ago

On 1/6/21 7:53 AM, Michal Privoznik wrote:
> According to our parser (virDomainTPMDefParseXML()) the version
> is an optional attribute and independent of TPM backend type.
> Therefore, it's not a choice group, which is what our RNG schema
> suggests.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   docs/schemas/domaincommon.rng | 20 ++++++++------------
>   1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index 712fb60562..86816e9b1d 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -4776,18 +4776,14 @@
>             </optional>
>           </group>
>         </choice>
> -      <choice>
> -        <group>
> -          <optional>
> -            <attribute name="version">
> -              <choice>
> -                <value>1.2</value>
> -                <value>2.0</value>
> -              </choice>
> -           </attribute>
> -          </optional>
> -        </group>
> -      </choice>
> +      <optional>
> +        <attribute name="version">
> +          <choice>
> +            <value>1.2</value>
> +            <value>2.0</value>
> +          </choice>
> +       </attribute>
> +      </optional>
>       </element>
>     </define>
>   
>