Commit Graph
3229 Commits
Author SHA1 Message Date
Keir Fraser a358be0b0f xend: Revert c/s 17536 which breaks PV passthru of MSI-X devices.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-09-07 08:48:12 +01:00
Keir Fraser 345fbe6cb4 xend: passthrough: fix physdev_map_pirq invocation
For those devices not having INTx (like VFs), avoid calling map_pirq,
otherwise the guest cannot be started successfully.

Also avoid calling this hypercall for hvm guest, this is done in the
device model.

Signed-off-by: Qing He <qing.he@intel.com>
2009-09-07 08:38:39 +01:00
Keir Fraser e4e14402c1 xend: Support "bootloader" mode for "drbd:" devices
To be able to use "bootloader" on drbd devices the following changes
need to be made:

*) Translation of devicename

_parse_uname which is used by blkdev_uname_to_file which is again used
by _configureBootloader in XendDomainInfo needs to be able to resolve
drbd resources to the corresponding blockdevice to feed to the
configured bootloader.

*) Activation of drbd device

If the drbd device isn't in Primary mode when the bootloader tries to
fetch the kernel and initrd, the start of the DomU will fail. To
prevent this the given drbd device will be made Primary before the
bootloader gets executed.

A note on the naming of drbd resouces: drbd uses mostly resource names
in it's userland tools. Because of that drbd VBDs, if configured with
the "drbd:" type, should always use the drbd resource name as
suggested by the drbd documentation at
http://www.drbd.org/users-guide-emb/s-xen-configure-domu.html. My
patches assume that the VBDs are named accordingly.

Signed-off-by: Michael Renner <michael.renner@geizhals.at>
2009-09-04 08:42:10 +01:00
Keir Fraser 35c865110a xend: fix domain_migrate
When the guest(pv-on-hvm guest that cannot suspend) reboot in
LiveMigration, the disconnecting of src-side is not transmitted to
dist-side. As a result, the error processing on the dist side is not
executed.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-09-04 08:34:45 +01:00
Keir Fraser 4dd7eb9f09 xm: Add "tap2" to attach blocktap disks to VM
I detected a problem when using XenAPI.  When I started a VM by
using xm create command, blocktap disks were not attached to the
VM.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-09-03 09:49:41 +01:00
Keir Fraser 7e3088ca7f xm: Make cpu_{cap|weight} available when using XenAPI
Currently, cpu_weight parameter and cpu_cap parameter in domain=20
configuration files are ignored when using XenAPI.
The parameters are available by this patch.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-09-02 11:39:27 +01:00
Keir Fraser 049607ff33 x86 passthru:: graphics passthrough
This patch supports basic gfx passthrough on xen side:
  - add a VGA type for gfx passthrough, and get the size of VGA bios
  of passthrouged gfx in hvmloader
  - add a config option 'gfx_passthru' for gfx passthrough

Signed-off-by: Ben Lin <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-09-01 11:36:16 +01:00
Keir Fraser 18e7740068 xend: Fix c/s 20137 -- do not redefine built-in name 'str'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-31 18:17:26 +01:00
Keir Fraser bf6b9756fa xend: Greater verbosity on domain creation failure
Attached patch makes error reporting more verbose when
xc.domain_create() fails or raises an Exception.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-08-31 10:12:10 +01:00
Keir Fraser 7a530cd968 xend: Do not pass pointer to a 16-bit domid_t to PyArg_ParseTuple()
when it expects a full integer.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-26 15:41:59 +01:00
Keir Fraser c50b989b44 xend: Flask MLS security label handling
Changed the way security labels are handled to allow domains to be
labeled with Flask MLS security labels.  Changed the error message
generated when an invalid context is submitted to be more useful.

Signed-off-by: Machon B. Gregory <mbgrego@tycho.ncsc.mil>
Signed-off-by: George S. Coker, II <gscoker@alpha.ncsc.mil>
2009-08-26 15:35:14 +01:00
Keir Fraser c4651bd31d xend: Fix typos in configure_vtpm
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-08-25 14:59:09 +01:00
Keir Fraser 1b14383998 xend: Add support for URI ('file:' and 'data:' scheme) for PV/kernel
and PV/ramdisk

Add support for 'file:' and 'data:' URI schemes for the parameters
'PV/kernel' and 'PV/ramdisk' in the VM.create() call. The 'data:'
scheme handling enables using a file which is stored inside the
management system (from where the XenAPI call is send) as kernel or
ramdisk.

