Commit Graph
1008 Commits
Author SHA1 Message Date
George Dunlap e05b3ee53b xl: Implement sched-credit schedule parameter command-line interface
Add features to the sched-credit interface to allow querying and
displaying scheduler parameters.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-14 14:06:04 +00:00
George Dunlap 266e2c6682 xl: Refactor sched_domain_output to have a callback for pool information
Allow a scheduler to provide a callback to display pool-wide information,
providing a default.  This is in preparation for displaying pool-wide
scheduler parameters on this line.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-14 14:04:58 +00:00
Andrew Cooper 3db5ca2d45 xl: display max_cpu_ids for xl info
Expose `max_cpu_id' in stdout from `xl info'

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-14 11:10:20 +00:00
Jan Beulich 6cf4c493d1 xl block-detach: allow other than numeric-decimal specification of the disk
... to be in sync with block-attach.  And rename the function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-13 17:11:09 +00:00
Ian Campbell 989794ea65 libxl: always set a default value for VFB.opengl
Fixes an assertion failure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Fantu <fantonifabio@tiscali.it>
Tested-by: Fantu <fantonifabio@tiscali.it>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-13 17:06:36 +00:00
Wei Liu bf32120146 libxl: fix libxl_get_cpu_topology
Fix upper bound of for loop, thus preventing memory corruption.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-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>
2012-03-13 15:36:58 +00:00
Andres Lagar-Cavilla eba0dfbbc2 libxl: publish number of paged pages.
This is information is currently not harvested from libxc.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-13 15:34:54 +00:00
Ian Campbell 132531885a libxl: only set b_info->u.hvm.bios if type if HVM
This fixes a PV guest breakage causes by 24932:6eac4a1ee646 "libxl: Select BIOS
using libxl_domain_build_info_setdefaults".

