[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] libxl config datastructures



On Wed, 2012-08-01 at 04:16 +0100, Tamas Lengyel wrote:
> Dear libxl developers,
> currently there is no way to automatically parse a config file into
> the libxl_domain_config datastructure and therefore using any libxl_*
> function that requires that datastructure as an input is unusable. The
> only implementation that creates that structure is in xl_cmdimpl.c in
> the private function parse_config_data. As I see, it relies on the
> XLU_Config structure to create the libxl_domain_config structure. It
> is very impractical to replicate that code for third party tools just
> to be able to use for example libxl_domain_restore. 

There is a deliberate split in functionality here, which is part of the
design of libxl.

libxl is a library which can be used to implement a toolstack. It is not
in and of itself a toolstack. I often say that it implements the common
"bottom third" of a toolstack.

xl is an actual toolstack which uses libxl and aims for, among other
things, xm compatibility which implies the ability to parse xm style
configuration files (and a similar command line syntax, etc).

The parsing of xl/xm style configuration files is specific to the
toolstack and therefore belongs in xl.

It is incorrect to say that "libxl_* function that requires that
datastructure as an input is unusable", it is obviously entirely
possible to fill in this data structure without reference to an xm/xl
style configuration file. If you are writing your own toolstack then it
is expected that you will have your own configuration format and will
parse that instead, there is certainly no general requirement that all
toolstack use xm/xl style configuration files.

For example The libxl backend for libvirt takes libvirt configuration
and uses that to drive libxl in order to implement the required
functionality and we expect that in the future the xapi toolstack will
similarly use settings in its database to drive libxl.

Now in actual fact the actual parser is in the libxlu (utils) library.
This is because although the configuration file format is particular to
xm/xl we acknowledge that some of the functionality of xl, such the
ability to parse simple key=value configuration files or xl disk
configuration specifications, might be useful to other toolstacks.

> My requests is either:

It would be useful if you would explain what you are actually trying to
achieve here. Are you writing your own toolstack which strives for xm
compatibility? Or are you perhaps trying to add functionality to libxl
which actual belongs in xl?

If you explain what you are doing then we can try and figure out how
best to move forward.

>       * Create a publicly accessible function in libxl.h that parses a
>         file/char* to libxl_domain_config structure (essentially
>         making parse_config_data public).
>       * Or just use XLU_Config everywhere. I'm not entirely sure why
>         there is a need to have two separate formats and the whole
>         translation in-between.

I don't think either of these would be correct and in keeping with the
design decisions which we have made for libxl/xl.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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