Commit Graph
2920 Commits
Author SHA1 Message Date
Keir Fraser 8fe9e65cb4 xend: Fixes after backend xenstore config changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-01 14:07:17 +01:00
Keir Fraser e9f884ceda xend: Move some backend configuration info.
This patch moves some dom0 variables and backend device
configuration from frontend directories to
/local/domain/<backdomid>/backend or /vm.

Also,
- /vm_path/<domid> is introduced, referencing the /vm path
- /vm_path/device/backend holds the backend device location,
  rather than storing it in the frontend directory

Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-01 13:35:39 +01:00
Keir Fraser 3ff1f0088a hvm: Default timer_mode=1 (do not delay virtual time for missed
ticks). Most guests prefer this mode compared with screwing with
progress of virtual time.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-26 17:09:36 +01:00
Keir Fraser 0ae658ea9f xm: Fix xm start -c / --vncviewer
In xm start the --vncviewer option has no effect, instead -c tries to
both connect to the console and start vncviewer. Additionally, to
start vncviewer it uses the domid variable which is only defined a few
lines later. Thus xm start -c doesn't work at all.

This patch fixes both problems.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2008-09-25 13:07:43 +01:00
Keir Fraser 0e7c1355bc acm, xend: Catch bad vlan identifiers
Add code to intercept badly formatted VLAN identifiers or
those that are out of range.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-23 12:30:42 +01:00
Keir Fraser 11825aea19 xend: Refactor vmmetrics destruction.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-09-22 11:15:39 +01:00
Keir Fraser bbc10fbb40 xm list: Return unique exit code for non-existent domain
This patch will make xm return a exit code of 3 if `xm list
<non_existant_domain>` is done rather than the generic code of 1.  I
used 3 because XendClient had a macro setup pointing
ERROR_INVALID_DOMAIN to 3.

From: "Shaun R." <mailinglists@unix-scripts.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-18 10:41:41 +01:00
Keir Fraser 5c4eccd644 xm: Remove obsolete mechanism using vncviewer -listen
Without this patch, vncviewer processes remain as follows.
This patch fixes it.

> # pgrep -fl vnc
> 4303 vncviewer -log *:stdout:0 -listen 5501
> 5089 vncviewer -log *:stdout:0 -listen 5502
> 5763 vncviewer -log *:stdout:0 -listen 5503

details:
Since 21dd1fdb73d8 there have been (as far as I can see) three
separate mechanisms for achieving a VNC display:
 1. xm spawns vncviewer after getting vnc display info
     from qemu-dm via xenstore  (introduced in 21dd1fdb73d8)
 2. xm spawns vncviewer -listen and qemu-dm connects to it
 3. qemu-dm spawns vncviewer (!)

The latter two are rather strange - No.3 is very strange indeed.
So I decided that rather than try to get No.2 or No.3 on track for
going into qemu upstream, No.2 and No.3 would be dropped.
After discussion on xen-devel the mechanism No.1 was introduced,
above.

No.1 is controlled by the --spawn-vncviewer (and --vncviewer-autopass)
command line options to xm, by analogy with the -c option.

Nos.2 and 3 are controlled by elements of the domain configuration
file - and their code still remains.  So if you turn all of the vnc
options on you can get several vncviewers (although only one of them
will work).

This patch removes the support for the passive connection mode No.2
After all ioemu-remote will never connect to such a vncviewer.
The options to engage this functionality were already removed from
the example config files by Keir in 18241:bf4ef45e6a38.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-09-17 13:11:40 +01:00
Keir Fraser 6266fa7f24 xsm: dummy module - implement missing stub
- This minor patch implements the missing stub function
security_label_to_details in the dummy module.  This stub function is
necessary to create domains with network interfaces for modules that
do not implement the security_label_to_details function.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-15 11:36:20 +01:00
Keir Fraser a3e1f638ca xm: domid casting bug
- This patch fixes a small casting bug in xm.  The value of domid was
  not returned as an int, causing commands like 'xm vncviewer domid'
  to fail.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-11 11:58:08 +01:00
