Commit Graph
2468 Commits
Author SHA1 Message Date
Keir Fraser 8fd28ec7bd ACM: Recover if XML policy representation is missing.
Recover the system if the XML representation of the currently loaded
policy is missing. Force the installation of the DEFAULT policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-06 12:13:12 +00:00
Keir Fraser 7408fe8337 xm: Fix help message of xm info.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-05 10:40:19 +00:00
Keir Fraser 45be668f9f Fix help message of on_xend_stop
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-05 09:57:32 +00:00
Keir Fraser 4eb5685edc Implement legacy XML-RPC interface for ACM commands.
This patch moves the directory of files where xend is writing policies
and resource labels into to /var/lib/xend/security/policies.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-05 09:45:13 +00:00
Keir Fraser 0ea4d2fb34 Implement legacy XML-RPC interface for ACM commands.
This patch implements a (non Xen-API) legacy XML-RPC interface for the
ACM commands and funnels the calls into code introduced by the Xen-API
support for ACM security management. Since some of the functionality
has changed, also the xm applications have changed. In particular the
following old commands have been removed along with some tools the
have become obsolete now:

- loadpolicy    (included in: setpolicy)
- makepolicy    (included in: setpolicy)
- cfgbootpolicy (included in: setpolicy)

and the following commands been introduced:

- setpolicy
- getpolicy
- resetpolicy

All tools have been adapted to work in Xen-API and legacy XML-RPC
mode. Both modes support the same functionality.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-05 09:44:20 +00:00
Keir Fraser 109644c919 Merge with ia64. 2007-12-04 11:06:05 +00:00
Keir Fraser a914d49745 xend: Implement get_by_name_label for class XendNetwork
Although XenAPI c-bindings support this operation on Network class,
there is no implementation in xend.  This patch provides one.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-12-04 10:41:55 +00:00
Alex Williamson 1ea2ab2fe8 [IA64] Implement guest_os_type for ia64
This makes use of the domain config option guest_os_type for
ia64 and removes the backing for the previous ACPI based
mechanism used previously.  A user wanting optimal performance
for a specific type of OS guest running in an HVM domain should
make use of this new option.  See updated xmexmaple.vti for
available options.  All supported OSes should always work using
the default option or leaving the option unspecified.  Originally
based on patch from Zhang Xin.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-11-29 12:15:43 -07:00
Alex Williamson 1f9c267a70 [IA64] Create common guest_os_type domain config option
This is an optional domain config entry that may be used by
architecture specific builder code to setup various optimizations
based on the guest OS intended to run in the domain.  Based on
patch from Zhang Xin.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Acked-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-29 11:54:31 -07:00
Keir Fraser 255c12e851 xend: Add support for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-11-23 11:58:11 +00:00
Keir Fraser 22883da437 xenapi: Extension to get vif total i/o stats.
From: Stefan de Konink <skinkie@xs4all.nl>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-20 15:18:09 +00:00
Keir Fraser e4d4fa0670 xend: host.get_log() close fd
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-11-16 16:43:57 +00:00
Keir Fraser 6eed158eb9 xend, xenapi: Strip characters from logs that XMLRPC layer cannot handle.
From: Ian Jackson <ian.jackson@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-16 14:45:35 +00:00
Keir Fraser cdad5edb46 xend: readDomTxn() and friends use dompath, not vmpath.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-15 22:14:13 +00:00
Keir Fraser bbceef66ea solaris, xend: Fix FMRI for Solaris SMF.
Update the FMRI for SMF to reflect reality (again).

