cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jan Pokorný <jpokorny@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/2] rng: more strict validation of failoverdomains wrt. priority attr.
Date: Sat, 15 Mar 2014 01:01:21 +0100	[thread overview]
Message-ID: <1394841682-21621-2-git-send-email-jpokorny@redhat.com> (raw)
In-Reply-To: <1394841682-21621-1-git-send-email-jpokorny@redhat.com>

unordered FO: optional priority 0  (no other value makes sense)
ordered FO:   optional priority [0, 100]  (ditto)

Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
 config/tools/xml/cluster.rng.in.head | 80 +++++++++++++++++++++++++++---------
 1 file changed, 61 insertions(+), 19 deletions(-)

diff --git a/config/tools/xml/cluster.rng.in.head b/config/tools/xml/cluster.rng.in.head
index 86f384f..919ff5e 100644
--- a/config/tools/xml/cluster.rng.in.head
+++ b/config/tools/xml/cluster.rng.in.head
@@ -904,31 +904,73 @@ To validate your cluster.conf against this schema, run:
        <attribute name="name" rha:description="The name of the failover
          domain." rha:sample="foo"/>
        <optional>
-        <attribute name="ordered" rha:description="Set value to 1 if
-          the failover domain is ordered; set value to 0 if
-          unordered." rha:default="0" rha:sample="1"/>
-       </optional>
-       <optional>
         <attribute name="restricted" rha:description="Set value to 1 if
           the failover domain is restricted; set value to 0 if
           unrestricted." rha:default="0" rha:sample="1"/>
        </optional>
-       <optional>
-        <attribute name="nofailback" rha:description="Do not move service to a more preferred node if it is currently running." rha:sample=""/>
-       </optional>
-       <zeroOrMore>
-        <element name="failoverdomainnode" rha:description="A node in
-          a failover domain">
+       <choice>
+        <group>
+         <!-- unordered group (no or zero priority@failoverdomainnode) -->
+         <optional>
+          <attribute name="nofailback" rha:description="Do not move service to a more preferred node if it is currently running." rha:sample=""/>
+         </optional>
+         <optional>
+          <attribute name="ordered" rha:description="Set value to 1 if
+            the failover domain is ordered; set value to 0 if
+            unordered." rha:default="0" rha:sample="1">
+             <value type="int">0</value>
+          </attribute>
+         </optional>
+         <zeroOrMore>
+          <element name="failoverdomainnode" rha:description="A node in
+            a failover domain">
+           <optional>
+            <attribute name="priority" rha:description="A number
+              specifying the priority; lower numbers having higher
+              priority"
+                rha:sample="1">
+             <value type="int">0</value>
+            </attribute>
+           </optional>
+           <attribute name="name" rha:description="Name of the node."
+               rha:sample="member2"/>
+          </element>
+         </zeroOrMore>
+        </group>
+        <group>
+         <!-- ordered group (no or 0 <= priority <= 100 @failoverdomainnode allowed) -->
          <optional>
-          <attribute name="priority" rha:description="A number
-            specifying the priority; lower numbers having higher
-            priority"
-              rha:sample="1"/>
+          <attribute name="nofailback" rha:description="Do not move service to a more preferred node if it is currently running." rha:sample=""/>
          </optional>
-         <attribute name="name" rha:description="Name of the node."
-             rha:sample="member2"/>
-        </element>
-       </zeroOrMore>
+         <attribute name="ordered" rha:description="Set value to 1 if
+           the failover domain is ordered; set value to 0 if
+           unordered." rha:default="0" rha:sample="1">
+          <data type="int">
+           <except>
+            <value type="int">0</value>
+           </except>
+          </data>
+         </attribute>
+         <zeroOrMore>
+          <element name="failoverdomainnode" rha:description="A node in
+            a failover domain">
+           <optional>
+            <attribute name="priority" rha:description="A number
+              specifying the priority; lower numbers having higher
+              priority"
+                rha:sample="1">
+             <data type="int">
+              <param name="minInclusive">0</param>
+              <param name="maxInclusive">100</param>
+             </data>
+            </attribute>
+           </optional>
+           <attribute name="name" rha:description="Name of the node."
+               rha:sample="member2"/>
+          </element>
+         </zeroOrMore>
+        </group>
+       </choice>
       </element>
      </zeroOrMore>
     </element>
-- 
1.8.5.3



  reply	other threads:[~2014-03-15  0:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-15  0:01 [Cluster-devel] [cluster.git][PATCH 0/2] schema validation hardening continued: failover domains Jan Pokorný
2014-03-15  0:01 ` Jan Pokorný [this message]
2014-03-15  0:01 ` [Cluster-devel] [PATCH 2/2] rng: FO validation: no use of nofailback in unordered domain Jan Pokorný
2014-03-17  7:43 ` [Cluster-devel] [cluster.git][PATCH 0/2] schema validation hardening continued: failover domains Fabio M. Di Nitto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394841682-21621-2-git-send-email-jpokorny@redhat.com \
    --to=jpokorny@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).