Notes:
o all included: a detailed description can be found in the xenapi
documentation
o bumped up the version of the API document to 1.0.8 (because of
(minimal) interface extension)
o Future enhancements (like http:, ftp: schemes) fit seamlessly into
the current design / classes
o Unittest cases and xm-test case included

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-25 14:56:54 +01:00
Keir Fraser 2ac9ced4cb xend: Allow vtpm instance uuid to be specified on domain creation
Right now xen will create a new vtpm instance everytime you start up a
domU, even if you specify the instance parameter in your config file.
Each vtpm instance is then given a uuid and the vtpm.db file maps
instance numbers to uuid numbers.

This patch is a hack that lets you explicitly set the uuid of your
vtpm instance. Everytime you boot up your domU now the vtpm will get
that uuid and thus it will always get the same vtpm instance number
instead of being generated a new one.

So for example, in your config file you would do something like this
vtpm = [ 'backend=0,uuid=dcdb124b-9fed-4040-b149-dd2dfd8d094c' ]

Signed-off-by: Matt Fioravante <Matthew.Fioravante@jhuapl.edu>
2009-08-24 08:05:46 +01:00
Keir Fraser f0321cbffa Fix xapi xm-tests.
There were a couple of small bugs in the xapi xm-test:
o outdated XenAPI calls were removed from testcase
  (02_xapi-vbd_basic)
o minor problem with XendLocalStorageRepository
  is fixed (missed list_images() function - which
  is moved from the XenQCoWStroageRepo to the common
  base class XendStorageRepository)
  which was detected running 02_xapi-vbd_basic.
o XenAPI session handling and connecting is fixed.
o 03_xapi-network_pos was rewritten and now uses
  XenAPI.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-20 10:30:53 +01:00
Keir Fraser 89164e3f7b xend: Fix error caused by VT-d ACS patch.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2009-08-20 08:25:41 +01:00
Keir Fraser 39b4fc5972 xend: passthrough: check if a device is behind PCIe switch that lacks ACS
Imagine a PCIe switch, which doesn't support ACS (Access Control
Services), has 2 downstream ports: A and B, according to PCIe spec,
the PCIe switch should directly route the transaction that is from A
and to a device under B -- the Root Complex and IOMMU engine are
bypassed -- this doesn't work at all in the case of hvm guest and can
even incur potential security issue, so we should not allow such kind
of device assignment.

If all the intermediate PCIe swiches between a device and Root Complex
support and enable ACS, we can safely asssign the device to guest.

Cc: Allen Kay <allen.m.kay@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-19 13:12:16 +01:00
Keir Fraser 276e535eba xm,xend: Remove tab indents
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-08-19 12:55:15 +01:00
Keir Fraser c3fcb0fd91 Revert 20066:135b350496fb 2009-08-16 08:43:50 +01:00
Keir Fraser 2ca1b6fff7 xend: VBD QoS policy bits
Add the ability to define VBD QoS policy in the xend layer.

Consider the following vbd entry:

vbd = [
   'phy:/dev/server/virtualmachine1-disk,xvda1,w,credit=3D5000/s@50ms',
]

This means that a VM may perform 5000 I/O operations per second, with
credit being replenished every 50 milliseconds.

The 'credit' xenstore value is by the blkback driver to ratelimit I/O
operations for the specific device.

Signed-off-by: William Pitcock <nenolod@dereferenced.org>
2009-08-14 17:10:11 +01:00
Keir Fraser 81d70f1a53 tmem: expose freeable memory
Expose tmem "freeable" memory for use by management tools.

Management tools looking for a machine with available
memory often look at free_memory to determine if there
is enough physical memory to house a new or migrating
guest.  Since tmem absorbs much or all free memory,
and since "ephemeral" tmem memory can be synchronously
freed, management tools need more data -- not only how
much memory is "free" but also how much memory is
"freeable" by tmem if tmem is told (via an already
existing tmem hypercall) to relinquish freeable memory.
This patch provides that extra piece of data (in MB).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-08-10 13:27:54 +01:00
Keir Fraser 22d91502ea xend: Rename device backend value when xm save/migrate
The Xend has a problem that it often fails to restore/migrate
a PV domain whose device backends are partly a driver domain.

Because a checkpoint of the PV domain has device backend value as
domain id, you can restore/migrate the PV domain only when a driver
domain is the same id as device backend value in the checkpoint.

I attached a patch to fix it by renaming device backend value in a
checkpoint from domain id to domain name when xm save/migrate.

This patch doesn't rename device backend value if the value is 0,
which is Domain-0, so the checkpoint format is compatible if you use
only Domain-0 as device backend.

