Commit Graph
2968 Commits
Author SHA1 Message Date
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
Keir Fraser 590b3ce1d3 blktap: re-enable blktap1 if blktap2 is disabled
This patch re-enables a useful blktap1 for users who disable blktap2.
Itremoves tapdisk and blktapctrl from blktap2, both of which cause
problems with blktap operation.  In addition, this patch modifies xend
to check for blktap2 installation.  If the blktap2 driver isn't
running (hopefully because the dom0 kernel option wasn't selected) we
fall back to blktap.

Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
2009-06-18 10:29:58 +01:00
Keir Fraser 6c11039cbd xend: Improve error messages of xm sched-credit
This patch improves error messages of xm sched-credit as with error
messages of CS:19468.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-18 10:27:21 +01:00
Keir Fraser fa97833ae1 Allow tools to see the hypervisor command line.
This is useful from tools in the same way /proc/cmdline is useful for
the domain 0 kernel.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-06-18 10:20:45 +01:00
Keir Fraser d914b94a3f stubdoms: qemu monitor support
Add support for the qemu monitor in a stubdom, the same way the
emulated serial support was added few days ago.  The stubdom exports
the monitor as a pty and minios opens a console frontend; qemu in dom0
provides the correspondent backend for this additional pv console that
happens to be the qemu monitor.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-18 10:20:17 +01:00
Keir Fraser b250b06ee4 xend: pci: find_parent: should return string rather than int
Using changeset 19783: 61ec78692b13, device assignment can't work:
e.g., in find_the_uppermost_pci_bridge(),
 parent = dev_parent.find_parent()
...
 dev_parent = PciDevice(parent),
we can see parent['domain'] is int and in PciDevice's __init__,
int(dev['domain'], 16) would fail:
TypeError: int() can't convert non-string with explicit base

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-06-18 10:18:10 +01:00
Keir Fraser 99951f1845 xend: pass-through: Clean up hvm_destroyPCIDevice()
There seems to be little need to use the domain, bus, slot and
function to look up the virtual slot to pass as the argument to
hvm_destroyPCIDevice(), only to have hvm_destroyPCIDevice() use the
virtual slot for the sole purpose of looking up the domain, bus, slot
and function.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:39:27 +01:00
Keir Fraser 97fbb6346a xend: pass-through: Use common parsing code in getDeviceConfiguration()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:39:03 +01:00
Keir Fraser a96eef5ee3 xend: pass-through: Use common parsing code in parse_pci_configuration()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:38:42 +01:00
Keir Fraser fc1e96389c xend: pass-through: Add pci_tuple_to_dict()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:38:03 +01:00
Keir Fraser 63524b0e43 xend: pass-through: Use generic code in pci_opts_list_to_sxp()
Use dev_dict_to_sxp() inside pci_opts_list_to_sxp() now that it is
available.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:37:26 +01:00
Keir Fraser ce004c4b0f xend: pass-through: Move pci conversion functions to pci.py
Move dev_dict_to_sxp() into XendSXPDev.py.  Move
pci_convert_dict_to_sxp() and pci_convert_sxp_to_dict() to pci.py,
where other similar functions live.  This makes these functions
accessible outside of the XendConfig class.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:36:47 +01:00
Keir Fraser 29baf765df Subject: xend: pass-through: Add pci_dict_cmp()
pci_dict_cmp() compares the two pci devices in dict format.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:35:51 +01:00
Keir Fraser 5a6a2f7e9b xend: pass-through: Common parse_pci_name()
Share some parsing code between different parts of xm.

This has the side-effect that the device specification for
hot-plug may now include the VSLOT and OPTS as per device
specifictions in the domain configuration file.

  SEQ:BUS:DEV.FUNC[,OPT...]

  e.g. 0000:00:01.00@6

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-17 07:34:59 +01:00
Keir Fraser 9ed6a7c5dd xend: support for older pciutils without -vmm option, and improve
error handling in get_info_from_lspci().

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2009-06-16 11:53:47 +01:00
Keir Fraser afd4c19a15 xend: pass-through: Use common parsing code in preprocess_pci()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:41:31 +01:00
Keir Fraser bf17cf4c4c xend: pass-through: Use PCIDevice as the parameter for the constructor for PCIQuirk
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:39:02 +01:00
Keir Fraser 6c4c01bd43 xend: pass-through: Remove PciDeviceNotFoundError, it is never used
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:38:33 +01:00
Keir Fraser 52ecedb262 xend: pass-through: sxp.merge() cant deal with values being a list
sxp.merge() can't deal with values being a list so instead
of storing pci options as:

[ 'opts', [ 'key1' 'value1'], [ 'key2', 'value2'], ...]

store them as:

[ 'opts', [ 'key1' 'value1'], ['opts', [ 'key2', 'value2']], ...

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:37:41 +01:00
Keir Fraser fb8a264cd0 xend: pass-through: cleanupDevice: move and remove recently added vslot entry
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:36:40 +01:00
Keir Fraser 005f6dc9a8 xend: pass-through: tidy up PciController()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:36:03 +01:00
Keir Fraser e5c65dc72e xend: pass-through: fix typo: spx -> sxp
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:35:16 +01:00
Keir Fraser 678e6d8b30 xend: pass-through: Only call setupOneDevice() once per device
As observed by Dexuan Cui, when PCI devices are passed through at
domain-creation-time setupOneDevice() will be called twice.

Once via setupDevice() and once via econfigureDevice() which
is called in pci_device_configure().

This patch removes the first of these.

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-16 11:33:23 +01:00
Keir Fraser 7e03843de6 xend: support multiple consoles per domain
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-16 11:25:37 +01:00
Keir Fraser c811d0d548 xenconsole: support for multiple consoles per domain
This patch adds a new command line argument to xenconsole to specify
to which console to connect to in case a domain has more than one.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-16 11:24:58 +01:00
Keir Fraser 51e4a7555d xend: allow config file compatibility with new tap syntax
Recently the format of the tap syntax in the config file changed to
using a 4 part specifier (tap:tapdisk:<format>:<filename>) instead
of the old 3-part one (tap:<qcow>:<filename>).
This breaks compatibility with existing config files: a guest start
will throw a Python exception and will be aborted.
AFAICS currently tap:tapdisk is redundant, so the attached patch
simply catches the above mentioned exception and tries to parse the
old format in this case.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-06-16 11:00:29 +01:00
Keir Fraser 3e71ff4418 xend: Show "bootable" information only once in 'xm list --long'
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-16 10:55:36 +01:00
Keir Fraser 54c07de022 xend: pci: fix extract_the_exact_pci_names()
Changeset 19726: d8b7b51f482b neglects the case pci_names could be
types.ListType.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-06-08 12:24:14 +01:00
Keir Fraser 532f0ae513 xend: Convert the type of superpages to integer to fix a TypeError.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-05 09:30:36 +01:00
Keir Fraser 57d9503643 xm: Remove redundant os.waitpid() call from do_console()
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-06-04 10:57:39 +01:00
Keir Fraser e6e2645a53 xend: pci: only extract the exact pci BDFs
On some hosts:
[root@localhost ~]# ls /sys/bus/pci/devices/0000:00:05.0/
0000:00:05.0:pcie00  0000:05:00.0          class   driver  local_cpus
resource          subsystem_vendor
0000:00:05.0:pcie01  broken_parity_status  config  enable  modalias
subsystem         uevent
0000:00:05.0:pcie02  bus                   device  irq     power
subsystem_device  vendor

Here we should only get 0000:05:00.0, but we also get 0000:00:05.0
unexpectedly. With this patch, xend only extracts the exact BDF(s).

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-06-04 10:47:56 +01:00