I have also included a sanity check on b_info->type.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-02 12:33:25 +00:00
George Dunlap ec9d90411b libxl: Implement libxl_sched_credit_param_[gs]et
Implement functions to set credit scheduler global parameters.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 18:22:01 +00:00
Ian Campbell 37d7ebe5b1 libxl: autogenerate libxl_FOO_init and libxl_FOO_init_FIELD
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 23aba672e7 libxl: idl: generate KeyedUnion key member as part of the KeyedUnion
Rather than specifying it twice in the IDL.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 53ec331a4b libxl: Make IDL KeyedUnion keyvar an idl.Field
This is more logical than having keyvar_name and keyvar_type members.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 33150d8091 libxl: add libxl_domain_build_info_init_type
Use instead of parameterising libxl_domain_build_info_init. This allows callers
to initialise a libxl_domain_build_info but not to commit to a particular type
later on (e.g. after they've parsed the domain config)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 40efe53668 libxl: switch device model selection over to libxl_defbool
This allows it to be set via the _init/_setdefault methods.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[since last v -- ERROR_INVAL on stubdomains + !traditional qemu]
2012-03-01 12:26:15 +00:00
Ian Campbell 88e865b7a6 libxl: do not explicitly initialise members of build info to zero
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell f1f2bcfb8c libxl: Select BIOS using libxl_domain_build_info_setdefaults
Remove libxl__domain_bios -- it is no longer necessary.

Also we appear to have been setting the xenstore key even for device models for
PV guests -- stop doing that.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell f05da0aa99 libxl: use defbool for graphics related options
This allows them to be set via the _init/_setdefault methods.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 80c9b2be51 libxl: switch generation id control to libxl_defbool.
This allows it to be set via the _init/_setdefault methods.

Also switch the sense of the variable in the libxl API, since once you add
defbool to the mix the double negatives become even more confusing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Paul Durrant <Paul.Durrant@citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 071a3436df libxl: make boolean members of libxl_domain_build_info into libxl_defbool
This allows them to be set via the _init/_setdefault methods.

This just covers the obvious ones.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:15 +00:00
Ian Campbell 9c5defc464 libxl: make boolean members of libxl_domain_create_info into libxl_defbool
This allows them to be set via the _init/_setdefault methods.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell 50cbda0d0b libxl: add new "defbool" built in type.
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>
2012-03-01 12:26:14 +00:00
Ian Campbell 966deb4db6 libxl: pci: use _init/_setdefault
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell ffa165bb9f libxl: make libxl_device_console internal
consoles are not directly exposed to users of the library and there are no API
functions for manipluating them (only the console_exec function). Rather than
commit to a particular API now make the type internal.

When a user does come along it is much easier to add a completely new API
rather than to fix an existing broken one. It's easier to do this in a manner
which users of the library can cope with in a compatible way e.g. adding a new
API is easier to check for with ./configure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell 31278f6850 libxl: vfb/vkb: use _init/_setdefault
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell 5c5a36663a libxl: nic: use _init/_setdefault
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell b5f5a358b5 libxl: disk: use _init/_setdefault
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell 8100d0b3cd libxl: introduce a descriminating default value for memkb fields.
Consitently make such fields 64 bit values as used by dominfo.

It is not clear if ->video_memkb and/or shadow_memkb shouldn't be part of
->u.hvm but I have not changed that here.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell aef7f7836d libxl: drop 8M slack for PV guests.
This serves no purpose. It relates to the old 8M to "account for backend
allocations" which we used to add. This leaves a bit of unpopulated space in
the Pseudo-physical address space which can be used by backends when mapping
foreign memory. However 8M is not representative of that any more and modern
kernels do not operate in this way anyway.

I suspect an argument could be made for removing this from the libxl API
altogether but instead lets just set the overhead to 0.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:14 +00:00
Ian Campbell 2d058a444a libxl: use an explicit LIBXL_TIMER_MODE_DEFAULT value
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell 7e449837dc libxl: provide _init and _setdefault for libxl_domain_build_info.
Some fields require further scaffolding before they can use the
_init/_setdefault scheme and are handled in later patches.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell c8d71a6de2 libxl: provide _init and _setdefault for libxl_domain_create_info.
Some fields require further scaffolding before they can use the
_init/_setdefault scheme and are handled in later patches.

It doesn't seem reasonable for the library to pick a default for the domain
type so reject as invalid.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell 95cb7aa35b libxl: Document _init/_dispose/_setdefault functions.
Subsequent patches will transition to them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell 9dc5f1364d libxl: generate a _dispose function for all Aggregate types
Don't special case types which we happen to know do not contain allocated data
such that in the future if this changes we do not need to add an API. Although
there is likely to be latent bugs in callers due to this having the API in old
libraries mean that when callers are fixed they will not need to make special
arrangements to handle old and new versions of the library.

Adds dispose functions for:
 - libxl_dominfo
 - libxl_cpupoolinfo
 - libxl_physinfo
 - libxl_sched_credit
 - libxl_sched_credit2

I have attempted to fix any latent bugs in xl by inspection but have not
bothered with libxl (on the basis that internally the library is allowed to
make these sorts of assumptions and because it was looking like a very invasive
job and that more would only creep in anyway).

Several callsites use libxl_domain_info to check for the presence of a domain
and throw away the actual info. As a convenience accept a NULL info pointer and
just return the status.

Also fix a memory leak in libxl_domain_list.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell cad39d78f0 libxl: allow specification of testidl random seed.
Useful if you are interested in before/after results of changing the IDL or
generator.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell b14793cc5f libxl: Remove xen/sched.h from public interface
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:13 +00:00
Ian Campbell 5fc905880c libxl: remove sysctl.h from public interface
Using sysctl.h is restricted to "node control tools only" and requires magic
defines. Therefore make its use internal to libxl.

Also removes an indirect include of domctl.h which has the same restrction.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2012-03-01 12:26:13 +00:00
Attilio Rao 1341ac67a3 libxl, xl: Add the bios option to specify the bios to load
Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-29 16:25:38 +00:00
Olaf Hering 9c33ab91c5 libxl: use libxl wrapper for yajl_gen_alloc
To fix compile errors with libyajl2:
 * use libxl_yajl_gen_alloc()
 * use libxl_yajl_length
 * link xl with -lyajl for yajl_gen_string()

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-29 14:32:51 +00:00
Olaf Hering 244ae51879 libxl: rename libxl__yajl_gen_alloc
libxl__yajl_gen_alloc() is called by generic code,
rename it to libx_yajl_gen_alloc().

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-29 14:31:59 +00:00
George Dunlap 8367c5c179 libxl: Rename libxl_sched_* to include _domain
In preparation for introducing a schedule parameter-based structure,
rename libxl_sched_{credit,credit2,sedf} to libxl_sched_{}_domain.

No functional changes.

v2: Wrap long lines while I'm at it

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-02-23 10:19:57 +00:00
Ian Jackson 85896a7c4d build: add autoconf to replace custom checks in tools/check
Added autotools magic to replace custom check scripts. The previous
checks have been ported to autoconf, and some additional ones have
been added (plus the suggestions from running autoscan). Two files are
created as a result from executing configure script, config/Tools.mk
and config.h.

conf/Tools.mk is included by tools/Rules.mk, and contains most of the
options previously defined in .config, that can now be set passing
parameters or defining environment variables when executing configure
script.

config.h is only used by libxl/xl to detect yajl_version.h.

[ tools/config.sub and config.guess copied from
  autotools-dev 20100122.1 from Debian squeeze i386,
  which is GPLv2.

  tools/configure generated using the included ./autogen.sh
  which ran autoconf 2.67-2 from Debian squeeze i386.  autoconf
  is GPLv3+ but has a special exception for the autoconf output;
  this exception applies to us and exempts us from complying
  with GPLv3+ for configure, which is good as Xen is GPL2 only.

  - Ian Jackson ]

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-02-22 01:55:03 +00:00
Bamvor Jian Zhang fa674239ae libxl: Export libxl_event.h
This fixes a compile error in libvirt.

Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-21 18:01:04 +00:00
George Dunlap 85c49351f7 libxl: cleanup: Remove pointless ERRNOVAL
Just call LIBXL__LOG rather than passing a meaningless ERRNOVAL.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-21 17:45:59 +00:00
Christoph Egger 057d014a28 libxl: add missing includes
include <poll.h> for struct pollfd
include <sys/time.h> for struct timeval

Fixes gcc complaints about implicit declaration.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-21 16:44:15 +00:00
Anthony PERARD 60d92830c6 libxl: Set VNC password through QMP
This patch provide the code to set the VNC password to QEMU upstream through
VNC. The password is still stored in xenstore but will not be used by QEMU
upstream.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-02-20 18:45:29 +00:00
Anthony PERARD 58aa83301c Provide dm_vnc() as a in libxl helper.
Just to use this function in more than one file.c.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-02-20 18:45:29 +00:00
Anthony PERARD 50f10bef35 libxl_qmp: Use GC instead of CTX as parameter for _initialize.
This make things a bit easier.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-02-20 18:45:28 +00:00
Olaf Hering 5ff9ae9094 xl: fix xl create/cpupool-create -f help output
xl create -f domU.cfg does not need an equal sign.
This applies also to xl cpupool-create.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-20 18:09:03 +00:00
Anthony PERARD abc94ef0f2 libxl_qmp: Handle unexpected end-of-socket
When read() return 0, the current code just tries again. But this
leads to an infinite loop if QEMU died too soon.

Also, retry select if a signal was caught.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-20 17:53:33 +00:00
Allen Kay 089179f6f3 libxl: Fix yajl-related build error due to missing error value
Some versions of yajl lack yajl_gen_no_buf.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-02-20 16:46:27 +00:00