All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Josh Durgin <josh.durgin@dreamhost.com>
Cc: libvir-list@redhat.com, ceph-devel@vger.kernel.org
Subject: Re: [PATCH 1/1] Use a common xml type for ceph secret usage.
Date: Fri, 28 Oct 2011 16:03:48 -0600	[thread overview]
Message-ID: <4EAB26C4.9030103@redhat.com> (raw)
In-Reply-To: <ce9e6885af6aa76edcebca9103a5690447e8dc47.1319835863.git.josh.durgin@dreamhost.com>

On 10/28/2011 03:19 PM, Josh Durgin wrote:
> The types used in domaincommon.rng and secret.rng should be the same.
>
> Signed-off-by: Josh Durgin<josh.durgin@dreamhost.com>
> ---
>   docs/schemas/domaincommon.rng |   11 ++++++++---
>   docs/schemas/secret.rng       |    4 +++-
>   2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index 3477351..d053489 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -2558,13 +2558,13 @@
>           <attribute name='uuid'>
>             <ref name="UUID"/>
>           </attribute>
> -<attribute name="usage">
> -<ref name="genericName"/>
> +<attribute name='usage'>
> +<ref name='usageName'/>

genericName is probably fine instead of inventing usageName; but I'll 
graduate it out of domaincommon.rng into basictypes.rng.

>           </attribute>
>         </choice>
>       </element>
>     </define>
> -
> +

Spurious whitespace change.

> +++ b/docs/schemas/secret.rng
> @@ -4,6 +4,8 @@
>       <ref name='secret'/>
>     </start>
>
> +<include href='domaincommon.rng'/>

domaincommon.rng is rather heavyweight; basictypes.rng is better.

> +
>     <define name='secret'>
>       <element name='secret'>
>         <optional>
> @@ -60,7 +62,7 @@
>         <value>ceph</value>
>       </attribute>
>       <element name='name'>
> -<text/>
> +<ref name='usageName'/>
>       </element>
>     </define>

At any rate, once we include common types, we can stop repeating the 
UUID definition too.

Not quite like your original patch, but I'll go ahead and squash this 
in, then push in your name since it matches up with your intent.


diff --git i/docs/schemas/basictypes.rng w/docs/schemas/basictypes.rng
index b3267f5..3b4b952 100644
--- i/docs/schemas/basictypes.rng
+++ w/docs/schemas/basictypes.rng
@@ -97,6 +97,12 @@
      </choice>
    </define>

+  <define name="genericName">
+    <data type="string">
+      <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
+    </data>
+  </define>
+
    <define name="dnsName">
      <data type="string">
        <param name="pattern">[a-zA-Z0-9\.\-]+</param>
diff --git i/docs/schemas/domaincommon.rng w/docs/schemas/domaincommon.rng
index d053489..b6f858e 100644
--- i/docs/schemas/domaincommon.rng
+++ w/docs/schemas/domaincommon.rng
@@ -2559,12 +2559,12 @@
            <ref name="UUID"/>
          </attribute>
          <attribute name='usage'>
-          <ref name='usageName'/>
+          <ref name='genericName'/>
          </attribute>
        </choice>
      </element>
    </define>
-
+
    <!--
         Optional hypervisor extensions in their own namespace:
           QEmu
@@ -2660,11 +2660,6 @@
        <param name="pattern">[A-Za-z0-9_\.\+\-]+</param>
      </data>
    </define>
-  <define name="genericName">
-    <data type="string">
-      <param name="pattern">[a-zA-Z0-9_\+\-]+</param>
-    </data>
-  </define>
    <define name="bridgeMode">
      <data type="string">
        <param name="pattern">(vepa|bridge|private|passthrough)</param>
@@ -2675,11 +2670,6 @@
        <param 
