<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/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>
      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 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>
  </body>
</html>