[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


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Fri, 10 Jun 2022 15:00:58 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 10 Jun 2022 14:01:22 +0000
  • Ironport-data: A9a23:efWMv6BOAnJjYBVW/3/jw5YqxClBgxIJ4kV8jS/XYbTApD920WcBn GtOXT+PPvuNa2P2L9AgPdi18k4Bv5bcyNJiQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E/raNANlFEkvU2ybuOU5NXsZ2YgHGeIdA970Ug5w7Bg2tYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPhyl I9ti9uzET0gYKOQo/kgcyQBVCJxaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwqKtXrO4UO/Glt1zjDAd4tQIzZQrWM7thdtNs1rp8VRKiOO ZFDAdZpRAvbbyxDKltGNLsZzPr5qienaXpSmXvA8MLb5ECMlVcsgdABKuH9ZdiiVchT2EGCq Qru72n/Rx0XKtGb4T6E6W63wP/CmzvhX4AfH6H+8eRl6HWexmEWSw0bU3O+/OH/gUm7M++zM GRNpHBo9/JrshX2EJ+tBHVUvUJooDYfB4BwLao5sDuElKSI2BukJlVdCT1OPYlOWNANedA66 rOYt4q3WGA/6uDOFSz1GqS89m3rZ3VMRYMWTWpdFFZevYG+yG0mpkiXJuuPBpJZmTEc9dvY5 zmR5BYziLwI5SLg//XqpAuX695AS3Wgc+LU2uk0djj8hu+BTNT5D7FEEHCChRq6EK6XT0Oao F8PkNWE4eYFAPmlzXLQHLpcTe/2va3fblUwZGKD+LFwnwlBBlb5JdwAiN2ADBwB3jk4lc/BP xaI5FI5CG57N3q2d65nC7+M5zAR5fG4T7zND6mMBvIXO8QZXFLWp0lGOB/Pt10BZWBxyMnTz 7/AKZbyZZvbYIw6pAeLqxA1i+Z2nn5vnD2KH/gWDX2PiNKjWZJccp9dWHPmUwzzxP7sTNn9m zqHC/a39g==
  • Ironport-hdrordr: A9a23:l/c1qqgAaopj5joIAMn/r3kQ6XBQXtgji2hC6mlwRA09TySZ// rOoB0+726StN9xYgBFpTnuAsW9qB/nmqKdpLNhW4tKPzOW3VdATrsSjrcKqgeIc0aVm9K1l5 0QEZSWYOeAdGSS5vyb3ODXKbgd/OU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.