Commit Graph
235 Commits
Author SHA1 Message Date
Keir Fraser e1e4abdf2a libxl/xl: implement xen_platform_pci enable/disable
Implement xen_platform_pci support in xl/libxl to allow users to
disable the xen platform pci device from the VM config file.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-06-08 08:01:04 +01:00
Keir Fraser 702890192a xl: init scripts (v2)
Now the init script is called xencommons and, as the name suggests, it
is a common script between xl and xend because it is used to start
xenconsoled, xenstored and xenbackendd and the initialization of these
three daemons has been removed from xend.  The global
xen_toolstack=xl/xend variable has been removed.  Regarding the
network setup, I made the vif scripts follow the same pattern as the
other scripts in xen-backend: a new script called vif-setup is
executed unconditionally. vif-setup is going to do the right thing
depending on the value of the environmental variable "script" (same
technique used before), defaulting to vif-bridge.  In the common
scenario the toolstack doesn't need to set the variable "script"
because vif-bridge is going to be called anyway.  There is no global
network script to setup the network bridges with xl, so if you are
using xl without xend, you need to manually configure the bridges
using your distro network setup, or, if you are lazy, you can just add
something like:

/etc/xen/scripts/network-bridge start

to your rc.local.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-06-07 15:49:46 +01:00
Keir Fraser e9bf40dbce xl: fix 'xl help' command
xl help 'command' should give the help of the 'command',
but current it does not, it just gives a full list of xl
supported commands. This patch fix it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-06-07 07:49:07 +01:00
Keir Fraser cbc6cc9ee3 xl: block-detach command line parsing
Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
2010-06-07 07:14:19 +01:00
Keir Fraser d15309d79c xl: block-list command line parsing
Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
2010-06-07 07:13:41 +01:00
Keir Fraser 693189ff85 xl: block-attach command line parsing
Command line arguments start at argv[2].

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
2010-06-07 07:13:02 +01:00
Keir Fraser 2d50cfa6e1 xl: network2-detach command
Usage: xl network2-detach <Domain> <DevId>

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
2010-06-07 07:12:20 +01:00
Keir Fraser 2018b98c2f xl: network2-list command
Usage: xl network2-list <Domains>

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
2010-06-07 07:11:15 +01:00
Keir Fraser 1742e2a8ea xl: network2-attach command
Usage: xl network2-attach <Domain> [front_mac=<mac>]
[back_mac=<mac>]
[backend=<BackDomain>] [trusted=<0|1>] [back_trusted=<0|1>]
[bridge=<bridge>] [filter_mac=<0|1>] [front_filter_mac=<0|1>]
[pdev=<PDEV>] [max_bypasses=n]

Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
2010-06-07 07:09:41 +01:00
Keir Fraser 0cc54b151a Add xl init scripts
this patch adds an init script for xl, so that it can be used without
xend installed on the system.  In cases in which both toolstacks are
present, only one init script will be run, dependening on the value of
xen_toolstack in /etc/sysconfig/xen_toolstack.  Please note that a
correct value of xen_toolstack (either xl or xend), is required now.
The network script and the vif script to be used with xl can be
specified in /etc/sysconfig/xenlightdaemons.  Xl sets the vif script
to xl-vif-script by default, that reads /etc/sysconfig/xenlightdaemons
and calls the vif script set there.  A port to a debian system should
be straightforward, just replacing /etc/sysconfig with /etc/default
everywhere.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-06-07 07:05:54 +01:00
Keir Fraser 2495a965a0 xl: make mem-set and mem-max to use MB for memory unit by default.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2010-06-07 06:56:04 +01:00
Keir Fraser ca896d0ca6 libxl/xl: fix multivcpu handling
Signed-off-by: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
2010-06-04 10:14:06 +01:00
Keir Fraser 88d60e45ef xl: enable hap, parse hap option in the config files
This simple patch enables hap by default in xl and also allows xl to
parse the hap option in the VM config file.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-06-04 10:13:02 +01:00
Keir Fraser 8d6cdfed76 xl: correct help message of migrate and migrate-receive command
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-06-04 10:12:11 +01:00
Keir Fraser 9a9657f15a xl: fix vcpu-* command line args
Command line arguments start at argv[2]

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-06-04 10:11:40 +01:00
Keir Fraser 8ce5d64e3b xl: fix network-detach command line parsing
Command line arguments start at argv[2].  Also, exit(1) on failure.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-06-04 10:10:45 +01:00
Keir Fraser 89c41cfacc xl: fix network-list command line parsing
Command line arguments start at argv[2].

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-06-04 10:10:25 +01:00
Keir Fraser 46d24c4a83 xl: fix network-attach command line parsing
Command line arguments start at argv[2].

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-06-04 10:09:59 +01:00
Keir Fraser da923a6fff Bash completion scripts go to /etc/bash_completion.d/
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-06-04 10:09:11 +01:00
Keir Fraser c1d7e20205 xl: adds shutdown and reboot commands
libxl : remote shutdown to work for pure hvm domains

