<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 06/14/2014 12:30 PM, Sheldon wrote:<br>
    </div>
    <blockquote cite="mid:539C6A7C.5050608@linux.vnet.ibm.com"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">I'd like to give up to support ".<br>
        <br>
        " is not allowed by dnsmasq.<br>
        the&nbsp; number of " but be even<br>
      </div>
    </blockquote>
    <br>
    ACK.<br>
    <br>
    <blockquote cite="mid:539C6A7C.5050608@linux.vnet.ibm.com"
      type="cite">
      <div class="moz-cite-prefix">
        ERROR:cherrypy.error.62418064:[14/Jun/2014:23:11:44] HTTP
        Traceback (most recent call last):<br>
        &nbsp; File
        "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line
        656, in respond<br>
        &nbsp;&nbsp;&nbsp; response.body = self.handler()<br>
        &nbsp; File
        "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py",
        line 188, in __call__<br>
        &nbsp;&nbsp;&nbsp; self.body = self.oldhandler(*args, **kwargs)<br>
        &nbsp; File
        "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line
        34, in __call__<br>
        &nbsp;&nbsp;&nbsp; return self.callable(*self.args, **self.kwargs)<br>
        &nbsp; File
        "/home/shhfeng/work/workdir/kimchi/src/kimchi/control/base.py",
        line 72, in wrapper<br>
        &nbsp;&nbsp;&nbsp; ident = fn(*model_args)<br>
        &nbsp; File
        "/home/shhfeng/work/workdir/kimchi/src/kimchi/model/networks.py",
        line 308, in activate<br>
        &nbsp;&nbsp;&nbsp; network.create()<br>
        &nbsp; File
        "/home/shhfeng/work/workdir/kimchi/src/kimchi/model/libvirtconnection.py",

        line 62, in wrapper<br>
        &nbsp;&nbsp;&nbsp; ret = f(*args, **kwargs)<br>
        &nbsp; File "/usr/lib64/python2.7/site-packages/libvirt.py", line
        2318, in create<br>
        &nbsp;&nbsp;&nbsp; if ret == -1: raise libvirtError ('virNetworkCreate()
        failed', net=self)<br>
        libvirtError: internal error: Child process (/sbin/dnsmasq
        '--conf-file=/var/lib/libvirt/dnsmasq/@#$%^&amp;*()_+=-!~|{}[];'\''`"::::?&gt;&lt;\.conf')

        unexpected exit status 1: <br>
        dnsmasq: missing " at line 10 of
        /var/lib/libvirt/dnsmasq/@#$%^&amp;*()_+=-!~|{}[];'`"::::?&gt;&lt;\.conf<br>
        <br>
        <br>
        <br>
        I create a network with name "ab", with contains two ". also
        error.<br>
        <br>
        ERROR:cherrypy.error.62418064:[14/Jun/2014:23:24:49] HTTP
        Traceback (most recent call last):<br>
        &nbsp; File
        "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line
        656, in respond<br>
        &nbsp;&nbsp;&nbsp; response.body = self.handler()<br>
        &nbsp; File
        "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py",
        line 188, in __call__<br>
        &nbsp;&nbsp;&nbsp; self.body = self.oldhandler(*args, **kwargs)<br>
        &nbsp; File
        "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line
        34, in __call__<br>
        &nbsp;&nbsp;&nbsp; return self.callable(*self.args, **self.kwargs)<br>
        &nbsp; File
        "/home/shhfeng/work/workdir/kimchi/src/kimchi/control/base.py",
        line 72, in wrapper<br>
        &nbsp;&nbsp;&nbsp; ident = fn(*model_args)<br>
        &nbsp; File
        "/home/shhfeng/work/workdir/kimchi/src/kimchi/model/networks.py",
        line 308, in activate<br>
        &nbsp;&nbsp;&nbsp; network.create()<br>
        &nbsp; File
        "/home/shhfeng/work/workdir/kimchi/src/kimchi/model/libvirtconnection.py",

        line 62, in wrapper<br>
        &nbsp;&nbsp;&nbsp; ret = f(*args, **kwargs)<br>
        &nbsp; File "/usr/lib64/python2.7/site-packages/libvirt.py", line
        2318, in create<br>
        &nbsp;&nbsp;&nbsp; if ret == -1: raise libvirtError ('virNetworkCreate()
        failed', net=self)<br>
        libvirtError: An error occurred, but the cause is unknown<br>
        <br>
        <br>
        On 06/14/2014 10:16 PM, Sheldon wrote:<br>
      </div>
      <blockquote cite="mid:539C5956.7040608@linux.vnet.ibm.com"
        type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <div class="moz-cite-prefix">On 06/14/2014 06:01 PM, Sheldon
          wrote:<br>
        </div>
        <blockquote cite="mid:539C1D84.2000808@linux.vnet.ibm.com"
          type="cite">
          <meta content="text/html; charset=ISO-8859-1"
            http-equiv="Content-Type">
          <div class="moz-cite-prefix">On 06/13/2014 07:52 PM, Aline
            Manera wrote:<br>
          </div>
          <blockquote cite="mid:539AE610.2060409@linux.vnet.ibm.com"
            type="cite">
            <meta content="text/html; charset=ISO-8859-1"
              http-equiv="Content-Type">
            <div class="moz-cite-prefix">On 06/13/2014 04:43 AM, Sheldon
              wrote:<br>
            </div>
            <blockquote cite="mid:539AAB87.7070903@linux.vnet.ibm.com"
              type="cite">
              <meta content="text/html; charset=ISO-8859-1"
                http-equiv="Content-Type">
              <div class="moz-cite-prefix">On 06/13/2014 04:58 AM, Aline
                Manera wrote:<br>
              </div>
              <blockquote cite="mid:539A147D.4050204@linux.vnet.ibm.com"
                type="cite">
                <meta content="text/html; charset=ISO-8859-1"
                  http-equiv="Content-Type">
                <div class="moz-cite-prefix">On 06/12/2014 08:19 AM, <a
                    moz-do-not-send="true"
                    class="moz-txt-link-abbreviated"
                    href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a>
                  wrote:<br>
                </div>
                <blockquote
                  cite="mid:1402571942-6157-1-git-send-email-shaohef@linux.vnet.ibm.com"
                  type="cite">
                  <pre wrap="">From: ShaoHe Feng <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>

Both '-' and '_' are allowed by libvirt,  so we should not put extra
restrictions.

Signed-off-by: ShaoHe Feng <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
---
 ui/js/src/kimchi.network.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 23930cd..c6e828d 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -321,7 +321,7 @@ kimchi.cleanNetworkDialog = function() {

 kimchi.setupNetworkFormEvent = function() {
     $("#networkName").on("keyup", function(event) {
-        $("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[a-zA-Z0-9_]+$/));
+        $("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[\-\w]+$/));
         kimchi.updateNetworkFormButton();
     });
     $("#networkTypeIso").on("click", function(event) {
</pre>
                </blockquote>
                <br>
                <font face="DejaVu Sans Mono">I agree with Cristian.<br>
                  You should remove the whole line:<br>
                </font><br>
                $("#networkName").toggleClass("invalid-field",
                !$("#networkName").val().match(/^[a-zA-Z0-9_]+$/));<br>
                <br>
              </blockquote>
              what about some little restrictions than libvirt. <br>
              such as&nbsp; wildcard "*", "?" and "/", [], {} ! are not
              allowed.&nbsp; <br>
              <br>
            </blockquote>
            <br>
            Yes, we need to restrict only the characters not allowed by
            libvirt<br>
          </blockquote>
          so only "/" is&nbsp; restricted? the same rule with VM name and
          storage-pool name?<br>
          <blockquote cite="mid:539AE610.2060409@linux.vnet.ibm.com"
            type="cite"> <br>
            <blockquote cite="mid:539AAB87.7070903@linux.vnet.ibm.com"
              type="cite"> for&nbsp; wildcard can be used in shell. such as:<br>
              $ ls dat*<br>
              debugreports&nbsp; objectstore&nbsp; screenshots&nbsp; sessions<br>
              $ ls dat?<br>
              debugreports&nbsp; objectstore&nbsp; screenshots&nbsp; sessions<br>
              $ ls data<br>
              debugreports&nbsp; objectstore&nbsp; screenshots&nbsp; sessions<br>
              $ ls [d]ata<br>
              debugreports&nbsp; objectstore&nbsp; screenshots&nbsp; sessions<br>
              <br>
              shell meta characters and control operator should we
              support?<br>
              " ' ` = $ &lt; &gt; | &amp; ( ) { } ; &amp;&amp; || !<br>
              I have do some test as follow:<br>
              <br>
              1. <br>
              I rename the network as "dd/ddd", libvirt will&nbsp; report an
              error:<br>
              create file '/etc/libvirt/qemu/networks/dd/ddd.xml.new':
              No such file or directory <br>
              We do can help libvirt to escape "/". And seems linux
              support every character. <br>
              <br>
            </blockquote>
            <br>
            It is because '/' is a special character in xml files.<br>
          </blockquote>
        </blockquote>
        Seems it is not the xml special character. <br>
        $ touch dd\/ddd.xml<br>
        touch: cannot touch &#8216;dd/ddd.xml&#8217;: No such file or directory.<br>
        <br>
        "\" may cause a big trouble. <br>
        I'd like to not escape "\", what about you? <br>
        <br>
        seems only "&lt; &amp; &gt;" are xml special characters.<br>
        <blockquote cite="mid:539C1D84.2000808@linux.vnet.ibm.com"
          type="cite">
          <blockquote cite="mid:539AE610.2060409@linux.vnet.ibm.com"
            type="cite"> We need to scape it.<br>
            <br>
            <blockquote cite="mid:539AAB87.7070903@linux.vnet.ibm.com"
              type="cite"> 2.<br>
              I also create a <span class="column column-name cell"
                title="*.efault">network named "*.efault",&nbsp; kimchi can
                work works well, that's kimchi UI's problem. <br>
                it report: "Error: Syntax error, unrecognized
                expression: #*.efault</span>". <br>
              I can also fix this problem.<br>
              <br>
            </blockquote>
            <br>
            Please, send a patch for it too<br>
            <br>
            <blockquote cite="mid:539AAB87.7070903@linux.vnet.ibm.com"
              type="cite"> virsh # net-list --all<br>
              &nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Autostart&nbsp;&nbsp;&nbsp;&nbsp; Persistent<br>
              ----------------------------------------------------------<br>
              &nbsp;*.efault&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inactive&nbsp;&nbsp; yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br>
              &nbsp;brg20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active&nbsp;&nbsp;&nbsp;&nbsp; yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br>
              &nbsp;dddd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active&nbsp;&nbsp;&nbsp;&nbsp; yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br>
              &nbsp;default&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active&nbsp;&nbsp;&nbsp;&nbsp; yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br>
              &nbsp;test_abc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active&nbsp;&nbsp;&nbsp;&nbsp; yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yes<br>
              <br>
              strangely, I can not list the persistent network&nbsp;
              *.efault.xml file. <br>
              $ sudo ls&nbsp; /var/lib/libvirt/network/<br>
              dddd.xml&nbsp; default.xml&nbsp; test_abc.xml<br>
              <br>
              <br>
              <br>
            </blockquote>
            <br>
            <br>
            <br>
            <blockquote cite="mid:539AAB87.7070903@linux.vnet.ibm.com"
              type="cite"> <br>
              <br>
              <pre class="moz-signature" cols="72">-- 
Thanks and best regards!

Sheldon Feng(&#20911;&#23569;&#21512;)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center</pre>
            </blockquote>
            <br>
          </blockquote>
          <br>
          <br>
          <pre class="moz-signature" cols="72">-- 
Thanks and best regards!

Sheldon Feng(&#20911;&#23569;&#21512;)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center</pre>
          <br>
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <br>
          <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
        </blockquote>
        <br>
        <br>
        <pre class="moz-signature" cols="72">-- 
Thanks and best regards!

Sheldon Feng(&#20911;&#23569;&#21512;)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center</pre>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
      </blockquote>
      <br>
      <br>
      <pre class="moz-signature" cols="72">-- 
Thanks and best regards!

Sheldon Feng(&#20911;&#23569;&#21512;)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center</pre>
    </blockquote>
    <br>
  </body>
</html>