Commit Graph
2402 Commits
Author SHA1 Message Date
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
kfraser@localhost.localdomain 337e2014c7 Fix memory leak in xend
I found that xend's memory usage grows considerably when running a
script such as

while true; do xm new foo ; sleep 2s; xm delete foo ; sleep 2s; done

XendAPIStore maintains a list of class instances and in the case of
new/create operation, an associated VMMetrics object is stashed in the
list but never removed on delete/shutdown.  This patch removes the
instance by invoking XendBase.destroy() method.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-11 13:41:15 +01:00
kfraser@localhost.localdomain 4a6a1afb1c Add 'type vnc' to vfb device sexpr for HVM guest
This patch adds 'type vnc' to vfb device sexpr for HVM guests.  PV
guests already contain this entry in sexpr, e.g.

    (device
        (vfb
            (vncunused 1)
            ...
           (type vnc)
            ...
        )
    )

Some tools, such as libvirt, look for device/vfb/type in sexpr before
publishing VNC port.  More importantly, this patch provides
consistency in vfb device sexpr between HVM and PV guests.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-09-11 13:40:44 +01:00
Tim Deegan e58cf9dbf9 Xend: "shadow_memory" setting in xm config is in MiB, not bytes.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-09-11 12:30:39 +01:00
kfraser@localhost.localdomain 986fc80c68 Fix error message and wait time for xm block-detach command.
- Wait time
    When xm requests a block device detach to xend, xm makes two
    requests. At first, xm requests the block device detach by device
    class 'vbd'. Next, xm requests the block device detaching by
    device class 'tap'.
    As a result, the wait time is 200 seconds because each of
    the block device detaching requests causes time-out.
 - Misleading error message
    Because the last request is by device class 'tap' to xend,
    the keyword "(tap)" is included in the error message.

This patch fixes the number of times of the block device detaching
request to one time.  At first, xm makes inquiries about device
class of a detaching target device to xend.  Then xm requires the
block device detaching by xend returned device class.  The wait
time becomes 100 seconds because the block device detaching request
is one time.  And the error message is also fixed.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-07 11:30:18 +01:00
kfraser@localhost.localdomain 214523659d xend: Fix error message for xm trigger command.
When I tested xm trigger command with a wrong argument, I saw the
following error message.

 # xm trigger vm1 xyz
 Error: __init__() takes exactly 2 arguments (3 given)
 Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]

 Send a trigger to a domain.

This patch fixes the error message as follows.

 # xm trigger vm1 xyz
 Error: Invalid trigger: xyz
 Usage: xm trigger <Domain> <nmi|reset|init> [<VCPU>]

 Send a trigger to a domain.

The type of "TRIGGER_TYPE" is dictionary.  domain_send_trigger()
refers to the keys of "TRIGGER_TYPE" without using keys() currently.
This patch adds keys() there.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-07 11:24:28 +01:00
kfraser@localhost.localdomain 95f83e447a xend: waitForDevices() on xm reboot.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-09-07 11:10:32 +01:00
kfraser@localhost.localdomain f0a09ab129 Fix domain restore after memory auto-balloon changes.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-09-06 18:26:45 +01:00
kfraser@localhost.localdomain f3c0c0db25 [XSM] correctly rename, relocate and patch the security.py file
This patch corrects an error in the original XSM tools patch.  The
original patch did not rename, relocate and patch the security.py file
from changeset 15730:256160ff19b7.  This patch addresses this issue as
well as any updates made to security.py in xen-staging during the
merge of XSM.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2007-09-06 18:05:18 +01:00
kfraser@localhost.localdomain 87a39e42b8 xend: Always build lowlevel security modules, as there are some
dependencies on these from with xend proper.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-08-31 16:50:26 +01:00
kfraser@localhost.localdomain 399280a99d xend: Correct indexing in xc_cpu_to_node_t map.
Signed-off-by: Beth Kon <eak@us.ibm.com>
2007-08-31 14:14:14 +01:00
kfraser@localhost.localdomain 9ef6233978 xend: Add blktap disk type check
Print the following error when you give a wrong disk type to xm commands:
 # xm create /xen/vm1.conf disk='tap:xxx:/xen/root-vm1.img,hda1,w'
 Using config file "/xen/vm1.conf".
 Error: tap:xxx not a valid disk type

 # xm block-attach vm2 tap:yyy:/xen/second.img hdb1 w
 Error: tap:yyy not a valid disk type
 Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>
 [BackDomain]

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-08-31 14:11:15 +01:00
kfraser@localhost.localdomain e6f4576ed5 Fix handling of auto-generated file xsm.py.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-08-31 12:12:27 +01:00
kfraser@localhost.localdomain 61c6564d34 Cleanups after XSM checkin.
Signed-off-by: Keir Fraser <keir@xensource.com>

