<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 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"><shaohef@linux.vnet.ibm.com></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"><shaohef@linux.vnet.ibm.com></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 wildcard "*", "?" and "/", [], {} ! are not allowed.
<br>
<br>
</blockquote>
<br>
Yes, we need to restrict only the characters not allowed by
libvirt<br>
</blockquote>
so only "/" is 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 wildcard can be used in shell. such as:<br>
$ ls dat*<br>
debugreports objectstore screenshots sessions<br>
$ ls dat?<br>
debugreports objectstore screenshots sessions<br>
$ ls data<br>
debugreports objectstore screenshots sessions<br>
$ ls [d]ata<br>
debugreports objectstore screenshots sessions<br>
<br>
shell meta characters and control operator should we support?<br>
" ' ` = $ < > | & ( ) { } ; && || !<br>
I have do some test as follow:<br>
<br>
1. <br>
I rename the network as "dd/ddd", libvirt will 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 ‘dd/ddd.xml’: 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 "< & >" 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", 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>
Name State Autostart Persistent<br>
----------------------------------------------------------<br>
*.efault inactive yes yes<br>
brg20 active yes yes<br>
dddd active yes yes<br>
default active yes yes<br>
test_abc active yes yes<br>
<br>
strangely, I can not list the persistent network *.efault.xml
file. <br>
$ sudo ls /var/lib/libvirt/network/<br>
dddd.xml default.xml 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(冯少合)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</blockquote>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thanks and best regards!
Sheldon Feng(冯少合)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a 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(冯少合)<a class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
IBM Linux Technology Center</pre>
</body>
</html>