Signed-off-by: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>
2009-08-07 17:22:04 +01:00
Keir Fraser 734a7f6677 tmem: save/restore/migrate/livemigrate and shared pool authentication
Attached patch implements save/restore/migration/livemigration
for transcendent memory ("tmem").  Without this patch, domains
using tmem may in some cases lose data when doing save/restore
or migrate/livemigrate.  Also included in this patch is
support for a new (privileged) hypercall for authorizing
domains to share pools; this provides the foundation to
accomodate upstream linux requests for security for shared
pools.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-08-06 09:19:55 +01:00
Keir Fraser 3c11d89e35 Revert 20006:edf21ab7d7a4 and 20023:2b28320c6f8c. 2009-08-05 14:56:29 +01:00
Keir Fraser 41f4eefa05 xend: Remove _setSchedParams
Currently, xc.sched_credit_domain_set is called twice when domains
are created.

start@XendDomainInfo
  _constructDomain
    xc.sched_credit_domain_set  --- 1st
  _initDomain
    _setSchedParams
      domain_sched_credit_set
        xc.sched_credit_domain_set  --- 2nd

resume@XendDomainInfo
  _constructDomain
    xc.sched_credit_domain_set  --- 1st
  _setSchedParams
    domain_sched_credit_set
      xc.sched_credit_domain_set  --- 2nd

This patch removes _setSchedParams method added by changeset 19955,
because xc.sched_credit_domain_set was added into _constructDomain
method by changeset 20006.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-08-05 14:03:38 +01:00
Keir Fraser f275a935a2 xend: fix memory leak resulting in long garbage collector runs
In the method xen.xend.XendStateStore.XendStateStore.load_state and
xen.xend.XendStateStore.XendStateStore.save_state the minidom objects
used to load/save the current state of a device type, can't be freed
by the python garbage collector after all references to the top node
are cleared, because of cyclic references between the DOM nodes. So
memory usage of xend increases after calling these methods.  To solve
this problem, the unlink() method must be called for a minidom object
before the last reference to the top node is cleared (see python
docs). This breaks the cyclic references, so the garbage collector can
free these objects.

Signed-off-by: juergen.gross@ts.fujitsu.com
2009-08-05 12:04:39 +01:00
Keir Fraser ce09aeeba7 xend: pass-through: Extend multi-function mapping
This extends the mapping between physical and virtual PCI functions
for multi-function pass-through in two ways. If neither of these
rules apply the existing identity-mapping of physical to virtual
functions is used.

1) If physical function zero is not present in a multi-function
   pass-through device then the numerically lowest physical function
   whose virtual function hasn't explicitly been set will be mapped
   to virtual function 0.

   This is to satisfy the requirement that a (virtual) device
   must always have function 0 present.

2) The virtual function to be used for a physical function may
   be explicitly set.

   e.g. 00:1d.2=3D0,1=3D1,0=3D2@7 will result in the following
   mapping:

        physical | virtual
        ---------+--------
        00:1d.2  | 00:07.0
        00:1d.1  | 00:07.1
        00:1d.0  | 00:07.2

   Ranges may also be used with explicit assignment.
   The following would result in the same mapping as above:

       00:1d.2=3D0-0=3D2@7

Please be aware that it is very likely that using these extensions
it is possible to create mappings that do not work. If in doubt
please use identity-mapping.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-08-05 12:03:53 +01:00
Keir Fraser bc60687a50 xend: passthrough: add checking when a device is hotplugged into pv guest.
When we 'xm pci-attach' device into pv guest, we also need to check if
the device is owned by pciback or pci-stub, if the device has been
assigned, etc.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-05 12:03:08 +01:00
Keir Fraser 18a76bf453 xend: pci: Use PCIe FLR for VF of Intel 82599 10GbE Controller
We know it does have PCIe FLR capability even if it doesn't report
that.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-02 12:28:22 +01:00
Keir Fraser 2cdf870d54 xend: passthrough: loosen the pci co-assignment for pv guest
In current xend, we can not assign co-assignment devices to different
guests, even for pv guests. This patch loosens the policy for pv
guest: if none of the co-assignment devices have been assigned to hvm
guest, we can assign the devices to different pv guests.

The patch also adds a detection: if a device has been assigned to
guest, we can't try to "xm pci-attach" it to the same guest again.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-02 12:27:51 +01:00
Keir Fraser 2707e9adc1 xend: save/restore cpu_weight and cpu_cap
This patch allows vcpus_params cpu_weight and cpu_cap to be saved and
restored.  Most the code to support this already existed, but the save
path needed to be updated to explicitly save these params, and the
restore path needed to be updated to resend the params down to the
kernel.

From: Andrew Jones <drjones@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-02 12:26:23 +01:00
Keir Fraser d0c233bbf8 xend: pci: fix a typo in do_Dstate_transition
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-29 09:19:30 +01:00
Keir Fraser d1c98f05a1 xend: pass-through Use pci_dict_to_bdf_str() in hvm_pci_device_create()
* Use pci_dict_to_bdf_str() in hvm_pci_device_create()
* Use pci_name instead of pci_str in error message, pci_str does not
* exist

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-29 09:19:13 +01:00
Keir Fraser 00f0eadc52 xend: make a crash dump directory per DomU
Currently, xend dumps a core file of a DomU
in the directory "/var/xen/dump/", when the DomU has crashed.