Signed-off-by: Gihan Munasinghe <GMunasinghe@flexiant.com>
2010-06-02 10:52:17 +01:00
Keir Fraser 1f60b34911 xl: remove duplicate code in migrate_domain()
libxl_domid_to_name() have already been called in
save_domain_core_begin()->find_domain(), so remove it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-06-01 07:06:50 +01:00
Keir Fraser 81c0e00a2e libxl: fix domain suspend debug typo.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2010-06-01 07:06:05 +01:00
Keir Fraser e693e5f1a7 tools: Build fixes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-28 09:45:50 +01:00
Keir Fraser 455a17fea9 xl/libxtl: Remove glitch in xl migrate log output
* Provide a new XTL_STDIOSTREAM_HIDE_PROGRESS flag in the stdio logger
* Provide a way to adjust the flags after logger setup
* Use these to disable progress output from the migration receiver, as
  the sender is also sending progress information.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2010-05-28 09:38:56 +01:00
Keir Fraser b140baacc3 xl: Allow control of logging level.
The -v option, which must come before the xl command, increases the
logging level each time it is supplied.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:35:12 +01:00
Keir Fraser 1fe4b0e07c libxl: Use the caller's logger (xentoollog)
We now require callers to provide a xentoollog_logger* for
libxl_ctx_init, and use that for all our own logging and also for
xc_interface_open.

Corresponding change to xl.c.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:34:42 +01:00
Keir Fraser 4046aa9cbe libxl: Fix up some incorrect printf formats
We need to use PRIu32 for domids, and also to pass arguments in the
right order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:31:43 +01:00
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:30:19 +01:00
Keir Fraser ca1ba18256 xl: Move "extern" declarations to xl.h
Declarations (as opposed to definitions) of external objects should
not appear in .c files.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2010-05-28 09:25:34 +01:00
Keir Fraser 63e8667404 xl: Combine headers into one header file.
This provides a single place to put declarations of external symbols
etc.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2010-05-28 09:25:07 +01:00
Keir Fraser 76a5dc5492 xl: print BDF parse errors
When parsing BDFs for pci-attach/detach, check the return of scanf
rather than operating on random devices.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-05-28 08:12:15 +01:00
Keir Fraser 596cf420ec xl: fix pci-detach usage message
"xl pci-detach -h" shows the usage for pci-attach

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-05-28 08:11:47 +01:00
Keir Fraser c53944ad66 xl: fix PCI resource parsing
The parsing of PCI resources has two problems:

   1. it assumes devices are 32-bits, whereas the fields in the
      "resources" file can have full 64-bit values
   2. it only parses the first resource because the format string is
      missing a \n

Fix both of these up, which allows my Intel 82574L to work with MSI-X.

