Commit Graph
110 Commits
Author SHA1 Message Date
Gianni Tedesco 9becdd8ee9 libxl: Check whether a PCI device is assignable before assigning it do a domU
Implement a new libxl function libxl_device_pci_list_assignable. This is
used to implement the xl list-assignable-pci-devices command and part of
the implementation is used to make sure that PCI devices are not multiply
assigned to one or more domU's before doing the passthrough assignment.

The function libxl_device_pci_list changes to libxl_device_pci_list_assigned
due to a parameter change for consistency with pci_list_assignable.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-29 18:52:33 +01:00
Ian Campbell 64de62a14e Subject: xl: log unknown domain shutdown reason and default to destroy
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-29 15:56:13 +01:00
Ian Campbell 528ad3b6e2 libxl: consistently use typedef struct {} libxl_$type
typedef struct seems to be the dominant idiom in the mixture currently
in use.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-28 16:18:44 +01:00
Ian Campbell c025c18b4c xl: simplify configuration parsing with local variables
Replace repeated patterns of "d_config->THING[d_config->num_THING]"
with a single local variable.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 17:20:23 +01:00
Ian Campbell 49930c8b3c xl: move device structs into struct domain_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 17:17:09 +01:00
Ian Campbell 441c97a04c xl: move create and build info to struct domain_config
All three are passed around together and this begins to reduce some of
the exceptionally long parameter lists.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 17:09:11 +01:00
Ian Campbell a3dab8d97e xl: implement "rename-restart" action for shutdown
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 17:08:11 +01:00
Ian Campbell 1a0e17891f xl: support on_{poweroff,reboot,crash} domain configuration options.
Adds on_watchdog compared to xend.

I have further plans for struct domain_config so it isn't as pointless
as it first looks.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-27 17:06:14 +01:00
Ian Campbell 0e89a4cedf xl: Factor out domain death handling into a separate function.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 17:05:12 +01:00
Ian Campbell 8595964bd0 xl: Add function to generate random uuid and use it.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-27 16:59:14 +01:00
Ian Campbell 5213606b56 libxl: signal caller if domain already destroyed on domain death event
Currently libxl_event_get_domain_death_info returns 0 if the event was
not a domain death event and 1 if it was but does not infom the user
if someone else has already cleaned up the domain, which means the
caller must replicate some of the logic from within libxl.

Instead have the libxl_event_get_XXX_info functions required that the
event is of the right type (the caller must have recently switched on
event->type anyway).

This allows the return codes to be used in an event specific way and
we take advantage of this by returning an error from
libxl_event_get_domain_death_info if the domain is not dying.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 16:58:51 +01:00
Ian Campbell 1e01a066eb libxl: return libxl_dominfo from libxl_event_get_domain_death_info
Removes a libxc data type from the libxl interface.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 16:58:26 +01:00
Ian Campbell 4d70c9c556 libxl: add shutdown reason to libxl_dominfo
Removes the need for explicit libxl_dominfo.crashed so remove it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 16:57:38 +01:00
Ian Campbell 8b30395218 libxl: Add LIBXL_EVENT namespace prefix to enum libxl_event_type
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-27 16:57:06 +01:00
Ian Jackson c8f6739e2e xl: Fix build after info1,info2 change
3cdba275e8c0 missed one instance, now fixed.
2010-07-23 18:50:30 +01:00
Ian Campbell e6075f0689 xl: do not try and auto re-connect console on reboot
It is not possible to run the console client if we are rebooting a
guest via the backgrounded xl process so we may as well turn off
console autoconnect after the first boot.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-23 18:12:42 +01:00
Ian Campbell 45e70f79e1 xl: use more descriptive names than info1 and info2
c_info and b_info appears to be the common idiom in other bits of xl.

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>
2010-07-23 18:11:03 +01:00
Ian Campbell 71fa50d138 xl: Spelling fix to ("quite" => "quiet")
s/quite/quiet/g

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-23 18:09:28 +01:00
Ian Campbell 5ba1a57d44 libxl/xl: correctly report domain state.
In particular distinguish between domain shutdown and crash and the
blocked and running states.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-07-23 17:39:32 +01:00
Stefano Stabellini 5d7dda7847 implement xl vncviewer
Implement xl vncviewer. The only difference from xm vncviewer is that we
obey the VNCVIEWER environment variable.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-20 17:22:14 +01:00
Stefano Stabellini a9c189d680 Implement xl dump-core
Implements dump-core command which is similar to xm dump-core except
that it requires an additional argument which is the target filename.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-19 15:33:38 +01:00
Stefano Stabellini 402ddf4b39 This patch introduces libxl_primary_console_exec: a new libxl function
that finds the domid and console number corresponding to the primary
console of a given vm. The domid might be different from the domid of
the VM and the console number might not be 0 when using stubdoms.
The caller (xl_cmdimpl.c in this case) has to make sure that the stubdom
is already created before calling libxl_primary_console_exec in the hvm
case. In the PV case libxl_primary_console_exec has to be called before
libxl_run_bootloader.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-19 12:47:53 +01:00
Stefano Stabellini 870648146f Implement "xl tmem-freeable" to match "xm tmem-freeable".
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2010-07-19 12:20:41 +01:00
Ian Jackson 214abecaa3 xl: start numbering vifs from 0
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-14 16:46:49 +01:00
Ian Jackson 6a8f8977a1 libxl, xl: support running bootloader (e.g. pygrub) in domain 0
Much of the bootloader interaction (including the Solaris and NetBSD
portability bits) are translated pretty much directly from the python
in tools/python/xen/xend/XendBootloader.py

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:45:38 +01:00
Ian Jackson 108be15853 libxl: support mapping files rather than carrying paths around
This will allow us to map and then unlink the file and therefore
delete the process on process exit or explicit unmap.

