Commit Graph
2414 Commits
Author SHA1 Message Date
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
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