aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxlutil.h
Commit message (Collapse)AuthorAgeFilesLines
* xl: add support for vif rate limitingMathieu Gagne2012-04-241-0/+7
| | | | | | | | | | | | | | | | | | | | | The `rate` keyword specifies the rate at which the outgoing traffic will be limited to. The default if this keyword is not specified is unlimited. The `rate` keyword supports an optional replenishment interval parameter for specifying the granularity of credit replenishment. It determines the frequency at which the vif transmission credit is replenished. The default interval is 50ms. For example: 'rate=10Mb/s' 'rate=250KB/s' 'rate=1MB/s@20ms' Signed-off-by: Mathieu Gagne <mgagne@iweb.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Move bdf parsing into libxluGeorge Dunlap2012-04-041-0/+5
| | | | | | | | | | | | | Config parsing functions do not properly belong in libxl. Move them into libxlu so that others can use them or not as they see fit. No functional changes. One side-effect was making public a private libxl utility function which just set the elements of a structure from the function arguments passed in. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add new "defbool" built in type.Ian Campbell2012-03-011-0/+2
| | | | | | | | This type is a but like a "boolean" but with a third state "default" (so really I suppose it's a tristate). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxlu: add xlu_cfg_get_list_as_string_listIan Campbell2011-11-291-0/+2
| | | | | | | | | | Returns a cfg list as a libxl_string_list. Use this to simplify the parsing of device model extra args. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com>
* xlu: add "dont_warn" to xlu_cfg_*Ian Campbell2011-11-291-4/+8
| | | | | | | | I want it for get_long but we might as well have it everywhere. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: fixup incorrect indentationIan Campbell2011-10-121-0/+8
| | | | | | | | | Several places which were previsously indented using hard tabs are now incorrectly indented. Fix them up. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: expand hard tab stopsIan Campbell2011-10-111-1/+1
| | | | | | | | | | | | | | | I ran the following and committed the result. ^I is an actual hard tab for i in $(grep -l --exclude=*_[ly].\[ch\] '^I' tools/libxl/*.[ch]) ; do cat $i | expand | sponge $i done There are some actually wrong indentations too, I'll fix those up manually. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: clean up trailing whitespaces in code.Wei Liu2011-07-191-1/+1
| | | | | | | | | Commit exactly the results of running find \! -iname '*.txt' -type f -print0 | xargs -0 perl -p -i.bak -E 's/\s+\n/\n/' Signed-off-by: Wei Liu <liuw@liuw.name> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: disks: new xlu_disk_parse functionIan Jackson2011-06-281-0/+23
| | | | | | | | | | | | | Introduce new flex/regexp-based parser for disk configuration strings. Callers will be updated in following patches. The existing xm command line syntax for block-attach expects multiple arguments containing different parameters for different parts of the disk specification, so we supply a parser function which can take multiple strings and scan them in sequence. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: change xl_cfg_get_list to take a dont_warn parameterAndre Przywara2010-09-211-1/+2
| | | | | | | | | | | xl_cfg_get_list can cope with the option not being a list, but it always reports a warning in this case. Introduce a parameter to omit this warning if needed. Future code can then decide what to do with this information. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl, xl: don't free string literals in config structureGianni Tedesco2010-09-091-0/+1
| | | | | | | | | | | | | | | | The function init_dm_info() is initialising some strings from literals. This is bad juju because when the destructor is called we cannot know if the string literal was overridden with a strdup()'d value. Therefore strdup values in the initialiser then introduce and use the function libxlu_cfg_replace_string() which free's whatever is set before strdupping the new value on top of it. The rule for the new call should be clear due to const vs. non-const arguments - changing the behaviour of libxlu_cfg_get_string() would cause more complexity than it saves. [ fixed up for stray ! sign -iwj ] Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: New savefile format. Save domain config when saving a domain.Keir Fraser2010-04-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce a new format for saved domains. The new format, in contrast to the old: * Has a magic number which can distinguish it from other kinds of file * Is extensible * Can contains the domain configuration file On domain creation we remember the actual config file used (using the toolstack data feature of libxl, just introduced), and by default save it to the save file. However, options are provided for the following: * When saving a domain, supplying an alternative config file to store in the savefile. * When restoring a domain, supplying an alternative config file. If a domain is restored with a different config file, it is the responsibility of the xl user to ensure that the two configs are "compatible". Changing the targets of virtual devices is supported; changing other features of the domain is not recommended. Bad changes may lead to undefined behaviour in the domain, and are in practice likely to cause resume failures or crashes. Old format save files generated by old versions of xl are not supported. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* Replace config file parser for "xl"Keir Fraser2010-03-031-0/+58
This provides a replacement config file parser for "xl" based on bison and flex. Benefits: * proper error reporting with line numbers * parser can understand nearly all "xm" configuration files directly (doesn't understand Python code but should do everything else) * parser also understands the ;-infested "xl" style files * removes the dependency on libconfig * better checking for certain kinds of mistakes * eliminates the strange "massage file and try again" code This is intended to support all config files currently supported by "xl" and almost all files supported by "xm". (NB that whether a feature works depends on the implementation of that feature in xl/libxl of course.) This patch also introduces a new library "libxlutil" which is mainly for the benefit of "xl". Users of libxl do not need to use libxlutil, but they can do so if they want to parse "xl" files without being "xl". Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>