Commit Graph
2369 Commits
Author SHA1 Message Date
kfraser@localhost.localdomain b02c2e5dfc Fix xm block/network-detach command.
- To remove device info, it waits for the backend path of the device
   to be removed.
 - It removes device info from domain info.
 - It saves domain info to the config.sxp of the managed domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-08-09 16:21:41 +01:00
kfraser@localhost.localdomain db79ac4259 acm: Some fixes to the Xend ACM management code
- prevent vlans from being relabeled when they are in use by the
  current policy
- fix problems when doing an update of the policy and the name of the
policy changes while doing that
- refactor code that has to take into consideration that unlabeled
domains may be defined using the label __UNLABELED__
- make 'xm list --label' show the complete label of a domain

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-09 16:14:56 +01:00
kfraser@localhost.localdomain 4eee6b2435 xm: Fix control characters causing xm tests to fail.
On my FC7 installation some of the test in the xm test suite fail for
no apparent reason. The problem is that the python 'readline' module
puts out control characters that confuse code that parses the output
of some of the xm commands that are being run. The readline module
dumps those characters upon import. The attached patch works around
this problem.

Here's what I get in out.txt when doing 'python 2>&1 | tee out.txt'
and 'import readline' on the python command line:

Python 2.5 (r25:51908, Apr 10 2007, 10:29:13)
[GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[[?1034h>>> >>>

The characters before the '>>>' above are those printed by that
version of 'readline' and remain invisible on the screen but appear in
the file and confuse the xm test suite parser.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 13:42:15 +01:00
kfraser@localhost.localdomain 050883d0fd xm: pass --skipdtd parameter through to 'xm new'
Pass the command line parameter '--skipdtd|-s' through to the actual
'xm new' command.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 13:39:20 +01:00
kfraser@localhost.localdomain e080ffba8d Fix/cleanup destroyDevice code path in xend.
When calling destroyDevice code path (e.g. xm block-detach dom devid),
allow specifying an integer device id or a device name such as xvdN or
/dev/xvdN.  Allowing the /dev/xvdN form is useful when detaching
devices from dom0.  Bootloaders may do this to unmount a disk
previously mounted in dom0.

Move examination of device ID format into the DevController,
permitting device controllers to determine a valid device ID instead
of higher level code.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-08-06 10:12:34 +01:00
kfraser@localhost.localdomain 883ff61657 [ACM] Support for removing / replacing a policy
Add support for removing/replacing a policy from the running
system. This operation is only successful if currently running VMs
would also be allowed to run under the new policy. Removing the
current policy means that the default policy is installed, which then
only has support for a single VM label and STE type (SystemManagement)
and is the same policy that the system starts up with when no policy
is chosen.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 10:11:25 +01:00
kfraser@localhost.localdomain b163ba1607 [ACM] Support for running unlabeled domains alongside labeled ones
Add support for running unlabeled domains alongside labeled ones, if
the policy contains a VM label with name '__UNLABELED__' and an STE
type with the same name. The ezpolicy tool has been modified to
automatically suggest a policy under which unlabeled domains can
run. The user may delete this, if this is not desired.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 10:10:34 +01:00
kfraser@localhost.localdomain 9039ed2bed [ACM] Some more fixes
- don't reload the policy if it has been loaded
 - don't always load the policy in the test suite when the policy is
   already loaded
 - skip tests 07 and 09 when ACM is not enabled and xm is not using the
   Xen-API
 - fix a problem when trying to remove an invalid label

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-30 16:03:16 +01:00
kfraser@localhost.localdomain f11a11ff7b Implement Xen API method Console.set_other_config.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-07-27 09:06:58 +01:00
kfraser@localhost.localdomain 217c8c4767 Implement missing Xen API method Console.get_other_config.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-07-27 09:06:30 +01:00
kfraser@localhost.localdomain d72cae799f Fix Xen API console methods that use undefined variables.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-07-27 09:06:10 +01:00
kfraser@localhost.localdomain fecde045d3 [Xend] Do network startup earlier.
Xend tries to rebuild the network configuration such as bridges and
vlan interfaces  (in those bridges) when starting. Unfortunately this
fails on the first startup since the network script has not run, yet,
and for example created peth0. When restarting xend it works due to
the peth0 being there then. This patch moves the initialization of the
network to an earlier time in the xend initialization process to
mitigate this problem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-27 09:04:35 +01:00
kfraser@localhost.localdomain 61cd58b400 [XEND] Fix for creating VLANs using the Xen-API
Recent changes to the setup of the peth0 interface have resulted in a
change of its MAC address. Previously it seems to have had a MAC
address of 'fe:ff:ff:ff:ff:ff', but now it has the same MAC address as
eth0. As a consequence to this the Xen-API code to create VLANs
(PIF.create_VLAN("peth0",...)) does not work anymore, since peth0 can
not be identified according to this previous criteria of fake MAC
address. This patch fixes this issue by identifying it through the
prefix 'peth'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-27 09:03:35 +01:00
kfraser@localhost.localdomain bf9e4257b3 [ACM] Check a domain's authorization to run.
A domain is only authorized to run if it has a superset of Simple Type
Enforcement Types in its VM label compared to that of Domain-0, which
itself may not have all STEs available in a policy. This patch adds a
check for this into Xend and the necessary code support into Xen.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-27 09:01:15 +01:00
kfraser@localhost.localdomain e313dc3ed8 Add domain name check and UUID check to 'xm new' command.
Add a domain name check and a UUID check to xm new command. The check
logic is as follows:

 - If the UUID is not specified
       - If a VM with same name exists
           => Update the config for that existing VM
       - Else no vm with same name exists
           => Define a brand new VM with auto-generated UUID
 - Else UUID is specified
       - If a VM with same UUID exists
             - If name is different
                   => Error
             - Else if name is same
                   => Update the config for that existing VM
       - Else no VM with same UUID exists
             - If name is different
                   => Define a branch new VM with that name
             - Else if name is same
                   => Error

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-24 18:05:04 +01:00
Tim Deegan f6c12fc6b6 [HVM] Control qemu's state-save via xenstore, instead of SIGUSR1
This lets us verify that qemu has indeed stopped processing before
we start saving guest memory.  Also allow qemu to continue processing
after the save has happened, instead of exiting immediately.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-07-24 14:52:16 +01:00
kfraser@localhost.localdomain 9d53b5f351 Improve xm vcpu-list command for inactive managed domains.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-19 17:17:25 +01:00
kfraser@localhost.localdomain bd99184d54 xend: Give back memory to dom0 after a failed auto-balloon attempt.
Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
2007-07-19 17:15:49 +01:00
kfraser@localhost.localdomain fbf9c4996c [xend / libxen] Add support for labeling of virtual network interfaces.
This patch adds labeling of virtual network interfaces to xend and
makes this manageable through the Xen-API.  It's a feature that is
only usable if ACM is enabled in Xen and xend is used through the
xen-api. A labeled virtual network interface will be plugged into a
bridge where other domains with the same-labeled network interface are
connected to, so that only same-colored domains can communicate with
each other. The bridge should be connected to the outside world using
VLAN for isolation, extending the isolation beyond the local machine.
If a virtual machine is labeled with a VM label that only has one
Simple Type Enforcement Type then it is not necessary to label the
virtual network interface, but the color of the network interface is
determined from the VM's label. If, however, a virtual machine is
labeled with a VM label that has multiple Simple Type Enforcement
Types, then the explicit labeling of each virtual network interface is
required. To specify the label of a network interface, the vif line in
the VM's configuration file has been extended with parameters similar
use for specifying the label of the VM:

vif = ['policy=<policy name>,label=<resource label>']

This labels the VIF of the virtual machine for usage under the policy
'policy name' and labels it with the label 'resource label'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-19 16:59:48 +01:00
kfraser@localhost.localdomain 080ea11ff4 [xend][xen-api] Save new memory values in domain config when calling
VM.set_memory_[dynamic|static]_[min|max] via Xen API.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-07-18 10:10:04 +01:00
kfraser@localhost.localdomain a157ca83eb [Xend] More security-related fixes
This patch provides some more fixes related to the recent
security-related extensions to xend.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-18 10:09:06 +01:00
kfraser@localhost.localdomain b60125e83e Improve xm uptime command for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-17 10:36:33 +01:00
kfraser@localhost.localdomain f0a8a3f3fb [VTPM] Make vTPM hotplug scripts use the UUID of the vTPM instance
Make the vTPM hotplug script use the UUID of the vTPM instance for
associating it with its instance number rather than the name of the
domain.
Also change the cleanup in the xm test to use the atexit mechanism
rather than explicitly calling a function to clean up.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-17 10:33:26 +01:00
kfraser@localhost.localdomain 98ee5b6406 [Xend] Fix problem when destroying VMs using the Xen-API
When domains are destroyed/suspend-resume/migration using the Xen-API
things break due to the domid not having been reset. This patch fixes
this. This is the best place I found for fixing this problem. I could
not push this line into _stateSet() for the case of DOM_STATE_HALTED
and left a comment regarding this.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-13 13:43:29 +01:00
kfraser@localhost.localdomain 2b0134dd5a [ACM-security] Some fixes to tools.
- Allow multiple ChineseWallTypes in a VM labels
- check for surfacing exceptions in the python code
- check for array sizes in the XML DOM in python
- properly display the labels when doing 'xm list --label' in xm's
non-Xen-API mode
- rely on the security checking hooks in xend to check access to the
block interface rather than doing this in xm.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-12 16:07:28 +01:00
kfraser@localhost.localdomain 7263c43515 Merge with ia64 xen tree. 2007-07-12 09:53:58 +01:00
kfraser@localhost.localdomain 82bc60ea2e [xend] Fix xm trigger command for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-11 10:54:06 +01:00
kfraser@localhost.localdomain cff6d529f2 xend: Fix 'xm dumpcore' for inactive managed domains.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-11 10:53:32 +01:00
kfraser@localhost.localdomain d7839765dc [XM] Tools support for extensions of the Xen-API for managing security policies
This patch adds a couple of new commands for using the Xen-API
extensions for security policies. Older tools are converted to support
going through the Xen-API for their operations rather than doing the
operations directly in their own code.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-11 10:49:43 +01:00
Alex Williamson 2cae8465ac merge with xen-unstable.hg 2007-07-10 08:39:26 -06:00
kfraser@localhost.localdomain 5410c03342 xend: Fix xm pause/unpause for inactive managed domains.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-10 10:15:01 +01:00
kfraser@localhost.localdomain 503e2ed481 xend: Count CPUs rather than relying on a static
nodes/sockets/cores/threads relationship.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-07-10 10:13:16 +01:00
kfraser@localhost.localdomain a75c57c971 xm: Improve help message for vif creation.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-10 10:11:14 +01:00
kfraser@localhost.localdomain 13adac8e15 xend: Missing last line from Xen_API security patch.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-09 19:28:54 +01:00
kfraser@localhost.localdomain 476959a14a Add accel option to vif xend config.
Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
2007-07-09 18:10:48 +01:00
kfraser@localhost.localdomain 184e1b098b [Xen-API] Extension of the Xen-API for managing Xen Security Policies
This patch implements extensions for managing security policies in
xend. The XSPolicy and ACMPolicy classes provide the interface for the
Xen-API and implement functionality for setting, updating and
activating of a Xen security policy as well as labeling of virtual
machines and resources such as block devices. Labeling of network
devices will follow.

The acmpolicy class implements a compiler for translating an XML
policy into their binary format and provides functionality for
comparing a current policy against a new one when changing/updating a
policy.

The xspolicyadmin class administers the policy of the system.

Some of the xend-internal code deals with transforming the labeling
information from the S-Expression format into the new Xen-API
format. This is similar to much of the other code that is already
there.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-09 14:51:44 +01:00
kfraser@localhost.localdomain ba302f5c07 Fix xm save command for a inactive managed domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-09 09:41:45 +01:00
kfraser@localhost.localdomain ddc75a75d9 Better error message for 'xm sysrq' on inactive domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-09 09:38:35 +01:00
kfraser@localhost.localdomain c4d1247d00 hvm: Add global default keymap setting
Add global default keymap setting to be used when a VM does not have
a keymap configuration set.

Signed-off-by: Pat Campbell <plc@novell.com>
2007-07-06 16:16:57 +01:00
kfraser@localhost.localdomain be259653f3 Extended the physinfo sysctl to export NUMA cpu_to_node topology info.
Print this in 'xm info'.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-07-06 16:12:07 +01:00
kfraser@localhost.localdomain fefb7c8d3b xend: Fix xm block/network-attach command for inactive managed domain
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-06 14:41:05 +01:00
kfraser@localhost.localdomain 4c9048d9dc xend: Fix op_domain_sched_credit_set() in SrvDomain.py
This patch adds "cap" into op_domain_sched_credit_set().
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-06 14:39:21 +01:00
kfraser@localhost.localdomain 365e87562a Improve xm sched-credit command for inactive managed domains
Allows to change the scheduler parameters of inactive managed domains.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-06 14:34:54 +01:00
kfraser@localhost.localdomain 2fc4a5a032 xend: Save modified scheduler params of managed guests to config.sxp.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-03 10:21:21 +01:00
Alex Williamson 19472a02dd merge with xen-unstable.hg 2007-07-02 12:19:26 -06:00
Alex Williamson f563c36712 [IA64] Fix NVRAM data cannot be saved when guest execute "reboot"
Also fix "xm reboot" instruction in Xend.

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
2007-07-02 09:38:51 -06:00
Ian Campbell 4cb346f848 Fix 15435:ab95b9764b20.
The changeset did not consider about ":cdrom" and "ioemu:"
of a disk definition.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-02 08:42:13 +01:00
Keir Fraser 0cf4932910 xm: Fix xm block-detach error message duplication.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-01 22:25:27 +01:00
Keir Fraser e0ccefb2fb xm: Fix a typo for xm network-detach.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-07-01 22:23:16 +01:00
Keir Fraser c32cff27ba xend: Pass information to user when failing migrate due to PCI dev.
When failing a migration / save due to the domain owning a PCI device
make sure that we tell the user what went wrong!

Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
2007-07-01 22:10:38 +01:00