[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] allow '#' as valid character for domain name

于 2010年11月20日 02:00, Laine Stump 写道:
On 11/19/2010 05:29 AM, Osier Yang wrote:
* docs/schemas/domain.rng
docs/schemas/domain.rng | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index bbbc846..815134d 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -2003,7 +2003,7 @@
<define name="domainName">
<data type="string">
-<param name="pattern">[A-Za-z0-9_\.\+\-&amp;:/]+</param>
+<param name="pattern">[A-Za-z0-9_\.\+\-\\#&amp;:/]+</param>
<define name="diskSerial">

What's your motivation for this?

If domain.rng is used similarly to the other .rng files I'm more
familiar with, it's only actually examined during the tests run as part
of "make check", so it won't have any effect on actual operation. Is
this what you intended?

# rpm -qf /usr/bin/virt-xml-validate

# rpm -ql libvirt-client | grep 'domain.rng'

# find . -type f -name "domain.rng"

# strings /usr/bin/virt-xml-validate | grep rng

It's used by virt-xml-validate, I'm sure also could find more proofs
in Makefile and source code, but think it's no need.

"#" seems like a problematic character to put in a domain name - for
example it would need to be escaped or quoted if it was ever on a
commandline - what happens when that name gets passed to qemu, for
example? Or a user-written shell script that calls virsh? Also,
virt-manager doesn't allow it.

yes, virt-manager doesn't allow it indeed, and also it will also
need to be escaped in shell.

However, we allow "#" as domain name in virsh, actually we have
two bugs, one says "#" should not be allowed, the other says
it should be allowed, yeah, they are conflicts.

Though I prefer disallowing it, intended to send the patch so
that get more ideas from guys, and could have a consistent conclusion,
probly we should also have a common rule for domain name as
documentation, but diffrent driver accepts diffrent character set,
that's the problem.

Any idea?


- Osier

libvir-list mailing list
libvir-list redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]