The patch modifies this directory to "/var/xen/dump/<domain name>/".

It enables you to select HDD partition per DomU to dump core by using
mount command.

Signed-off-by: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>
2009-07-28 16:43:50 +01:00
Keir Fraser fb4a420c9b xend: pass-through: fix "xm pci-list-assignable-devices' for pv_guest
xc.test_assign_device(dev) can only tell us if dev is assigned to hvm
guest; if a device is assigned to pv guest, xc.test_assign_device()
still tells us the device is not assigned yet, as a result, the device
still appears in the output of "xm pci-list-assignable-devices", and
xend would not prevent us from assigning the device to a new pv or hvm
guest.

To judge if a device has been assigned to guest, we have to scan
xenstore.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-28 16:42:12 +01:00
Keir Fraser 0a8f3082f6 xend: pass-through: fix pci passthrough for pv guest
C/S 19754: a5f584c1e2f6 breaks pci passthrough for pv guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-28 16:41:13 +01:00
Keir Fraser 54b4e4c5df xend: fix migration hangs by closing fds on exec
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Reviewed-by: Xiaowei Hu <xiaowei.hu@oracle.com>
2009-07-28 16:33:46 +01:00
Keir Fraser dd512dd1e2 xend: pass-through: device state in xenstore may be null
Signed-off-by: Tom Rotenberg <tom.rotenberg@gmail.com>
2009-07-28 16:32:26 +01:00
Keir Fraser 2c701424fd xend: pass-through: Use parse_pci_name() in find_parent()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-28 16:16:32 +01:00
Keir Fraser c391d9bd06 Revert 19961: breaks xend start on some systems.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-24 12:08:54 +01:00
Keir Fraser d714f7b5af xend: Fix use of set() for Python 2.3.
From: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-24 10:39:43 +01:00
Keir Fraser 200ca5d25f python: make tools/python/xen/util/fileuri.py work on python 2.3
@staticmethod syntax sugar was introduced at python2.4.
expand the syntax sugar for python 2.3

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-07-23 09:01:30 +01:00
Keir Fraser 3aa462c629 xend: Don't call decode() if PV_{kernel,ramdisk} are ''
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-07-23 09:00:21 +01:00
Keir Fraser 7901a462fd xend: Set up CPUID leaves on restore for both PV and HVM guests.
From: Andrew Thomas <andrew.thomas@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-23 08:59:03 +01:00
Keir Fraser e9b46d3b23 xend: pass-through: use identity-mapping of PCI functions
This reverses changeset "xend: pass-through: Implement least-mapping
of virtual" (19854:22067ba1de0d) and reverts the code to identity
mapping physical PCI functions to virtual ones when multi-function
virtual devices are in use. It is my opinion that this is both safer
and simpler than least-mapping, and that in the absence of further
analysis identity-mapping the best choice for now.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-22 14:05:26 +01:00
Keir Fraser 35915118e3 tools: implement balloon stat and cpuinfo for NetBSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-22 14:04:14 +01:00
Keir Fraser 03c274f00c xend: pass-through: fix regression in the ordering of the output of xm pci list
changeset "python: Remove tab indents" (19937:e845326ae203)
introduces a minor regression in the multi-function PCI pass-through
code by causing bogus return values from the sort function
which is used to order the output of "xm pci list".

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-21 14:26:52 +01:00
Keir Fraser 5301fe9943 libxenguest: Revert domain builder interface changes for 'superpages'
parameter, and place the flag in a pad byte of 'struct xc_dom_image'
instead.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-20 15:45:50 +01:00
Keir Fraser 787d3b69de xend: Add support for URI ('file:' and 'data:' scheme) for PV/kernel and PV/ramdisk
Add support for 'file:' and 'data:' URI schemes for the parameters
'PV/kernel' and 'PV/ramdisk' in the VM.create() call.  The 'data:'
scheme handling enables using a file which is stored inside the
management system (from where the XenAPI call is send) as kernel or
ramdisk.

Notes:
o all included: a detailed description can be found in the xenapi
documentation
o bumped up the version of the API document to 1.0.8 (because of
(minimal) interface extension)
o Future enhancements (like http:, ftp: schemes) fit seamlessly into
the current design / classes

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-07-20 10:12:38 +01:00
Keir Fraser bd9dfffdcb xend: modify sort() for Python 2.3
Python 2.3 does not support the sort(cmp, key, reverse) style.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-07-20 10:09:00 +01:00