Signed-off-by: John Levon <john.levon@sun.com>
2007-11-10 10:55:27 +00:00
Keir Fraser b1a8a810f7 xend: Fix appending policy module to end of grub's config file
This patch fixes the case where a module line is supposed to be added
to the very end of the file but the file does not end in with a new
line. Also fixes a problem that in some cases the module line would
not be properly be removed.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-11-10 10:54:32 +00:00
Keir Fraser 940897106a xm: Fix long options of xm sched-credit
Long options of xm sched-credit command are ignored (--domain,
--weight, --cap). This patch fixes it.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-11-08 10:23:22 +00:00
Keir Fraser fca749bf8d xend: Fix startup crash for some network configurations.
From: Guillaume Rousse <Guillaume.Rousse@inria.fr>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-11-06 09:39:25 +00:00
Keir Fraser bb768314f2 xm: fix "xm labels type=any" command error
Signed-off-by: Syunsuke HAYASHI <syunsuke@jp.fujitsu.com>
2007-11-05 13:15:56 +00:00
Keir Fraser 1d405b7498 acm, xend: Follow linked files.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-11-01 09:37:47 +00:00
Keir Fraser 4ce3209eae xend: Fix missing boolean xend config options
If a boolean option was missing in the SCF database, we weren't
processing the default value correctly.

Signed-off-by: John Levon <john.levon@sun.com>
2007-11-01 09:36:46 +00:00
Keir Fraser cb9e907b6f acm, xm: Propagate error codes.
Fix propagation of error codes to the shell in some of the security
related xm commands.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-30 09:33:49 +00:00
Keir Fraser 818a831762 qemu vnc auth 4/4: XenD config for VNC TLS protocol
This patch adds support to XenD for configuring the previously added
TLS encryption and x509 certificate validation. At this time I have
only enabled this config to be done system-wide via
/etc/xen/xend-config.sxp. Since it requires the admin to add
certificates on the local FS, there's not much point in making it per
VM. The x509 certificates are located in /etc/xen/vnc. Since this
requires a special VNC client program (GTK-VNC,
virt-viewer/virt-manager or VeNCrypt viewer) the use of TLS is
disabled by default. Admins can enable it if they are using a suitable
client.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-30 09:32:10 +00:00
Keir Fraser 02b1dc06bf qemu vnc auth 3/4: Add VNC auth support from upstream QEMU
This patch adds in the upstream QEMU VNC authentication code. This
spports the previous VNC password auth scheme, as well as the VeNCrypt
protocol extension. The latter allows for performing a TLS handshake,
and client verification of the server identify using x509
certificates. It is also possible for the server to request a client
certificate and validate that as a simple auth scheme. The code
depends on GNU TLS for SSL APIs, and the configure script will
auto-detect this.

The image.py code is changed to  deal with the new syntax for the -vnc
option.  In particular password authentication is now enabled by
giving the 'password' flag,

eg -vnc 0.0.0:1,password

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-30 09:30:49 +00:00
Keir Fraser 27d2e52b7c xend: Reduce xenstore transactions when listing domains
In summary, this allows a xenstore transaction object to be passed
around the various device controllers, so that they don't have to do
lots of singleton transactions. Transactions have very heavy I/O
impact from xenstored so reducing their number is important.

When running 3 guests, this patch reduces the impact of 'xm list
--long' from 176 transactions, scaling O(n) with guests, to 26
transactions with O(1) scaling.

I have previously attempted to also address the same issue with 'xm
create' but that's much harder since the device front/back handshake
requires that XenD use a number of small transactions. So i've not
changed anything here.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-30 09:19:43 +00:00
Keir Fraser ee41f1c835 Allow incremental access to hypervisor console log.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-29 12:56:27 +00:00
Keir Fraser 5ef7bed4e4 xend, acm: Trigger a script when a resource's label changes
This patch triggers a script when a resource's label changes. The xend
config file should provide a variable 'resource-label-change-script'
that can then be launched.

Signed-off-by; Stefan Berger <stefanb@us.ibm.com>
2007-10-29 08:46:34 +00:00
Keir Fraser a99192d1d7 xend, acm: Fix bad indentation
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-29 08:45:58 +00:00
Keir Fraser 617d4311ef hvm, x86: Allow virtual timer mode to be specified.
In HVM config file:
timer_mode=0 # Default: virtual time is delayed when timer ticks are
             # missed dur to preemption
timer_mode=1 # Virtual time always equals wall time, even while missed
             # ticks are pending

