ia64/xen-unstable

view tools/examples/xmexample.hvm @ 19648:f0e2df69a8eb

x86 hvm: Allow cross-vendor migration

Intercept #UD and emulate SYSCALL/SYSENTER/SYSEXIT as necessary.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue May 26 15:01:36 2009 +0100 (2009-05-26)
parents ee93f866c74c
children b51f9542ab14
line source
1 # -*- mode: python; -*-
2 #============================================================================
3 # Python configuration setup for 'xm create'.
4 # This script sets the parameters used when a domain is created using 'xm create'.
5 # You use a separate script for each domain you want to create, or
6 # you can set the parameters for the domain on the xm command line.
7 #============================================================================
9 import os, re
11 arch_libdir = 'lib'
12 arch = os.uname()[4]
13 if os.uname()[0] == 'Linux' and re.search('64', arch):
14 arch_libdir = 'lib64'
16 #----------------------------------------------------------------------------
17 # Kernel image file.
18 kernel = "/usr/lib/xen/boot/hvmloader"
20 # The domain build function. HVM domain uses 'hvm'.
21 builder='hvm'
23 # Initial memory allocation (in megabytes) for the new domain.
24 #
25 # WARNING: Creating a domain with insufficient memory may cause out of
26 # memory errors. The domain needs enough memory to boot kernel
27 # and modules. Allocating less than 32MBs is not recommended.
28 memory = 128
30 # Shadow pagetable memory for the domain, in MB.
31 # If not explicictly set, xend will pick an appropriate value.
32 # Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
33 # shadow_memory = 8
35 # A name for your domain. All domains must have different names.
36 name = "ExampleHVMDomain"
38 # 128-bit UUID for the domain. The default behavior is to generate a new UUID
39 # on each call to 'xm create'.
40 #uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"
42 #-----------------------------------------------------------------------------
43 # The number of cpus guest platform has, default=1
44 #vcpus=1
46 # Enable/disable HVM guest PAE, default=1 (enabled)
47 #pae=1
49 # Enable/disable HVM guest ACPI, default=1 (enabled)
50 #acpi=1
52 # Enable/disable HVM APIC mode, default=1 (enabled)
53 # Note that this option is ignored if vcpus > 1
54 #apic=1
56 # Enable/disable extended power management support within HVM guest, i.e., beyond
57 # S3, S4, S5 within guest like exposing battery meter.
58 # 0 (default option, extended power management support disabled)
59 # 1 (pass-through mode; uses pass-through as needed; efficient but limited in scope)
60 # 2 (non pass-through mode; extended scope, likely to work on all applicable environment
61 # but comparitively less efficient than pass-through mode)
62 # xen_extended_power_mgmt=0
64 # List of which CPUS this domain is allowed to use, default Xen picks
65 #cpus = "" # leave to Xen to pick
66 #cpus = "0" # all vcpus run on CPU0
67 #cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
68 #cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
70 # Optionally define mac and/or bridge for the network interfaces.
71 # Random MACs are assigned if not given.
72 #vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
73 # type=ioemu specify the NIC is an ioemu device not netfront
74 vif = [ 'type=ioemu, bridge=xenbr0' ]
76 #----------------------------------------------------------------------------
77 # Define the disk devices you want the domain to have access to, and
78 # what you want them accessible as.
79 # Each disk entry is of the form phy:UNAME,DEV,MODE
80 # where UNAME is the device, DEV is the device name the domain will see,
81 # and MODE is r for read-only, w for read-write.
83 #disk = [ 'phy:hda1,hda1,r' ]
84 disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
86 #----------------------------------------------------------------------------
87 # Configure the behaviour when a domain exits. There are three 'reasons'
88 # for a domain to stop: poweroff, reboot, and crash. For each of these you
89 # may specify:
90 #
91 # "destroy", meaning that the domain is cleaned up as normal;
92 # "restart", meaning that a new domain is started in place of the old
93 # one;
94 # "preserve", meaning that no clean-up is done until the domain is
95 # manually destroyed (using xm destroy, for example); or
96 # "rename-restart", meaning that the old domain is not cleaned up, but is
97 # renamed and a new domain started in its place.
98 #
99 # In the event a domain stops due to a crash, you have the additional options:
100 #
101 # "coredump-destroy", meaning dump the crashed domain's core and then destroy;
102 # "coredump-restart', meaning dump the crashed domain's core and the restart.
103 #
104 # The default is
105 #
106 # on_poweroff = 'destroy'
107 # on_reboot = 'restart'
108 # on_crash = 'restart'
109 #
110 # For backwards compatibility we also support the deprecated option restart
111 #
112 # restart = 'onreboot' means on_poweroff = 'destroy'
113 # on_reboot = 'restart'
114 # on_crash = 'destroy'
115 #
116 # restart = 'always' means on_poweroff = 'restart'
117 # on_reboot = 'restart'
118 # on_crash = 'restart'
119 #
120 # restart = 'never' means on_poweroff = 'destroy'
121 # on_reboot = 'destroy'
122 # on_crash = 'destroy'
124 #on_poweroff = 'destroy'
125 #on_reboot = 'restart'
126 #on_crash = 'restart'
128 #============================================================================
130 # Device Model to be used
131 device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
133 #-----------------------------------------------------------------------------
134 # boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
135 # default: hard disk, cd-rom, floppy
136 #boot="cda"
138 #-----------------------------------------------------------------------------
139 # write to temporary files instead of disk image files
140 #snapshot=1
142 #----------------------------------------------------------------------------
143 # enable SDL library for graphics, default = 0
144 sdl=0
146 #----------------------------------------------------------------------------
147 # enable OpenGL for texture rendering inside the SDL window, default = 1
148 # valid only if sdl is enabled.
149 opengl=1
151 #----------------------------------------------------------------------------
152 # enable VNC library for graphics, default = 1
153 vnc=1
155 #----------------------------------------------------------------------------
156 # address that should be listened on for the VNC server if vnc is set.
157 # default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp
158 #vnclisten="127.0.0.1"
160 #----------------------------------------------------------------------------
161 # set VNC display number, default = domid
162 #vncdisplay=1
164 #----------------------------------------------------------------------------
165 # try to find an unused port for the VNC server, default = 1
166 #vncunused=1
168 #----------------------------------------------------------------------------
169 # set password for domain's VNC console
170 # default is depents on vncpasswd in xend-config.sxp
171 vncpasswd=''
173 #----------------------------------------------------------------------------
174 # no graphics, use serial port
175 #nographic=0
177 #----------------------------------------------------------------------------
178 # enable stdvga, default = 0 (use cirrus logic device model)
179 stdvga=0
181 #-----------------------------------------------------------------------------
182 # serial port re-direct to pty deivce, /dev/pts/n
183 # then xm console or minicom can connect
184 serial='pty'
187 #-----------------------------------------------------------------------------
188 # Qemu Monitor, default is disable
189 # Use ctrl-alt-2 to connect
190 #monitor=1
193 #-----------------------------------------------------------------------------
194 # enable sound card support, [sb16|es1370|all|..,..], default none
195 #soundhw='sb16'
198 #-----------------------------------------------------------------------------
199 # set the real time clock to local time [default=0 i.e. set to utc]
200 #localtime=1
203 #-----------------------------------------------------------------------------
204 # set the real time clock offset in seconds [default=0 i.e. same as dom0]
205 #rtc_timeoffset=3600
207 #-----------------------------------------------------------------------------
208 # start in full screen
209 #full-screen=1
212 #-----------------------------------------------------------------------------
213 # Enable USB support (specific devices specified at runtime through the
214 # monitor window)
215 #usb=1
217 # Enable USB mouse support (only enable one of the following, `mouse' for
218 # PS/2 protocol relative mouse, `tablet' for
219 # absolute mouse)
220 #usbdevice='mouse'
221 #usbdevice='tablet'
223 #-----------------------------------------------------------------------------
224 # Set keyboard layout, default is en-us keyboard.
225 #keymap='ja'
227 #-----------------------------------------------------------------------------
228 # Enable/disable xen platform PCI device, default=1 (enabled)
229 #xen_platform_pci=1
231 #-----------------------------------------------------------------------------
232 # Configure guest CPUID responses:
233 #
234 #cpuid=[ '1:ecx=xxxxxxxxxxx00xxxxxxxxxxxxxxxxxxx,
235 # eax=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ]
236 # - Unset the SSE4 features (CPUID.1[ECX][20-19])
237 # - Default behaviour for all other bits in ECX And EAX registers.
238 #
239 # Each successive character represent a lesser-significant bit:
240 # '1' -> force the corresponding bit to 1
241 # '0' -> force to 0
242 # 'x' -> Get a safe value (pass through and mask with the default policy)
243 # 'k' -> pass through the host bit value
244 # 's' -> as 'k' but preserve across save/restore and migration
245 #
246 # Expose to the guest multi-core cpu instead of multiple processors
247 # Example for intel, expose a 8-core processor :
248 #cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
249 # ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
250 # '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']
251 # - CPUID.1[EDX][HT] : Enable HT
252 # - CPUID.1[EBX] : Number of vcpus * 2
253 # - CPUID.4,0[EAX] : Number of vcpus * 2 - 1
254 #vcpus=8
255 #
256 # Example for amd, expose a 5-core processor :
257 # cpuid = ['1:ebx=xxxxxxxx00001010xxxxxxxxxxxxxxxx,
258 # edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
259 # '0x80000001:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1x',
260 # '0x80000008:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx001001']
261 # - CPUID.1[EBX] : Threads per Core * Cores per Socket (2 * #vcpus)
262 # - CPUID.1[EDX][HT] : Enable HT
263 # - CPUID.0x80000001[CmpLegacy] : Use legacy method
264 # - CPUID.0x80000008[ECX] : #vcpus * 2 - 1
265 #vcpus=5
266 #
267 # Downgrade the cpuid to make a better compatibility for migration :
268 # Look like a generic 686 :
269 # cpuid = [ '0:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
270 # '1:eax=0x06b1,
271 # ecx=xxxxxxxxxxx0000xx00xxx0000000xx0,
272 # edx=xxx00000xxxxxxx0xxxxxxxxx0xxxxxx',
273 # '4:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
274 # '0x80000000:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0']
275 # with the highest leaf
276 # - CPUID.0[EAX] : Set the highest leaf
277 # - CPUID.1[EAX] : 686
278 # - CPUID.1[ECX] : Mask some features
279 # - CPUID.1[EDX] : Mask some features
280 # - CPUID.4 : Reply like the highest leaf, in our case CPUID.3
281 # - CPUID.0x80000000 : No extension we are on a Pentium III, reply like the
282 # highest leaf (CPUID.3).
283 #
284 # Configure host CPUID consistency checks, which must be satisfied for this
285 # VM to be allowed to run on this host's processor type:
286 #cpuid_check=[ '1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx1xxxxx' ]
287 # - Host must have VMX feature flag set
288 #
289 # The format is similar to the above for 'cpuid':
290 # '1' -> the bit must be '1'
291 # '0' -> the bit must be '0'
292 # 'x' -> we don't care (do not check)
293 # 's' -> the bit must be the same as on the host that started this VM
295 #-----------------------------------------------------------------------------
296 # Configure passthrough PCI{,-X,e} devices:
297 #
298 # pci=[ '[SSSS:]BB:DD.F[,option1[,option2[...]]]', ... ]
299 #
300 # [SSSS]:BB:DD.F "bus segment:bus:device.function"(1) of the device to
301 # be assigned, bus segment is optional. All fields are
302 # in hexadecimal and no field should be longer than that
303 # as shown in the pattern. Successful assignment may need
304 # certain hardware support and additional configurations
305 # (e.g. VT-d, see docs/misc/vtd.txt for more details).
306 #
307 # (1) bus segment is sometimes also referred to as the PCI "domain",
308 # not to be confused with Xen domain.
309 #
310 #
311 # optionN per-device options in "key=val" format. Current
312 # available options are:
313 # - msitranslate=0|1
314 # per-device overriden of pci_msitranslate, see below
315 # - power_mgmt=0|1
316 # per-device overriden of pci_power_mgmt, see below
317 #
318 #pci=[ '07:00.0', '07:00.1' ]
320 # MSI-INTx translation for MSI capable devices:
321 #
322 # If it's set, Xen will enable MSI for the device that supports it even
323 # if the guest don't use MSI. In the case, an IO-APIC type interrupt will
324 # be injected to the guest every time a corresponding MSI message is
325 # received.
326 # If the guest enables MSI or MSI-X, the translation is automatically
327 # turned off.
328 #
329 #pci_msitranslate=1
331 # PCI Power Management:
332 #
333 # If it's set, the guest OS will be able to program D0-D3hot states of the
334 # PCI device for the purpose of low power consumption.
335 #
336 #pci_power_mgmt=0
338 #-----------------------------------------------------------------------------
339 # Configure PVSCSI devices:
340 #
341 #vscsi=[ 'PDEV, VDEV' ]
342 #
343 # PDEV gives physical SCSI device to be attached to specified guest
344 # domain by one of the following identifier format.
345 # - XX:XX:XX:XX (4-tuples with decimal notation which shows
346 # "host:channel:target:lun")
347 # - /dev/sdxx or sdx
348 # - /dev/stxx or stx
349 # - /dev/sgxx or sgx
350 # - result of 'scsi_id -gu -s'.
351 # ex. # scsi_id -gu -s /block/sdb
352 # 36000b5d0006a0000006a0257004c0000
353 #
354 # VDEV gives virtual SCSI device by 4-tuples (XX:XX:XX:XX) as
355 # which the specified guest domain recognize.
356 #
358 #vscsi = [ '/dev/sdx, 0:0:0:0' ]