[libvirt] Re: OpenVZ : The restriction of domain name should be addressed
Yuji NISHIDA
nishidy at nict.go.jp
Fri Aug 21 02:08:05 UTC 2009
>> 2009/7/24 Daniel P. Berrange <berrange at redhat.com>
>>> We should make use of this --name parameter then - I guess it didn't
>>> exist when we first wrote the driver. It is useful to users to have
>>> separate ID vs Name parameters - and in fact the current reusing of
>>> 'ID' for the name, causes a little confusion in virsh's lookup
>>> routines
>>> because it can't tell whether the parameter its given is a name or
>>> an
>>> ID, since they are identical.
>>
>> There is still a question of how to specify both a name and CTID in
>> XML
>> description.
>> By default, CTID can be obtained as openvzGimmeFirstUnusedCTID(), but
>> actually
>> I think that there exists a number of persons interested in giving
>> CTIDs
>> manually.
>
> Well, can <domain id=''> be used for CTID remaining <name> for
> alphabetical domain name?
I worte a small patch and tried with following XML setting.
### Patch ###
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -130,9 +130,6 @@
ADD_ARG_LIT(VZCTL);
ADD_ARG_LIT("--quiet");
ADD_ARG_LIT("create");
- ADD_ARG_LIT(vmdef->id);
-
- ADD_ARG_LIT("--name");
ADD_ARG_LIT(vmdef->name);
### XML ###
<domain id='100'>
<name>abc</name>
I found the type of id was identified as number( obj->type ==
XPATH_NUMBER ) in virXPathLongBase,
but it is clearly string before converted.
I think correct path is to go in the first if context( obj->type ==
XPATH_STRING ) and run strtol.
Then I tried with following XML.
### XML ###
<domain id=100>
<name>abc</name>
I got following error.
AttValue: " or ' expected
I'm not sure from which function should return this result.
Maybe this is the first step to go forward.
I am doubting openvz*LookupBy* functions be also modified, right?
-----
Yuji Nishida
nishidy at nict.go.jp
More information about the libvir-list
mailing list