However, this should probably be using a PCI access library rather
than rummaging around in /sys/bus/pci...

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-05-28 08:10:48 +01:00
Keir Fraser 56022b3071 libxl: Do not provide arbitrary string as format specifier to printf.
Original patch from Dulloor <dulloor@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-27 08:26:52 +01:00
Keir Fraser a8ad76437e xl: Some small fixes
- When use mem-set, I got suspicious error output:
  # xl mem-set 1 256g
  setting domid 1 memory to : 268435456
  [0] libxl.c:2535:libxl_set_memory_target: memory_dynamic_max must be
  less than or equal to memory_static_max
  : Success
- String generated by strdup() should be freed
- When using 'xl help', mem-max and mem-set's output is not as intend,
  and it also breaks bash completion, fix it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-05-26 08:13:47 +01:00
Keir Fraser 961652b3bd xl: allow nameless domains to be named
At present, find_domain() will exit(2) if you specify a domain by
number, but that domain doesn't have a corresponding name.  However,
nothing seem to critically depend on common_domname being set, and the
test prevents dom0 or other nameless domains from being named.  So
just remove the check.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-05-26 08:12:15 +01:00
Keir Fraser 4024bae739 xl: Add subcommand 'xl dmesg'
Can be used to read and/or clear dmesg buffer.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2010-05-26 07:45:51 +01:00
Keir Fraser a1a1b2c951 libxl: small build fix to pass uint8_t to tolower().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-05-25 11:00:55 +01:00
Keir Fraser 8aca668075 xl: fix block-attach command parsing
Fix two command-line parsing problems:
 - the argc check is wrong: it must be provided with the frontend
 device
 - the ro/rw mode is optional, so default to rw if it is absent

Also, update the usage message accordingly.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-05-21 15:25:10 +01:00
Keir Fraser d015de71fe xl: Check for dom0 when instructed to destroy a domain.
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-05-19 12:53:44 +01:00
Keir Fraser 00c08b5e07 xl: Add subcommand "xl debug-keys"
Can be used to send debug keys to Xen.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
2010-05-19 12:51:16 +01:00
Keir Fraser 5c898a05f4 libxl: Add tmem support commands
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-05-19 12:48:32 +01:00
Keir Fraser 7e62eca7a1 libxl: Compilation and other small fixes
* Some of the library functions such as fscanf, system, and asprintf
are declared with warn_unused_result (ubuntu server 9.10), causing
compilation errors in libxl.
* When using asprintf, the caller is responsible for freeing the
memory.
* memset takes wrong size argument in one of the places (caught by
a builtin gcc check).

Signed-off-by: Dulloor Rao <dulloor@gmail.com>
2010-05-19 08:20:46 +01:00
Keir Fraser 4d8af85966 xl: recognize the "extra" entry in the domain config file
"extra" defines extra parameters to be added to the kernel command
line, so append it accordingly.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2010-05-19 08:18:51 +01:00
Keir Fraser 034b34e084 libxl: Set default shadow memory based on final values for vcpus and memory
Set default shadow memory based on final versions of memory and vcpus,
not on minimum default versions.

Failure mode was failed p2m allocaitons, e.g., with hvm-linux PV
drivers mapping the shared-info page.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-05-19 08:15:05 +01:00
Keir Fraser 6cbd479e30 xl: allow scaling suffix on memory sizes in mem-set and mem-max
Allow mem-set and mem-max to take 'b', 'k', 'm', 'g' and 't' as
scaling suffixes for bytes, kilobytes, mega, etc.  An unadorned number
is still treated as kilobytes so no existing users should be affected.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-18 11:38:12 +01:00
Keir Fraser 1efc662aba libxl: Add missing start_time entry when create and restore VMs.
Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
2010-05-15 08:27:22 +01:00
Keir Fraser e1e86ff4a2 xl: Add include-only-once checks to xl_cmd{impl,table}.h
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-05-14 08:05:05 +01:00
Keir Fraser 9fa16606cb xl: Add "xl uptime" command, a clone of "xm uptime".
Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-05-14 08:01:51 +01:00
Keir Fraser 102f8460ca xl: Check invalid domid in find_domain()
If domain id is invalid, find_domain should return error because
the specified domain does not exist.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
2010-05-14 07:56:43 +01:00