From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-26 09:56:54 +01:00
Keir Fraser f8e2c1f126 pv-qemu 10/10: Make xenconsoled ignore doms with qemu-dm
This patch writes a field /local/vm/DOMID/console/type taking the
value 'ioemu' or 'xenconsoled'. If xenconsoled sees a type that is
not its own, then it skips handling of that guest. The qemu-dm
process doesn't need to read this field since it will only attach
to the console if given the -serial pty arg which XenD already
ensures matches this xenstore field.

The overall behaviour is that if a paravirt guest has a qemu-dm
process running then that handles the console, otherwise the
xenconsoled handles it. The former is more functional, with the
exception of not currently supporting persistent logging to a
file at the same time as exposing a PTY.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-25 14:45:47 +01:00
Keir Fraser f8ffd3b21f pv-qemu 9/10: XenD device model re-factoring
This patches adapts XenD so that it is capable of starting a qemu-dm
device model for both paravirt and fullyvirt guests. A paravirt guest
will only be given a device model if it has a VFB configured, or the
user explicitly include the device_model option in the config
config. This avoids unnecessary overhead for those wanting a minimal
paravirt guest.

The bulk of this patch involves moving code from the HVMImageHandler
into the base ImageHandler class. The HVMImageHandler and
LinuxImageHandler subclasses now merely containing a couple of
overrides to set some specific command line flags. The most important
is -M xenpv, vs -M xenfv.

The XenConfig class has a minor refactoring to add a has_rfb() method
to avoid duplicating code in a couple of places. Instead of hardcoding
DEFAULT_DM it now uses the xen.util.auxbin APIs to locate it - this
works on platforms where qemu-dm is in /usr/lib64 instead of
/usr/lib. As before paravirt only gets a default qemu-dm if using a
VFB.

The vfbif.py class is trimmed out since it no longer needs to spawn a
daemon. A few other misc fixes deal with qemu-dm interactions when
saving/restoring, and in particular recovering from save failures (or
checkpointing).

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-25 14:45:07 +01:00
Keir Fraser 36a48e9d87 pv-qemu 8/10: Add pv console to QEMU paravirt machine
This patch adds a paravirt console driver to qemu-dm. This is used
when the QEMU machine type is 'xenpv', connecting to the ring buffer
provided by the guest kernel. The '-serial' command line flag controls
how the guest console is exposed.

For parity with xenconsoled the '-serial pty' arg can be used. For
guests which are running a qemu-dm device model, the xenconsoled
daemon is no longer needed for guest consoles. The code for the
xen_console.c is based on the original code in
tools/console/daemon/io.c, but simplified; since its only dealing with
a single guest there's no state tracking to worry about.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-25 14:42:40 +01:00
Keir Fraser 3bc128ebcf pv-qemu 2/10: Add a QEMU machine type for paravirt guests
This patch adds a paravirt machine type to QEMU. This can be requested
by passing the arg '-M xenpv' to qemu-dm. Aside from -d, and
-domain-name, the only other args that are processed are the VNC / SDL
graphics related args. Any others will be ignored. A tweak to
helper2.c was made to stop it setting up a file handler watch when
there are no CPUs registered.

The paravirt machine is in hw/xen_machine_pv.c and registers an
instance of the xenfb class, integrating it with the QEMU event loop
and key/mouse handlers. A couple of methods were adding to xenfb.h to
allow direct access to the file handles for xenstore & the event
channel.

The vfbif.py device controller is modified to launch qemu-dm instead
of the old xen-vncfb / sdlfb daemons.

When receiving framebuffer updates from the guest, the update has to
be copied into QEMU's copy of the framebuffer. This is because QEMU
stores the framebuffer in the format that is native to the SDL
display, or VNC client. This is not neccessarily the same as the guest
framebuffer which is always 32bpp. If there is an exact depth match we
use memcpy for speed, but in the non-matching case we have to fallback
to slow code to convert pixel formats. It fully supports all features
of the paravirt framebuffer including the choice between absolute &
relative pointers. The overall VIRT memory image size is about same as
old xen-vncfb, but the resident memory size is a little increased due
to copy of the framebuffer & some QEMU static state overhead. Most of
this is shared across QEMU processes.

