On 21/04/22 8:31 pm, Peter Krempa wrote:
On Fri, Apr 08, 2022 at 10:48:48 -0700, Rohit Kumar wrote:
This patch updates NVRAM element schema to support
network backed NVRAM. It introduces 'type' attribute
to NVRAM element.

Signed-off-by: Prerna Saxena <prerna.sax...@nutanix.com>
Signed-off-by: Florian Schmidt <flo...@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kum...@nutanix.com>
---
  src/conf/schemas/domaincommon.rng | 20 +++++++++++++++++++-
  1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/conf/schemas/domaincommon.rng 
b/src/conf/schemas/domaincommon.rng
index 58eb9670d4..cd61d00b33 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -333,7 +333,25 @@
                </attribute>
              </optional>
              <optional>
-              <ref name="absFilePath"/>
+              <attribute name="type">
+                <choice>
+                  <value>file</value>
+                  <value>network</value>
So this schema would e.g. allow a type='network' nvram ...

+                </choice>
+              </attribute>
+            </optional>
+            <optional>
+              <choice>
+                <group>
+                  <ref name="absFilePath"/>
+                </group>
+                <group>
+                  <ref name="diskSourceFileElement"/>
... with a 'file' source. These will need to be re-grouped differently
so that only the corresponding attribute value is allowed with
appropriate contents.
Thanks for pointing this. I will re-group these.
Also, having this grouping in schema is enough ? or do we need to validation for this as well ?

+                </group>
+                <group>
+                  <ref name="diskSourceNetworkElement"/>
+                </group>
+              </choice>
              </optional>
            </element>
          </optional>
--
2.25.1


Reply via email to