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

* 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> <define name="domainName"> <data type="string"> - <param name="pattern">[A-Za-z0-9_\.\+\-&:/]+</param> + <param name="pattern">[A-Za-z0-9_\.\+\-\\#&:/]+</param> </data> </define> <define name="diskSerial"> -- 1.7.3.2

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> <define name="domainName"> <data type="string"> -<param name="pattern">[A-Za-z0-9_\.\+\-&:/]+</param> +<param name="pattern">[A-Za-z0-9_\.\+\-\\#&:/]+</param> </data> </define> <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? "#" 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.

On 11/19/2010 11:00 AM, Laine Stump wrote:
-<param name="pattern">[A-Za-z0-9_\.\+\-&:/]+</param> +<param name="pattern">[A-Za-z0-9_\.\+\-\\#&:/]+</param> </data> </define> <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?
Additionally, it would be a good idea to add a .xml file somewhere in the tests/ hierarchy that has such a domain name, as a way of getting test exposure of both the RelaxNG schema validation and of actual XML handling in libvirt itself.
"#" 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
Only if it is the first character of the domain name, but yes, this aspect alone makes me need to see a concrete example of someone using a domain like this before we can add support for it. $ echo #ab $ echo a#b a#b -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

于 2010年11月20日 02:41, Eric Blake 写道:
On 11/19/2010 11:00 AM, Laine Stump wrote:
-<param name="pattern">[A-Za-z0-9_\.\+\-&:/]+</param> +<param name="pattern">[A-Za-z0-9_\.\+\-\\#&:/]+</param> </data> </define> <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?
Additionally, it would be a good idea to add a .xml file somewhere in the tests/ hierarchy that has such a domain name, as a way of getting test exposure of both the RelaxNG schema validation and of actual XML handling in libvirt itself.
yeah, agree, we have conflicts between RelaxNG schema validation and XML allowed by libvirt.
"#" 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
Only if it is the first character of the domain name, but yes, this aspect alone makes me need to see a concrete example of someone using a domain like this before we can add support for it.
Rich pasted his domain list in IRC yesterday, the names not only contains "#", but also "|".. etc. :-)
$ echo #ab
$ echo a#b a#b
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

于 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> <define name="domainName"> <data type="string"> -<param name="pattern">[A-Za-z0-9_\.\+\-&:/]+</param> +<param name="pattern">[A-Za-z0-9_\.\+\-\\#&:/]+</param> </data> </define> <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 libvirt-client-0.8.3-2.fc14.x86_64 # rpm -ql libvirt-client | grep 'domain.rng' /usr/share/libvirt/schemas/domain.rng # find . -type f -name "domain.rng" ./docs/schemas/domain.rng # strings /usr/bin/virt-xml-validate | grep rng SCHEMA="/usr/share/libvirt/schemas/${TYPE}.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? Regards - Osier
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (3)
-
Eric Blake
-
Laine Stump
-
Osier Yang