name="pattern">(([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9])|(([0-9a-fA-F]+|:)+[0-9a-fA-F]+)|([a-zA-Z0-9_\.\+\-]*)</param>
      </data>
    </define>
-  <define name="usageName">
-    <data type="string">
-      <param name="pattern">[a-zA-Z0-9_\.\+\-]+</param>
-    </data>
-  </define>
    <define name="usbId">
      <data type="string">
        <param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
diff --git i/docs/schemas/secret.rng w/docs/schemas/secret.rng
index 3abd3c7..e49bd5a 100644
--- i/docs/schemas/secret.rng
+++ w/docs/schemas/secret.rng
@@ -1,10 +1,11 @@
+<?xml version="1.0"?>
  <!-- A Relax NG schema for the libvirt secret properties XML format -->
  <grammar xmlns="http://relaxng.org/ns/structure/1.0">
    <start>
      <ref name='secret'/>
    </start>

-  <include href='domaincommon.rng'/>
+  <include href='basictypes.rng'/>

    <define name='secret'>
      <element name='secret'>
@@ -62,25 +63,8 @@
        <value>ceph</value>
      </attribute>
      <element name='name'>
-      <ref name='usageName'/>
+      <ref name='genericName'/>
      </element>
    </define>

-  <define name="UUID">
-    <choice>
-      <data type="string">
-        <param name="pattern">[a-fA-F0-9]{32}</param>
-      </data>
-      <data type="string">
-        <param 
name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
-      </data>
-    </choice>
-  </define>
-
-  <define name="absFilePath">
-    <data type="string">
-      <param name="pattern">/[a-zA-Z0-9_\.\+\-&amp;/%]+</param>
-    </data>
-  </define>
-
  </grammar>


-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

  reply	other threads:[~2011-10-28 22:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 18:01 [RFC PATCH v3 0/4] Improve Ceph Qemu+RBD support Josh Durgin
2011-10-20 18:01 ` [RFC PATCH v3 1/4] secret: add Ceph secret type Josh Durgin
2011-10-27  8:28   ` Daniel P. Berrange
2011-10-28 16:33     ` [libvirt] " Eric Blake
2011-10-28 16:42       ` Eric Blake
2011-10-28 17:41     ` Eric Blake
2011-10-28 18:47       ` Josh Durgin
2011-10-28 18:56         ` Eric Blake
2011-10-20 18:01 ` [RFC PATCH v3 2/4] storage: add auth to virDomainDiskDef Josh Durgin
2011-10-27  8:33   ` Daniel P. Berrange
2011-10-28 18:53     ` [libvirt] " Eric Blake
2011-10-28 19:15       ` Josh Durgin
2011-10-28 21:19         ` [PATCH 1/1] Use a common xml type for ceph secret usage Josh Durgin
2011-10-28 22:03           ` Eric Blake [this message]
2011-10-20 18:01 ` [RFC PATCH v3 3/4] qemu: pass virConnectPtr into Domain{Attach,Detach}* Josh Durgin
2011-10-27  8:33   ` Daniel P. Berrange
2011-10-31 19:14     ` [libvirt] [RFC PATCH v3 3/4] qemu: pass virConnectPtr into Domain{Attach, Detach}* Eric Blake
2011-10-20 18:01 ` [RFC PATCH v3 4/4] qemu/rbd: improve rbd device specification Josh Durgin
2011-10-27  8:38   ` Daniel P. Berrange
2011-10-28 21:19     ` [PATCH v4 " Josh Durgin
2011-10-31 20:02       ` Eric Blake
2011-11-01  1:29         ` [PATCH v5 " Josh Durgin
2011-11-16  0:05           ` Eric Blake
2011-11-16  1:37             ` Josh Durgin
2011-11-16 15:40               ` Eric Blake
2011-11-16 10:25             ` [libvirt] " Daniel P. Berrange
2011-10-27  5:19 ` [RFC PATCH v3 0/4] Improve Ceph Qemu+RBD support Sage Weil

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=4EAB26C4.9030103@redhat.com \
    --to=eblake@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=josh.durgin@dreamhost.com \
    --cc=libvir-list@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.