Keir Fraser 4b4f92e98d x86, xend: Fix processing of cpuid config parameters
There is an python indentation issue keeping the full range of syntax
for the cpuid config file parameter from working correctly.  This
patch fixes that.  It also fixes some misspelling and a missing 'x' in
two of the example config files (must have 32 bits represented for
cpuid registers).

Signed-off-by: Bruce Rogers <brogers@novell.com>
2008-09-10 10:51:48 +01:00
Keir Fraser a69a857adb Revert 18415:3e72ab517e44 (xend: move the call to XendDevices.destroy_device_state())
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-09 14:45:23 +01:00
Keir Fraser 8790685cfd xsm: A few hacks to get XSM-disabled (aka dummy) mode working.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 16:29:38 +01:00
Keir Fraser 1df7998ba6 xsm: Fix __import__() usage on Python 2.4 and earlier.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-09-04 11:55:48 +01:00
Keir Fraser 06cfe5df7b xsm, python tools: remove autogenerated xsm.py
- The patch does away with the autogenerated xsm.py file and
introduces a config parameter in xend-config.sxp to determine the
security module. The parameter is (xsm_module_name {acm, dummy,
flask}).  The default setting/option is dummy.  .hgignore is also
updated to stop ignoring xsm.py on commits.

- The patch has created an xsconstant for XS_POLICY_FLASK and updated
  the toolchain to check the instance of XS_POLICY_USE.  XS_POLICY_USE
  evalauates to XS_POLICY_FLASK or XS_POLICY_ACM or XS_POLICY_DUMMY
  depending on configuration.

- Flask relies on the current value of ssidref returned by dominfo to
  ensure that the label to sid mapping is consistent.  ssidref had
  been pop'ed from the dominfo object.  The patch addresses this
  issue.

- Flask python module style cleanups.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
2008-09-04 11:23:08 +01:00
Keir Fraser 87fd15ceee xend: move the call to XendDevices.destroy_device_state()
This patch moves the call to XendDevices.destroy_device_state() to the
function _remove_domain. Previously only Xen-API calls were calling
the destroy_device_state() function.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-09-03 10:38:33 +01:00
Keir Fraser c93d35a368 xend: Fix Bug 1336
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-09-02 12:06:56 +01:00
Keir Fraser 309af15419 xend: Cleanup destroy and destroyDomain methods
When domains are destroyed, _prepare_phantom_paths() method
and _cleanup_phantom_devs() method are called twice as follows.

destroy()@XendDomainInfo.py
    _prepare_phantom_paths() --------------- 1
    _cleanupVm()
    destroyDomain()
        _prepare_phantom_paths() ----------- 2
        xc.domain_destroy_hook()
        xc.domain_pause()
        do_FLR()
        xc.domain_destroy()
        XendDomain.remove_domain()
        cleanupDomain()
        _cleanup_phantom_devs() ------------ 1
    _cleanup_phantom_devs() ---------------- 2
    XendDomain.domain_delete_by_dominfo()

This is a cleanup patch.  It combines destroyDomain() method
into destroy() method, then _prepare_phantom_paths() method and
_cleanup_phantom_devs() method are called only once.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-28 09:44:13 +01:00
Keir Fraser 2f43a7baa9 xend: fix LinuxImageHandler debugging output
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:47:08 +01:00
Keir Fraser 43e1fddd0c vtd: do FLR before xc.domain_destroy()
When we "xm destroy" a guest with assigned devices, in
xen/common/domain.c:domain_kill(), we relinquish guest's memory first,
then invoke domain_destroy() -> complete_domain_destroy() ->
arch_domain_destroy() -> pci_release_devices()/iommu_domain_destroy().

Between relinquish_memory() and domain_destroy(), a device may be
issuing DMA request and access guest's relinquished  memory.