--HG--
rename : xen/include/public/acm.h => xen/include/public/xsm/acm.h
rename : xen/include/public/acm_ops.h => xen/include/public/xsm/acm_ops.h
rename : xen/include/acm/acm_core.h => xen/include/xsm/acm/acm_core.h
rename : xen/include/acm/acm_endian.h => xen/include/xsm/acm/acm_endian.h
rename : xen/include/acm/acm_hooks.h => xen/include/xsm/acm/acm_hooks.h
2007-08-31 12:05:07 +01:00
kfraser@localhost.localdomain 670a6002b9 Xen Security Modules: ACM.
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2007-08-31 11:41:49 +01:00
kfraser@localhost.localdomain d89af62954 Xen Security Modules: Tools.
Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2007-08-31 11:37:20 +01:00
kfraser@localhost.localdomain 4a517de8f6 [ACM/XEND] Fix case where resource label file does not exist.
Fix the case where the resource label file does not exist but its
contents would be needed for access control evaluations.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-30 15:39:13 +01:00
kfraser@localhost.localdomain 40f18cbcf0 xm: Fix error message for xm create command.
When I tested xm create command, I saw the following error message.
I expected an error message "Error: (12, 'Cannot allocate memory')"
because I intentionally caused a memory shortage on the test.
But the error message was different from my expectation.

# xm create /xen/HVMdomain.1
Using config file "/xen/HVMdomain.1".
Error: an integer is required

I looked at xend.log to examine the cause why the error message was
shown.  (Could you see the attached xend.log?)
xend had the error message "Error: (12, 'Cannot allocate memory')"
first.  But xend changed the error message to "Error: an integer is
required" halfway.  I'm not sure about the cause why an exception
occurred in logging processing.  But when I applied an attached patch,
I confirmed that the error message that I expected was shown.  The
patch does not call xc.domain_destroy_hook() if self.domid is None.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-08-28 16:11:05 +01:00
kfraser@localhost.localdomain 81217a7a8d xend: Fix memory ballooning logic during save/restore. Should be same
as during domain creation.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2007-08-28 16:06:32 +01:00
kfraser@localhost.localdomain 145dd4e0fb Fix VNC server after HVM save/restore/migrate, when no vncpasswd specified.
The basic problem was that the "image" section of the sxp had a "None"
in it, which means that on the restore (either on the local machine or
remote machine), the vnc server in the qemu device model literally
needed the string "None" to properly connect.  This simple patch only
puts a vncpasswd entry in the image if it is *not* None in the python
code, thus avoiding the whole issue.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2007-08-28 15:58:46 +01:00
kfraser@localhost.localdomain 8b7f8bce55 xend: Fix vbd detach.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-08-17 10:01:40 +01:00
kfraser@localhost.localdomain 133feccc85 Fix "xm restore" require 4 times amount of memory on ia64.
Signed-off-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp>
2007-08-17 10:00:22 +01:00
kfraser@localhost.localdomain 0af35cef10 xend: Avoid unnecessary writes to xenstore.
Type of rtc/timeoffset is not 'int' but 'str'.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-08-17 09:59:28 +01:00
Tim Deegan 870e806e0d [HVM] [TOOLS] Move device state save earlier in suspend path
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2007-08-13 16:47:11 +01:00
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