Commit Graph
2998 Commits
Author SHA1 Message Date
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
Keir Fraser be8cd315f1 blktap2: Remove set() for Python 2.3
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-07-20 10:08:12 +01:00
Keir Fraser c7b525bb3c xend: Restore scheduling parameters
Scheduling parameters are reset to default values when I restore
or migrate a domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-07-16 10:32:55 +01:00
Keir Fraser 063aa7f823 python: Remove tab indents.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-14 14:43:19 +01:00
Keir Fraser 55eb5c4259 pass-through: use vdevn in xm_pci_attach()
Use vdevfn in xm_pci_attach() for non-zero functions,
the vslot element of dev dictionaries no longer exists.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-14 14:38:56 +01:00
Keir Fraser 51dd9a1427 xend: allow pv_ops kernel driver pci-stub to hide devices for assignment
pciback is used by VT-d to hide device for assigment. But in pv-ops
dom0, pciback is not supported yet. Fortunately, pci-stub module is
used to hide device in Linux for KVM VT-d device assignment and it's
included in pv-ops dom0. So can use pci-stub to hide devices for
assignment.

Device must be hidden before assignment. Control panel has checks if
devices can be assigned or not, and can list assignable devices via
reading devices owned by pciback. This patch changes the checks, and
also list assignable devices which are owned by pci-stub. Use pci-stub
to hide devices, and use this patch to pass checkes in control panel,
device assignemnt with VT-d works on Xen with pv-ops dom0.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-07-06 11:48:44 +01:00
Keir Fraser 26bfb945fc blktap2: fix save/restore/migration
blktap2 devices use a regular 'phy' vbd blkback backend, causing
Blktap2Controller to trample the devices' parameters. This causes
problems with save/restore and managed domains, among other
things. This patch modifies Blktap2Controller to store both the vbd
and tap2 parameters in xenstore, and stops it from trampling the
device's config on device creation.

 * store blktap2 parameters in xenstore
 * restore blktap2 device config to original state once the underlying
 * vbd
   device is created (this fixes managed domains)
 * use blktap2 parameters rather than vbd parameters when building
 * blktap2
   device configurations
 * remove blktap2 specific code from XendConfig

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-07-06 11:47:34 +01:00
Keir Fraser 158299ee06 blktap2: seperate blktap1/blktap2 disk types
* seperate blktap1/blktap2 disk types
 * use blktap1 when driver is not in explicit list of blktap2 drivers,
 * rather than current check against list of blktap1 only drivers
 * remove 'tapdisk' disk type (it is not a tapdisk disk type) and fix
 * tapdisk disk type check in XenConfig

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-07-06 11:47:02 +01:00
Keir Fraser f8128d6e5d xend: Remove disused constants
This patch removes disused constants from XendConstants.py.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-07-02 11:35:30 +01:00
Keir Fraser f6833dff97 xend: fix an undefined name error: mac may be referenced before definition.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2009-07-02 11:34:48 +01:00
Keir Fraser add9e579b6 xend: Restore uname of blktap for managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-07-02 11:32:49 +01:00
Keir Fraser 286423408d blktap2: add blktap2 device class and device controller
blktap2 devices must be handled differently than blktap2
devices. blktap2 devices require a sysfs write to close the underlying
device, as well as extra sysfs writes when the domU is
paused/unpaused. The differences between blktap1 and blktap2 are great
enough to warrant the creation of a new device class, 'tap2', and
device controller for blktap2 devices.

  * add a new device controller (Blktap2Controller) and device class
    (tap2) for blktap2 devices
  * move blktap2 specific code from DevController to Blktap2Controller
  * if possible, check xenstore to determine block device class
  * use vmpath (/vm/<uuid>/) when releasing devices
  * modify linux hotplug cleanup script to handle blktap2 device
    removal

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-07-01 10:53:15 +01:00
Keir Fraser 5a76d5de5c xend: get rid of hardcoded path in xend config file
* Change default settings to relative pathes.
* Make xend to prepend install directory if entries have no absolute
* path

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-30 15:37:14 +01:00
Keir Fraser 4cc88b66d7 xend: pass-through: Implement least-mapping of virtual functions
This is an alternative to identity mapping virtual functions.

It works by assigning the numerically lowest virtual function that is
available.

* The order of assignment is thus dependent on the order that physical
  functions are specified.

  e.g.
  config         physical     virtual
  01.00.0,2  ->  01:00.0  ->  00:07.0
             ->  01:00.2  ->  00:07.1

  is different to

  config         physical     virtual
  01.00.2,0  ->  01:00.2  ->  00:07.0
             ->  01:00.0  ->  00:07.1

* Physical function 0 need not be present

  e.g.
  config         physical     virtual
  01.00.1,2  ->  01:00.1  ->  00:07.0
             ->  01:00.2  ->  00:07.1

* Functions from the same physical multi-function device
  may be exported as multiple multi-function and single-function
  devices

  e.g.
  01.00.0,2  ->  01:00.0  ->  00:07.0
             ->  01:00.2  ->  00:07.1
  and
  01.00.1,3  ->  01:00.1  ->  00:08.1
             ->  01:00.3  ->  00:08.1
  and
  01.00.5    ->  01:00.5  ->  00:09.0

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 10:01:20 +01:00
Keir Fraser e22b1a81b3 xend: pass-through: rename vslot to vdevfn and vslots to vdevfns
This is a noisy patch that makes not functional changes.
It renames vslot to vdevfn and vslots to vdevfns.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 10:00:24 +01:00
Keir Fraser 82334d45f3 xend: pass-through: Parse command line for multi-function hot-plug and unplug
Hook things up to allow multi-function pass-through.