We can do_FLR() to quiesce devices before xc.domain_destroy().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-08-26 14:11:39 +01:00
Keir Fraser 2a82334fcc xend: Avoid multiple assignments to same dict key in pci_convert_sxp_to_dict
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-26 10:14:32 +01:00
Keir Fraser 154ef9e3cc vtd: Don't do FLR when we create domain or hotplug device into guest.
VT-d hot-plug is done in such a way:  1) xend sends 'pci-ins' command
to ioemu via xenstore; 2) ioemu creates pass-through device and raises
SCI to guest OS; guest OS loads device driver, and device driver
initializes the hot-plugged device; 3) xend does FLR. There is a race
condition about 2) and 3). If 3) runs slow, we have troubles. Thanks
for Yuji Shimada's locating the issues.

We can work around the issues by not doing FLR when we create domain
or hotplug device into guest, namely, we only do FLR when we destroy
domain or hotplug device from guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2008-08-19 10:51:41 +01:00
Keir Fraser d74b976c41 xend: fixes a typo in the PIF class of the Xen-API code.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-08-19 10:48:39 +01:00
Keir Fraser 74f9ac9665 xend: Make sure that 'PV_kernel' config param is not blank when
assigning it to 'loader' param. This fixes a failure of 'xm create'
via xen-api.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-08-13 13:40:38 +01:00
Keir Fraser 8712242693 xend/xenapi: Initialize a VLAN PIF's record with the MAC and MTU size
of the created network interface

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-08-11 16:51:02 +01:00
Keir Fraser dea6d8b20c xend/xen-api: Have the VDI record return the security label
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-08-11 15:01:34 +01:00
Keir Fraser 3ca259a393 xend: Better support for legacy HVM config of ia64
On ia64, direct Linux boot is not supported, and 'Flash.fd' or
'guest_firmware.bin' has been used as a value of the 'kernel'
option. Cset:17016 ignores those strings and overrides them with
"/usr/lib/xen/boot/hvmloader".

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-11 11:27:40 +01:00
Keir Fraser 8a067f68b1 ia64: PV driver domains - ugly python hacks
x86 IOMMU support added a lot of assumptions about what PCI buses look
like and where to find bridge devices.  On ia64, we don't yet have
virtualization friendly IOMMUs, so for the moment, we just want to
keep "unsafe" PV PCI pass through working as well as it did in Xen
3.2. Looking at the code, it almost seems like x86 has thrown out
support for the old style driver domain.  Things that don't
necessarily work on every PCI compliant architecture:

      * You can't assume that just because there's a device at 01:01.0
        that there's also a bridge at 01:00.0 and blow-up when you
        don't find it.  On HP ia64 boxes, PCI root bridges are not
        necessarily exposed as a PCI device.  This pretty much means
        we can't call into any of the "FLR" code paths.
      * BAR alignment: it's hard to have BAR alignment when your page
        size is 16k.  This wasn't a requirement for previous PV driver
        domains, so I assume it's only for IOMMU support.

This is ugly, so I'm open to suggestions.  It seems that all of these
architecture checks could be replaced by checking some "iommu_present"
variable to test whether the extra requirements are necessary.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2008-08-08 10:53:40 +01:00
Keir Fraser 97503a73e3 xm: fix trivial typo. s/ciredump-restore/coredump-restart/
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-08-07 09:05:31 +01:00
Keir Fraser ccecac2def xend: vncconsole config option mustn't be a string
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-05 13:45:25 +01:00
Keir Fraser 95d4283bb4 ioemu: Do not pass -m (memory) option to qemu, as ioemu-remote rejects
memory sizes greater than 2GB when built as a 32-bit binary.