To avoid both moving the xenfb.c and making changes to it in the same
patch, this just uses a Makefile hack to link against the xenfb.o from
the tools/xenfb/ directory. This will be removed in the following
patch.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-25 14:35:04 +01:00
Keir Fraser 12c3839b0d xend: fix hvm domain restore failure when using vncdisplay option.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-10-25 09:44:11 +01:00
Keir Fraser ff5d3cc782 xend, acm: small fixes
Check that the policy is of type ACM and return an error if it is not.
Reworked the way the label of a domain is read.

Signed-off-by; Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:25:03 +01:00
Keir Fraser 40a0c5900b xend, acm: Put the __UNLABELED__ label into the mapfile if policy specifies it
Put the __UNLABELED__ label into the mapfile if policy specifies this
label rather than keeping the NULL_LABEL there. Also lock the map file
when it's rewritten and propagate the return code from compiling the
policy to callers.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:24:28 +01:00
Keir Fraser 9c14bd9596 xend: Reworked initialization of XSPolicy administration class
Rather than picking up the current policy from the managed policies
file the hypervisor is asked for the name of the current policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:23:27 +01:00
Keir Fraser 61d0b64c6c xm-test: various fixes
- recently I added an other_config field to the VTPM record which now
needs to be accounted for otherwise the test determines a bad key
- the dry-run command was throwing a different type of exception
(ACMError) than what was caught (XSMError)
- the tests based on the raw Xen-API need to build the PV_args
parameters from the old 'root' and 'extra' parameters.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-25 09:22:28 +01:00
Keir Fraser de91f88afe vt-d: Fix PCI=device parsing.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-10-22 14:26:45 +01:00
Keir Fraser e38bd7ef8e ia64: Fix ia64 PV domain creation with new vhpt-size parameter.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-10-22 14:21:13 +01:00
Keir Fraser 1934a762f0 ia64: Add HVM_PARAM_BUFPIOREQ_PFN constant.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-10-22 09:41:25 +01:00
Keir Fraser 88561d3058 hvm: Fix PCI-passthru string parsing.
Fixes crash of xend during HVM domain ccreation.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-20 09:30:00 +01:00
Keir Fraser 07f557cb63 Replace sysctl.physinfo.sockets_per_node with more directly useful
sysctl.physinfo.nr_cpus. This also avoids miscalculation of
sockets_per_node by Xen where the number of CPUs in the system is
clipped.
From: Elizabeth Kon <eak@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-19 18:00:10 +01:00
Keir Fraser 15f1e5e394 vt-d: Detect and report failure to assign a pass-thru PCI device.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-10-19 09:31:03 +01:00
Keir Fraser 753df0d608 ia64: configure VHPT size per domain: common part
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-10-19 09:27:55 +01:00
Keir Fraser cefbbff3f5 tools: Remove bogus external uses of xc_private.h. Clean up libflask.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-18 15:12:03 +01:00
Keir Fraser d61d5e12e1 xend: xenapi: Suspended domain causes fault if vif.get_all_records() is called
A single suspended domain on the system causes a fault when
vif.get_all_records() is called since this returns an ErrorDescription
and no 'Value' in the 'v' dictionary. This patch now returns a 'None'
as Value which might not be optimal but better than faulting.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-16 17:41:33 +01:00
Keir Fraser 43e55cbba8 xend: Clean up hvm_build Python wrapper. Python code can get/set hvm
params directly.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-16 10:27:55 +01:00
Keir Fraser e972f8be18 xend: Fix file resouce leak on resume of suspended managed domains.
When a suspended managed domain is resumed, the checkpoint file is
removed, but xend retains a reference to the removed file. This
represents a resource leak. Fixed by ensuring that the file reference
is closed correctly.

Signed-off-by: Gary Pennington <gary.pennington@sun.com>
2007-10-12 14:30:41 +01:00
Keir Fraser 1a55b4207e [vTPM] Add set/get_other_config to Xen-API.
Add get_- and set_other_config methods to the vTPM class. Write the
parameters into the xenstore while the domain is running prefixing it
with 'oc_'. Also I add the methods to the C library as well as the
documentation.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-11 09:41:16 +01:00