Using the mmaped versions of these files required rewriting build_pv
to use the xc_dom builder functionality directly rather than through
the xc_linux_build "compatibility layer". (The status of the
xc_linux_build interface as a compatibility layer seems a bit dubious
since all existing callers use it but if anything is going to replace
it then libxl seems like the likely candidate).

I'm not thrilled with the definition of the maps lifecycle. This could
be solved by adding a helper function to explicitly free the toplevel
structure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:43:49 +01:00
Ian Jackson adb8dd8440 libxl, xl: exec xenconsole in current process, defer decision to fork to caller
Use this to run xenconsole as the foreground process and move the
connection to the console in the "create -c" case early enough to be
able to view output from the bootloader. This behaviour is consistent
with how both "xm console" and "xm create -c" operate.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-07-14 16:40:33 +01:00
Ian Jackson 85bd32d908 xl: default timer_mode to 1
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-14 16:31:59 +01:00
Ian Jackson 772aebeab9 tools/libxl: implement support for nomigrate option in VM profiles
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-08 17:54:42 +01:00
Ian Jackson 7182d1d11b tools/libxl: Read soundhw option and pass it on to qemu
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-08 17:53:19 +01:00
Ian Jackson 84b1ed809c tools/libxl/xl: fix for short BDF (without domain specified)
Check that BDF have been parsed correctly.  Before this fix, BDF could
be parsed incorrectly if user omitted the domain.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Contributed-by: Sergey Tovpeko <tsv.devel@gmail.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-07-08 17:22:18 +01:00
Ian Jackson 1b54711eae tools/libxl: revert 15bcf57fcf24 (disable_migrate)
That patch is entirely wrong.  xc_domain_disable_migrate does not work
like that, and the config parameter is misnamed.
2010-07-06 17:38:19 +01:00
Ian Jackson dcb2947e81 tools/libxl: support the "disable_migrate" domain config option
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-06 17:22:39 +01:00
Ian Jackson 0a34b3481d tools/libxl: allow setting of timer_mode, hpet and vpt_align parameters
Implement parsing for timer_mode, hpet and vpt_align parameters.

These are all HVM only parameters and hpet/vpt_align are boolean so
change types and place in hvm union accordingly. Also HPET is x86 only
on principle so make this compile-time conditional on arch as-is
viridian.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-07-06 16:55:49 +01:00
Stefano Stabellini 8cde53d099 this patch implements few missing options in xl so that it can be
used as a replacement of xm in xendomains:

- dryrun and quiet, long options to xl create;

- l, option to xl list.

printf_info is now used to print the configuration of the running VMs so
the output has been reformatted to be similar to the output of xm list -l.

There is still one command used in xendomains that is not implemented in
xl and not covered by this patch: xm shutdown. However a patch has been
sent to the list in the past and we are expecting a new version of it
soon.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-06-22 16:05:56 +01:00
Keir Fraser d3e1e67d8a xl: tidy up around global '-v' option
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-06-18 14:09:29 +01:00
Keir Fraser f20cacf6dc xl: allow truncation of xl subcommands
for those of us who are used to typing "xm cr foo"

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-06-18 14:09:14 +01:00
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 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