Instead, direct HVM Linux loading approximates end of low memory via a
different method.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-05 13:23:59 +01:00
Keir Fraser 45f66e11cc xend: remove default NIC in qemu when no vif configured
Latest QEMU would add a NIC device by default, unless specify the
"-nic none". So end user still get a unusable NIC even no vif in the
config file.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2008-08-05 09:29:42 +01:00
Keir Fraser 33d021a978 xend: Fix handling of pci creation failure in device_create().
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-08-04 11:11:24 +01:00
Keir Fraser f6a15c6354 xm on xenapi: Enable 'xm pci-list' via Xen-API
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-08-04 11:11:02 +01:00
Keir Fraser ad67b382bb xend: fix finding pci capability
Xend doesn't start up on my laptop which has a PCI-CardBus bridge.
PCI-CardBus bridge device doesn't have a capability chain.
Also sanity checking of a capability chain.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-08-04 11:10:27 +01:00
Keir Fraser f06e832088 xm: fix up exception handling when spawning vnc viewer.
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-04 11:06:31 +01:00
Keir Fraser f1b5be9017 xm on xenapi: Enable 'xm pci-{att,det}ach' commands to be executed via xen-api.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-31 13:31:15 +01:00
Keir Fraser fc57b9025f xm on xenapi: Add missing support for creating pci-assigned domains
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-31 13:30:59 +01:00
Keir Fraser dfad53d5fe xend: Fix portability issue of lspci option.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-31 12:39:56 +01:00
Keir Fraser cd1f9abc4a Allow xm to spawn vnc viewer
The new merged qemu no longer has the ability to spawn a vnc viewer
process in the bowels of the xend/qemu stack.  In this patch we
provide support for this use case in a different manner - one more
akin to the mechanism used for `xm console' and `xm create -c'.

We introduce new xm options:
   xm create --vncviewer [--vncviewer-autopass]
   xm vncviewer [--vncviewer-autopass]

These spawn a VNC viewer, obtaining the relevant information
(including the port number and if you tell it your viewer supports it
the password to use) directly from xenstore.

Like xm console it waits in the foreground for the vnc port to become
available; the timeout case isn't handled as well as it might be - it
just causes the whole program (xm) to die with `Alarm clock' but this
is difficult to deal with given the current structure of the xs Python
lowlevel interface, which doesn't provide a timeout on the call to
wait for a xenstore watch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-07-30 16:22:45 +01:00
Keir Fraser 78130b8a28 xm, xenapi: Fix a problem in xm client for domain shutdown
Xm did not shut down domains anymore when run in xen-api mode due to a
'None' parameter being passed to xend when looking up a domain. This
fixes the problem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-07-30 09:23:11 +01:00
Keir Fraser cacc71b173 xm: Enable a bootloader when using XM via Xen-API
This enables the usage of a bootloader, i.e., pygrub, when starting a
domain using xm in Xen-API mode.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-07-30 09:22:24 +01:00
Keir Fraser 5589b0008c xend, pci passthru: Use Dstate transition to do FLR for integrated
devices without proper FLR capability.

Currently integrated devices without proper FLR capability are not
assignable. This is not nice since actually they may be assignable,
but due to old BIOS the proper FLR capability is not exposed. We can
use the previously-used Dstate transition method to do FLR for them.
This works well and looks few issues are reported AFAIK. Maybe we can
make a black list for the (rare) integrated devices that don't work
with this method.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:29:23 +01:00
Keir Fraser 3c456fd628 xend, pci passthru: Relax the requirement of co-assignment.
Certain PCI or PCIe devices needs to be co-assigned. Currently we
require all the related devices be assigned to the same guest. This
can be relaxed to: part of them can be assgined to the same guest, and
after that, the left ones can't be assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:28:45 +01:00
Keir Fraser a7d2697092 xend: Improve the error prompt when xc.test_assign_device() fails.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:27:48 +01:00
Keir Fraser cead514ad8 xend: fix dual destroy
After changeset 18030 and 18064 were checked in, I found some issues
when creating HVM domains with devices assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-25 13:58:23 +01:00
Keir Fraser 6f79893756 tools: remove type parameter from xc_physdev_map_pirq{,_msi}()
... as it's implied by the function name.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:18:58 +01:00
Keir Fraser 33b7b2161a xend balloon: portability cleanup
Move the linux specific labels to osdep where they
belong. Modification on Solaris code ok'd by SUN (Ryan Scott).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-22 11:55:06 +01:00
Keir Fraser 518aee2780 tools: cpuid inputs must be 32 character long if hexadecimal value is
not used.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
2008-07-21 14:03:26 +01:00
Keir Fraser 418ce6a531 xend: Fix keymap handling
Patch allows keymap to be specified inside vfb description and
allows VM configured keymap setting to override XenD default

Signed-off-by: Pat Campbell <plc@novell.com>
2008-07-21 09:47:07 +01:00