On 13/08/2019 16:30, Anthony PERARD wrote:
> On Tue, Aug 13, 2019 at 04:06:33PM +0100, Andrew Cooper wrote:
>> On 13/08/2019 15:48, Anthony PERARD wrote:
>>> Handle += of both strings and lists.
>>>
>>> If += is used for config options expected to be numbers, then a
>>> warning is printed and the config option ignored (because xl ignores
>>> config options with errors).
>>>
>>> This is to be used for development purposes, where modifying config
>>> option can be done on the `xl create' command line.
>>>
>>> One could have a cmdline= in the cfg file, and specify cmdline+= on
>>> the `xl create` command line without the need to write the whole
>>> cmdline in `xl' command line but simply append to the one in the cfg file.
>>> Or add an extra vif or disk by simply having "vif += [ '', ];" in the
>>> `xl' cmdline.
>>>
>>> Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
>>> ---
>>>
>>> Notes:
>>>     Commiter, the libxlu_cfg_?.[hc] files needs to be regenerated. (with 
>>> make)
>>>     
>>>     This is a different proposal to Andrew's patch:
>>>     <20190805144910.20223-1-andrew.coop...@citrix.com>
>>>     [PATCH] tools/xl: Make extra= usable in combination with cmdline=
>> I gave this a spin, but got:
>>
>> [root@fusebot ~]# ./xlplus create shim.cfg
>> ramdisk=\"/root/tests/selftest/test-hvm64-selftest\"
>> cmdline+=\"dom0=pvh\ dom0-iommu=none\"
>> Parsing config from shim.cfg
>> shim.cfg:19: config parsing error near `+="dom0=pvh': lexical error
>> warning: Config file looks like it contains Python code.
>> warning:  Arbitrary Python is no longer supported.
>> warning:  See http://wiki.xen.org/wiki/PythonInXlConfig
>> Failed to parse config: Invalid argument
> Either older version of `flex' behave differently, or you don't have it
> installed on your system. `make' seems to only print a warning if
> `flex' is missing.
>
> Also, I've only done concatenation of string, += doesn't add a ' ' in
> between. So for cmdline, it would needs to be cmdline+=\"\ dom0=pvh\".

Error between user and terminal. :)

I'd sync'd xl and libxl.so, but not libxlu.so

Ok, so that is working now.  I think 'cmdline+=" dom0=pvh
dom0-iommu=none"' is slightly less tortured syntax, but I guess there is
no way that this isn't going to be horrible.

As for the general mechanism, how usable is += for anything other than
cmdline?  Most strings in config files can't usefully be extended in
this matter - if they need changing, they need changing wholesale.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to