This includes making sure that request is valid.
In the case of pci-detach:

* All the functions requested must be attached to the same virtual
  slot * and;
* A request must include the functions attached to a virtual slot

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:56:15 +01:00
Keir Fraser 437cbbf3fb xend: pass-through: Add key to pci device dictionary
This will be used to identify the functions belonging to
a multi-function device.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:55:42 +01:00
Keir Fraser 88b7aa5e4c xend: pass-through: Add pci_dict_bin_to_str()
Break out the device list gathering code from xm_pci_list()
so that it can be re-used by subsequent changes.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:54:54 +01:00
Keir Fraser 7fd42f5b88 xend: pass-through: Only tell qemu-xen to unplug function 0
When unplugging a function, all functions in the same vslot must be
unplugged, and function 0 must be one of the functions present when a
vslot is hot-plugged. Telling qemu-dm to unplug function 0 also tells
it to unplug all other functions in the same vslot.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:54:29 +01:00
Keir Fraser 2327a50d23 xend: pass-through: Allow multi-function device specifications to be parsed
The general format is as follows:

  Now: SEQ:BUS:DEV.FUNC[@VSLOT][,OPT...]
  New: SEQ:BUS:DEV.FUNC0-FUNCN[@VSLOT][,OPT...]
       SEQ:BUS:DEV.FUNC0,FUNCM,FUNCN[@VSLOT][,OPT...]
       SEQ:BUS:DEV.*[@VSLOT][,OPT...]

  In the case of unplug the VSLOT and OPT must be omitted.

  Xm expands this notation notation out and passes
  more conventional parameters to qemu-xen.

  E.g:
       0000:00:01.00-03 becomes:
         0000:00:01.00
         0000:00:01.01
         0000:00:01.02
         0000:00:01.03

       0000:00:01.00,03,05,07 becomes:
         0000:00:01.00
         0000:00:01.03
         0000:00:01.05
         0000:00:01.07

       For a device that has functions 0, 1, 2, 3, 5 and 7,
       0000:00:01.* becomes:
         0000:00:01.00
         0000:00:01.01
         0000:00:01.02
         0000:00:01.03
         0000:00:01.05
         0000:00:01.07

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:53:56 +01:00
Keir Fraser 55d9f87d5c xend: pass-through: use devfn instead of slots as the unit for pass-through
Instead of suppling a slot number to qemu-xen, supply a devfn.

This and subsequent other changes will allow xend to ask
for more than one function to be inserted into a single slot -
by specifying which function of the slot should be used.

This is a minimal patch for this change. A subsequent
patch that has a lot of noise to rename slot to devfn
is intended to follow.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-27 09:51:37 +01:00
Keir Fraser d7e7ef6859 tools: fix inverted logic check
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-25 13:15:32 +01:00
Keir Fraser ed072758a7 tools: remove hard coded paths in example config files
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-24 11:17:11 +01:00
Keir Fraser e5654d4fbf xend: Fix vbd/tapdisk device destruction
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-24 11:14:32 +01:00
Keir Fraser 01dc757ea3 xend: Fix python syntax error
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-23 17:27:01 +01:00
Keir Fraser 157794e512 tools python: remove unused auxbin functions
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-23 17:26:28 +01:00
Keir Fraser a2b4af7d77 Get rid of hardcoded pathes for stubdom and hotplug scripts
- Have the buid system generate a file which exports the install paths
   for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
   macro
  in Config.mk to avoid maintenance of three duplicates each with its
   own
  tweaks and bugs
- Export gmake variables into ioemu as shell variables
  for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
  install directory
- Adjust stubdom-dm to use the install directories

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-23 17:25:51 +01:00
Keir Fraser dcf18dfcc4 tools: don't require hardcoded firmware path in guest config file
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-06-23 11:23:27 +01:00
Keir Fraser 7aeb062fbc xend: Fix tapdisk creation for managed domains
The first start of a managed domain succeeds.  But the second
start of the managed domain fails as follows.  The problem occurs
when tapdisks are given to the managed domain.  I think that the
problem occurs because the uname of tapdisks is overwritten with
"phy:/dev/xen/tadisk-2/tapdev*".

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-23 11:20:10 +01:00
Keir Fraser 717626c9a5 tools: consistently use $(PYTHON)
Signed-off-by: Christoph Egger <Christoph. Egger@amd.com>
2009-06-23 11:13:29 +01:00
Keir Fraser faefc018df xend: fix a regression in c/s 19791.
Using changeset 19791:c0d2838fc10f, I can't create an HVM.
xend.log shows:

  File "usr/lib64/python2.4/site-packages/xen/xend/image.py", line
  759, in configure
    store_dmargs.remove('-sdl')
ValueError: list.remove(x): x not in list

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-06-19 08:44:33 +01:00
Keir Fraser 36553c2859 xend: fix BlktapController's device creation
Reset BlktapController's device class back to 'tap' once the device
has been created. This fixes save/restore for VMs with blktap2 disks.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
2009-06-19 08:43:28 +01:00