Commit Graph
2442 Commits
Author SHA1 Message Date
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
Keir Fraser 3e1c252345 xend, xsm: Lock domain access while modifying policy.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-08 13:43:17 +01:00
Keir Fraser f15dc94bec xend: Remove unused xoptions.netback_type.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-08 10:57:32 +01:00
Keir Fraser 10f71216a1 Fix domU reboot failure when using "pci=" option
The failure only happens on the second or later auto reboot.
See the following thread for a long discussion on this issue where
most problems were fixed.

http://lists.xensource.com/archives/html/xen-users/2006-05/msg00154.html

Signed-off-by: Charles Arnold <carnold@novell.com>
2007-10-08 10:46:45 +01:00
Keir Fraser a687f4cc2f xsview: a xenstore viewer written in PyQT.
From: Mark Williamson <mark.williamson@cl.cam.ac.uk>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-10-04 13:52:51 +01:00
Keir Fraser 6f10c4bf8d xm: Add accel option to xm network-attach.
Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
2007-10-03 14:56:31 +01:00
Keir Fraser 905654ba54 xend: Check access to the privcmd interface before doing the call to
fetch the currently enforced policy. Assign 'INACCESSIBLE' to the
policy if it cannot be retrieved due to the user not being
privileged.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-03 14:06:06 +01:00
Keir Fraser 8950f5c6ba Extend 'xm dumppolicy' to support Xen-API
I am extending 'xm dumppolicy' to be used via the Xen-API. For this
there are two new functions in the ACM policy class:
 - get the currently enforced policy including statistical data from
   the hypervisor
- get the ACM 'ssidref' of a Domain. Since this may be a ACM-specific
  variable or type (int) I put it into the ACM class.

I extended the Xen-API documentation with the two new functions.

Signed-off-by: Stefan Berger <Stefanb@us.ibm.com>
2007-10-03 14:04:51 +01:00
Keir Fraser 01025319d1 xend: Fix name/uuid uniqueness checks.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-02 10:01:10 +01:00
Keir Fraser c3aaa708a8 Revert 15642:207582c8d88b532783da5c6f5839336187556f0a.
This patch is now bogus since 15168:a717cb2fac90 is reverted
by 15973:8817a53c030f.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-10-02 09:59:39 +01:00
Keir Fraser ece8f4f259 xend: Fix refactoring done in CS 15938 in security.py.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-10-02 09:27:22 +01:00
Keir Fraser eaaa8ec561 xm: Print xend config via 'xm info --config'.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2007-10-01 06:39:00 +01:00
Keir Fraser 9f5581fda7 xend: Fix name uniqueness check (revert 15168:a717cb2fac90).
Changeset 15168:a717cb2fac90 altered check_name() in XendDomainInfo so
that it compares domain IDs instead of UUIDs. This breaks a number of
things

 - You can no longer use 'xm new' to define a persistent config file for
   a running guest. This breaks the key OS provisioning scenario where
   you boot a kenrel+initrd for the installer, and at the same time
   define a permanent config with pygrub.

 - It lets you define multiple inactive guests with different UUIDs, but
   the same name because all inactive guests have a domid of None. So
   you can now end up with multiple guests with same name, which is
   contrary to the goal implied by the patch which was name uniqueness.

It is unclear from the original commit logs just what scenario it was
trying to protect against, but the original checking of uniqueness
based on UUID was correct & is what was used in previous releases XenD.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-09-27 18:08:11 +01:00
Keir Fraser cd76c0a1ed xend: fix server/netif.py so that it respects type=None.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-09-27 17:44:03 +01:00
Keir Fraser a0d123d804 xend: Fix dummy security_policy_dir.
Changeset 15951:ad339d88639d split policy_dir_prefix into
security_dir_prefix and policy_dir_prefix in acm code.  I think this
needs to be reflected in the dummy module as well (otherwise we blowup
when bootloader.py tries to reference security.security_dir_prefix).
Fixed in below patch.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-09-27 15:22:29 +01:00
Keir Fraser 884ec5f334 xend: Slightly finesse allocation of vmpath in xenstore.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-26 17:11:07 +01:00
Keir Fraser 4d0cfe8f1b [xend,xenapi] Fix handling of scheduler params
When creating domains that specify scheduler parameters with XenAPI,
the specified parameters are not used when starting the domain. This
patch collapses cpu_weight and cpu_cap in XendConfig into the
vcpus_params dictionary. The patch has been tested using xm and
XenAPI on config with and without scheduler parameters.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-26 14:39:56 +01:00
Keir Fraser 468eb4e36f xend: Fix VIF MAC address being lost across localhost migration.
VIF details in /vm/<uuid> directory in xenstore get deleted by old
domain dying.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-25 15:35:17 +01:00
Keir Fraser 05fcd427f8 Fix xend start after xsm:acm bootloader changes.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-25 10:40:38 +01:00
Keir Fraser 44e7c3aa10 xend memory ballooning: do not bother if guest will not fit in
physical memory constraints.

If users require domain memory size larger than a physical memory
size, we do not need waiting for ballooning, and should cause
xm create command error right away.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-25 09:30:00 +01:00
Keir Fraser 66ea95096a [Xend/ACM] Automatic loading of policy after xend has started.
On systems where the grub bootloader is not available or active the
to-be-activated policy is written a simple textfile. Once xend has
started the contents can be read. Using 'xm setpolicy' the policy can
be activated and the Domain-0 label set (using 'xm addlabel').
I fixed some bugs in the grub bootloader handler on the way and
removed some dead functions.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-09-24 21:52:10 +01:00
Keir Fraser af8b404f2d XSM:FLASK support for domain management under Xen-API
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2007-09-23 12:45:07 +01:00
kfraser@localhost.localdomain 5d942ff119 xm: Extend width of ID in 'xm list --label' to 5 digits
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-18 15:08:11 +01:00
kfraser@localhost.localdomain 9e6ca368e2 PCI passthru: tools changes (generic and vt-d)
I have added CONFIG_PASSTHROUGH in ioemu/Makefile.target and
ioemu/hw/pc.c in attached vtd_tools2.patch.  This should turn off
libpci usage by default until user specifically enables it.

This can be safely check-in without breaking builds for people who do
not care about pass-through devices.  I will try to think of a better
way to enable this.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Signed-off-by: Guy Zana <guy@neocleus.com>
2007-09-14 16:39:27 +01:00
kfraser@localhost.localdomain e1a067a78e Fix xm dump-core command for paused domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-14 16:07:18 +01:00
kfraser@localhost.localdomain 661e422af8 Fix 'xm reboot'
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-14 16:05:39 +01:00
kfraser@localhost.localdomain d6dec5a652 Fix two memory leaks in xend.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-09-14 16:04:33 +01:00