[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 3/3] tools/xl: Allow specifying JSON for domain configuration file format
On Tue, May 31, 2022 at 06:25:13PM -0700, Elliott Mitchell wrote: > On Fri, May 20, 2022 at 03:12:46PM +0100, Anthony PERARD wrote: > > On Tue, Apr 19, 2022 at 06:23:41PM -0700, Elliott Mitchell wrote: > > > JSON is currently used when saving domains to mass storage. Being able > > > to use JSON as the normal input to `xl create` has potential to be > > > valuable. Add the functionality. > > > > > > Move the memset() earlier so to allow use of the structure sooner. > > > > > > Signed-off-by: Elliott Mitchell <ehem+xen@xxxxxxx> > > > > So, I gave this a try and creating a guest from a json config, and that > > fails very early with "Unknown guest type". > > > > Have you actually tried to create a guest from config file written in > > json? > > > > Also, this would need documentation about the new option, about the > > format. The man page need to be edited. > > > > An example of a config file written in json would be nice as well. > > I'll be trying for these at some point, but no timeframe yet. This was > an idea which occurred to me when looking at things. I'm wavering on > whether this is the way to go... > > Real goal is I would like to generate a replacement for the `xendomains` > init script. While functional the script is woefully inadaquate for > anything other than the tiniest installation. > > Notably there can be ordering constraints for start/shutdown (worse, > those could be distinct). One might also wish different strategies for > different domains (some get saved to disk on reboot, some might get > shutdown/restarted). Is this that something like `libvirt` or some other toolstacks could help with? Or maybe you are looking for something that as a small footprint on the system and just run once at boot and at shutdown. > For some of the configuration for this, adding to domain.cfg files makes > sense. This though ends up with the issue of what should the extra data > look like? Maybe `xl` could be taught to ignore some options that have a prefix like "xendomain_", even if at the moment it ignore everything it doesn't know I think. > I'm oscillating between adding a section in something libxl's parser > takes as a comment, versus adding a configuration option to domain.cfg A comment section could work too I guess, like there's one for `sysv` init system which describe dependency as comments. > (libxl's parser ignores unknown sections which is not entirely good!). > JSON's structure would be good for an addition, but JSON comes with its > own downsides. > > Most likely such a thing would be implemented in Python. Needs a bit > more math than shell is good for. If you plan to convert the `xendomains` init script to python, I don't think that would be a good idea, as it is probably better to not add a dependency for a init script that has been a shell script for a while. But introducing a new utility in python or other language might be fine. Cheers, -- Anthony PERARD
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |