Commit Graph
2561 Commits
Author SHA1 Message Date
Keir Fraser e358d917c4 xend: Improve localtime calculation -- Python time module already
provides the relevant information.

From: Ross Walker <rwalker@medallion.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-31 10:40:43 +01:00
Keir Fraser 6e6b79115c xm: Make xm's printout of security errors look better
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-03-31 10:37:19 +01:00
Keir Fraser 178252351a xend: Fix XendBootloader bogus reference to 'attr'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-28 07:34:47 +00:00
Keir Fraser 8d4aef298f pygrub: cleanup and support for NetBSD
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-03-26 14:41:47 +00:00
Keir Fraser e687956536 xenfb: Dynamic modes support.
Attached patch adds dynamic frame buffer size support to the xenfb PV
backend QEMU xenfb.  Backend sets feature-resize and handles the
resize frame buffer event.

Corresponding frontend LINUX patch is required for functionality but
this patch is not dependent on it, preserving backwards
compatibility.

Signed-off-by: Pat Campbell <plc@novell.com>
2008-03-26 09:09:16 +00:00
Keir Fraser f28927a991 xend: typo
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-03-25 10:26:05 +00:00
Keir Fraser 8f04d55021 xend: Fix writing domain's VDI UUID into domain state file.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-03-20 17:45:00 +00:00
Keir Fraser 2795200267 tools: More accurate parsing of pci config.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-03-19 10:21:01 +00:00
Keir Fraser cccd453197 xend: Fix and improve default NUMA node selection.
Add the missing condition check and use average value instead of the
sum value of Vcpus pinning cpus on certain node to choose relaxed node.

Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
2008-03-19 10:20:17 +00:00
Keir Fraser 67ae17b562 Fix methods in SrvDomain class for inactive managed domains
This patch fixes methods in SrvDomain class for inactive managed
domains.  They should use a domain name because inactive managed
domains don't have a domID.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-03-19 10:18:36 +00:00
Keir Fraser 102cd68e62 vfb: Add opengl option
(and replace bogus vncpasswd copy in xenapi_create in the SDL case)

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-03-18 15:51:19 +00:00
Keir Fraser 751e5ae7c3 Xend forgets to write the domain's VDI UUID into the domain state file
once the domain is started (before it's there). Once xend is restarted
it will not know the association between the VBD and VDI anymore due
to the missing UUID. This patch fixes this.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-03-18 13:14:26 +00:00
Keir Fraser 1fa1369d8a ioemu: SDL rendering using OpenGL
Add opengl support for rendering the guest framebuffer in the SDL
window. SDL is needed anyway to open the window and handle the
events. Opengl rendering is optional and can be turned off at both
compile time and in the vm configuration file.

Some of the benefits of using opengl are:

 - faster rendering, less CPU intensive, especially with good graphic
   cards;
 - makes the window resizing possible and hardware accelerated, thus
   very efficient and smooth;
 - allows other optimizations like sharing directly a buffer in vram
   with the guest (not yet implemented).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2008-03-18 11:47:58 +00:00
Keir Fraser d61f17ab72 tools: Add PV passthrough PCI device hotplug support.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-03-18 11:39:21 +00:00
Keir Fraser bfe18b4f3a Fix domain suspend by xend stop
When I stopped xend by xend stop command, a domain suspend processing
is frequently failed.  This patch solves the problem.

Step to reproduce:
 1. xm new XXX on_xend_stop="suspend"
 2. xm start XXX
 3. xend stop

In the xend stop, if the domain suspend processing is slept by
state_updated.wait() of waitForShutdown(), then the domain suspend
processing is not waked up again because state_updated.notifyAll()
of _stateSet() is not executed.

For the reason, processing of _on_domains_changed() is waited by
domains_lock.acquire() because the domain suspend processing is
keeping domains_lock and sleeping.  The domain suspend processing
got domains_lock at cleanup_domains().

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-03-18 11:34:44 +00:00
Keir Fraser 7564231fbc xm: allow non-existent readline module
Let xm work even if Python doesn't have its readline module installed.

Signed-off-by: John Levon <john.levon@sun.com>
2008-03-18 11:32:06 +00:00
Keir Fraser 83d6140b39 Allow libvirt to specify force, rm_cfg
When doing a 'virsh detach-disk' on a running domain, the disk is not
removed from the configuration file.  Allow a caller to specify
whether or not to change the file.

Signed-off-by: Ryan Scott <ryan.scott@sun.com>
2008-03-18 11:31:39 +00:00
Keir Fraser 37a1d36134 stubdom: add support for reading the command line from the config
file, and merge the dmargs with it in the case of qemu.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-03-18 11:27:05 +00:00
Keir Fraser 8ff66a38fa Convert XenAPI platform values to appropriate types.
XenAPI defines the platform attribute of a VM as a string-string map
but in various code paths in xend the platform entries are expected to be
another type, e.g. int.  This patch defines the types of each platform
entry and converts the entry values to appropriate type when new domU
configuration is created via XenAPI.

Alternatively the values could be casted to appropriate type when used
but seems prudent to do the conversion when domU configuration is
created.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-03-18 11:07:00 +00:00
Keir Fraser 97ae3c0202 Set device model when creating rfb console via XenAPI
When creating a rfb console via XenAPI the device model is not being
set to qemu-dm, resulting in no pvfb since qemu-dm is not launched
when domU is started.  This patch sets device model when a rfb console
is created via XenAPI.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-03-18 11:06:26 +00:00
Keir Fraser d8cdbecc65 Initialization of new domU config options via XenAPI
Many of the new domU config options related to hvm guests (e.g. hpet,
rtc_timeoffset, etc.) are not initialized with default values via
XenAPI, which prevents starting an hvm domU created through XenAPI.
This patch ensures the new options are set with appropriate default
values in XendConfig platform sanity check.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-03-18 11:05:53 +00:00
Keir Fraser 6dc8df55ea Each TAP/TUN device name for a HVM guest includes its domain ID.
The TAP/TUN devices are used for connection to a HVM domain, but there
is no relationship between each name of the devices and its domain
ID. This patch assigns a HVM domain ID to each TAP/TUN device name.

Signed-off-by: MIYAJIMA Mitsuharu <miyajima.mitsuharu@anchor.jp>
2008-03-18 11:02:00 +00:00
Keir Fraser 45b676a245 Use ioemu block drivers through blktap.
Add support for a tap:ioemu pseudo driver. Devices using this driver
won't use tapdisk (containing the code duplication) any more, but will
connect to the qemu-dm of the domain. In this way no working
configuration should be broken right now as you can still choose to
use the tapdisk drivers.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2008-03-18 10:58:47 +00:00
Keir Fraser 6329505217 xm: Fix 2nd argument value of arg_check() for a few xm commands.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-03-04 09:35:08 +00:00
Keir Fraser 4d5bf67dd1 Fix xm vcpu-pin for inactive managed domains
We cannot currently change cpu affinity definitions of inactive
managed domains by xm vcpu-pin command. This patch enables changing
cpu affinity definitions of inactive managed domains. However, we
cannot change cpu affinity definitions to each vcpu because we cannot
currently define cpu affinity definitions to each vcpu to domain
configuration definitions.  Therefore, we need to specify 'all' to
VCPU argument of xm vcpu-pin command.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-03-03 11:09:33 +00:00
Keir Fraser e13837d700 NUMA node migration
Adds NUMA node migration based on live migration to
xend. By adding another parameter to "xm migrate" the target NUMA node
number gets propagated to the target host (can be both localhost or a
remote host). The restore function then sets the VCPU affinity
accordingly. Only changes Python code in xend. I hope that the patch
doesn't break XenAPI compatibility (adding a parameter seems fine?).

# xm migrate --live --node=<nodenr> <domid> localhost
<nodenr> is the number as shown with 'xm info' under node_to_cpu

I am aware that using live migration isn't the best approach (takes
twice the memory and quite some time), but it's less intrusive and
works fine (given localhost migration stability...)

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2008-02-28 13:44:28 +00:00
Keir Fraser 081d18a09a xend: Remove duplicate setResume() method.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-28 10:31:45 +00:00
Keir Fraser 3785768ebd Fix error message of xm suspend and xm resume for Domain-0.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-28 10:30:21 +00:00
Keir Fraser 6a69bb45ed ioemu: Send logs to stderr and have xend redirect stderr to the
correct log file.

At the same time, this patch renames the logfile to be
'qemu-dm-{NAME}.log' instead of qemu-dm-{ID}.log.  This makes it
easier to track/find the QEMU logfile associated with a VM. It will
also save 1 backup qemu-dm-{NAME}.log.1 so if a domain crashes &
restart, you don't loose/overwrite the logfile immediately.

Finally it changes the QEMU monitor prompt back to '(qemu)' instead of
'(HVMXen)' because automated tools /scripts interacting with QEMU's
monitor need a consistent prompt to look for & changing it for Xen
serves no useful purpose.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2008-02-28 10:29:25 +00:00
Keir Fraser 28617ff2d0 Fix xm save command's #params check.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-27 13:19:42 +00:00
Keir Fraser f8b0360575 xend: Set default vcpu affinity for better performance in NUMA systems.
Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
2008-02-27 13:17:49 +00:00
Keir Fraser 1511fb1004 Fix xm mem-max command to restore previous setting if xc.domain_setmaxmem fails.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-26 15:02:26 +00:00
Keir Fraser 44bdf09e2c xend: Add free memory size of every node in physinfo to help user to
get usage of memory of their NUMA machine.

Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
2008-02-26 15:00:08 +00:00
Keir Fraser e516decc8c Fix restore of saved image containing rtc_timeoffset
Saved images contain rtc_timeoffset as a string value, resulting in a
TypeError exception when calling xc.domain_set_time_offset() on
restore.  Cast rtc_timeoffset to int before calling
xc.domain_set_time_offset().

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-02-26 14:35:39 +00:00
Keir Fraser 219c37ca95 blktap: qcow2 image format support
This patch adds support for the qcow2 image format to blktap. It
consists mostly of qemu code, adapted to the blktap interfaces.
Snapshots and compressed images are supported.

The qcow2 driver may be used by either specifying tap:qcow2 or by
using tap:qcow which will detect that you have a version 2 image and
will call the qcow2 driver.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2008-02-21 10:30:57 +00:00
Keir Fraser 60cbee2041 xm: Fix xm vcpu-pin to complain for CPU numbers out of range.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-20 17:42:12 +00:00
Keir Fraser 3bbf83843c Enable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.
** Currently only 2 virtual hotplug pci slots(6~7) are created so more
   than 2 vtd dev can't be hotplugged, but we can easily extend it in
   future.

Three new commands are added:
"xm pci-list domid" show the current assigned vtd device, like:
VSlt  domain   bus   slot   func
0x6      0x0  0x02   0x00    0x0

"xm pci-detach" hot remove the specified vtd device by the virtual
slot, like:
xm pci-detach EdwinHVMDomainVtd 6

"xm pci-attach DomainID dom bus dev func [vslot]" hot add a new vtd
device in the vslot. If no vslot specified, a free slot will be picked
up. e.g. to insert '0000:03:00.0':
xm pci-attach EdwinHVMDomainVtd 0 3 0 0

** guest pci hotplug
linux: pls. use 2.6.X and enable ACPI PCI hotplug ( Bus options=> PCI
hotplug => ACPI PCI hotplug driver )
windows: 2000/xp/2003/vista are all okay

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2008-02-15 14:13:17 +00:00
Keir Fraser b3a389fdfc device-dm: Use SIGHUP before SIGKILL
Make qemu unblock SIGHUP and make sure the default handler is in
place. Have the domain killer send SIGHUP to the device-model script,
allow the script 10s to clean up, and if still not dead, send
SIGKILL.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-12 10:57:49 +00:00
Keir Fraser 5c22e77bb7 xend: Remove redundant check of maximum memory size.
Currently, a wrong value of maximum memory size is checked by
_safe_set_memory() and _memory_sanity_check().

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-12 10:19:12 +00:00
Keir Fraser 283dddae87 xen-api: Fix some errors in Xen-API's PBD class.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-02-11 14:51:22 +00:00
Keir Fraser 3f8e22de79 x86 hvm: Allow HPET to be configured as a per-domain config option.
A new platform variable 'hpet' is added, which defaults to 0 for new
guests (that is, hpet disabled). Default is off (no hpet) because
hpet is currently less accurate in keeping time than PIT (because no
timer_mode adjustments).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-11 14:45:29 +00:00
Keir Fraser 81375c4b06 xend: Better support for legacy HVM config with hvmloader configured
via the 'kernel' config option:
 1. Look for any string containing 'hvmloader'.
 2. The 'kernel' option must be scrubbed to avoid taking
 PV-kernel-loading paths during later guest setup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-11 14:42:52 +00:00
Keir Fraser ce49af7f2c xend: Remove redundant xc.domain_setcpuweight() all the way down to libxenctrl.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-11 10:15:07 +00:00
Keir Fraser 250e4ae1c7 domain builder: make vfb = [ 'type=sdl' ] work
When setting

vfb = [ 'type=sdl' ]

in a domain config file, qemu seems to be still using vnc. Make it use
sdl as expected.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-11 10:06:51 +00:00
Keir Fraser e63b739dff Add 'coredump-destroy' and 'coredump-restart' actions for crashed domains.
Xen-API already specifies these actions for the 'on_crash' domain exit
event. This patch makes them available for use in traditional domU
config files and through the xm tool as well.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-02-07 09:28:55 +00:00
Keir Fraser c5b5f2e9ff xm reboot: Fix wait option of xm reboot command
When I rebooted a domain by xm reboot command with wait option,
I saw the following message.  But, rebooting the domain succeeded.
 Domain vm1 destroyed for failed in rebooting

The cause why the message was shown is the domain is destroyed
temporarily by processing of xm reboot command.  The domain
information is not gotten from Xend by server.xend.domains()
function till recreating the domain is completed.
This patch fixes processing of xm reboot command in Xm side.
It waits just a bit till recreating the domain is completed,
then it measures the success or failure of the reboot of the
domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-07 09:27:46 +00:00
Keir Fraser 2d700e03ef Revert 16973:b5427f2d83c3, which breaks automated testing (HVM qemu-dm
will not die when it is told to).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-05 23:27:12 +00:00
Keir Fraser ae9093a33f xend: Scrub vnc password for vfb from xend.log.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-05 10:40:10 +00:00
Keir Fraser 3ad6af357a xend: Restore values of /vm/uuid/xend/* to recreated domains.
When guest domains are restarted, previous values of /vm/uuid/xend/*
in xenstore are lost.  (e.g. previous_restart_time,
last_shutdown_reason). This patch restores them to restarting domains.
And we should update /vm/uuid/xend/restart_count of restarting
domains, not previous domains.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-05 10:39:35 +00:00
Keir Fraser 264f5caa68 ioemu: use SIGHUP instead of SIGKILL
The stub domain device model needs to trap the termination signal so
as to actually destroy the stub domain.  SIGKILL can't be trapped,
SIGTERM is caught by SDL and so may be unnoticed.  SIGHUP can be
trapped and is not caught by SDL (and by default causes a process
termination without core).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-04 13:44:29 +00:00