ia64/xen-unstable

view tools/examples/xmexample.hvm @ 17878:75e60df67e36

doc: Describes a generic 686 via the cpuid configure.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jun 18 09:37:40 2008 +0100 (2008-06-18)
parents 22f589f09da5
children 6ae87b27ccea
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
10 arch = os.uname()[4]
11 if re.search('64', arch):
12 arch_libdir = 'lib64'
13 else:
14 arch_libdir = 'lib'
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 # List of which CPUS this domain is allowed to use, default Xen picks
57 #cpus = "" # leave to Xen to pick
58 #cpus = "0" # all vcpus run on CPU0
59 #cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
60 #cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
62 # Optionally define mac and/or bridge for the network interfaces.
63 # Random MACs are assigned if not given.
64 #vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
65 # type=ioemu specify the NIC is an ioemu device not netfront
66 vif = [ 'type=ioemu, bridge=xenbr0' ]
68 #----------------------------------------------------------------------------
69 # Define the disk devices you want the domain to have access to, and
70 # what you want them accessible as.
71 # Each disk entry is of the form phy:UNAME,DEV,MODE
72 # where UNAME is the device, DEV is the device name the domain will see,
73 # and MODE is r for read-only, w for read-write.
75 #disk = [ 'phy:hda1,hda1,r' ]
76 disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
78 #----------------------------------------------------------------------------
79 # Configure the behaviour when a domain exits. There are three 'reasons'
80 # for a domain to stop: poweroff, reboot, and crash. For each of these you
81 # may specify:
82 #
83 # "destroy", meaning that the domain is cleaned up as normal;
84 # "restart", meaning that a new domain is started in place of the old
85 # one;
86 # "preserve", meaning that no clean-up is done until the domain is
87 # manually destroyed (using xm destroy, for example); or
88 # "rename-restart", meaning that the old domain is not cleaned up, but is
89 # renamed and a new domain started in its place.
90 #
91 # In the event a domain stops due to a crash, you have the additional options:
92 #
93 # "coredump-destroy", meaning dump the crashed domain's core and then destroy;
94 # "coredump-restart', meaning dump the crashed domain's core and the restart.
95 #
96 # The default is
97 #
98 # on_poweroff = 'destroy'
99 # on_reboot = 'restart'
100 # on_crash = 'restart'
101 #
102 # For backwards compatibility we also support the deprecated option restart
103 #
104 # restart = 'onreboot' means on_poweroff = 'destroy'
105 # on_reboot = 'restart'
106 # on_crash = 'destroy'
107 #
108 # restart = 'always' means on_poweroff = 'restart'
109 # on_reboot = 'restart'
110 # on_crash = 'restart'
111 #
112 # restart = 'never' means on_poweroff = 'destroy'
113 # on_reboot = 'destroy'
114 # on_crash = 'destroy'
116 #on_poweroff = 'destroy'
117 #on_reboot = 'restart'
118 #on_crash = 'restart'
120 #============================================================================
122 # New stuff
123 device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
125 #-----------------------------------------------------------------------------
126 # boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
127 # default: hard disk, cd-rom, floppy
128 #boot="cda"
130 #-----------------------------------------------------------------------------
131 # write to temporary files instead of disk image files
132 #snapshot=1
134 #----------------------------------------------------------------------------
135 # enable SDL library for graphics, default = 0
136 sdl=0
138 #----------------------------------------------------------------------------
139 # enable OpenGL for texture rendering inside the SDL window, default = 1
140 # valid only if sdl is enabled.
141 opengl=1
143 #----------------------------------------------------------------------------
144 # enable VNC library for graphics, default = 1
145 vnc=1
147 #----------------------------------------------------------------------------
148 # address that should be listened on for the VNC server if vnc is set.
149 # default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp
150 #vnclisten="127.0.0.1"
152 #----------------------------------------------------------------------------
153 # set VNC display number, default = domid
154 #vncdisplay=1
156 #----------------------------------------------------------------------------
157 # try to find an unused port for the VNC server, default = 1
158 #vncunused=1
160 #----------------------------------------------------------------------------
161 # enable spawning vncviewer for domain's console
162 # (only valid when vnc=1), default = 0
163 #vncconsole=0
165 #----------------------------------------------------------------------------
166 # set password for domain's VNC console
167 # default is depents on vncpasswd in xend-config.sxp
168 vncpasswd=''
170 #----------------------------------------------------------------------------
171 # no graphics, use serial port
172 #nographic=0
174 #----------------------------------------------------------------------------
175 # enable stdvga, default = 0 (use cirrus logic device model)
176 stdvga=0
178 #-----------------------------------------------------------------------------
179 # serial port re-direct to pty deivce, /dev/pts/n
180 # then xm console or minicom can connect
181 serial='pty'
184 #-----------------------------------------------------------------------------
185 # Qemu Monitor, default is disable
186 # Use ctrl-alt-2 to connect
187 #monitor=1
190 #-----------------------------------------------------------------------------
191 # enable sound card support, [sb16|es1370|all|..,..], default none
192 #soundhw='sb16'
195 #-----------------------------------------------------------------------------
196 # set the real time clock to local time [default=0 i.e. set to utc]
197 #localtime=1
200 #-----------------------------------------------------------------------------
201 # set the real time clock offset in seconds [default=0 i.e. same as dom0]
202 #rtc_timeoffset=3600
204 #-----------------------------------------------------------------------------
205 # start in full screen
206 #full-screen=1
209 #-----------------------------------------------------------------------------
210 # Enable USB support (specific devices specified at runtime through the
211 # monitor window)
212 #usb=1
214 # Enable USB mouse support (only enable one of the following, `mouse' for
215 # PS/2 protocol relative mouse, `tablet' for
216 # absolute mouse)
217 #usbdevice='mouse'
218 #usbdevice='tablet'
220 #-----------------------------------------------------------------------------
221 # Set keyboard layout, default is en-us keyboard.
222 #keymap='ja'
224 #-----------------------------------------------------------------------------
225 # Configure guest CPUID responses:
226 #
227 #cpuid=[ '1:ecx=xxxxxxxxxxx00xxxxxxxxxxxxxxxxxxx,
228 # eax=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ]
229 # - Unset the SSE4 features (CPUID.1[ECX][20-19])
230 # - Default behaviour for all other bits in ECX And EAX registers.
231 #
232 # Each successive character represent a lesser-significant bit:
233 # '1' -> force the corresponding bit to 1
234 # '0' -> force to 0
235 # 'x' -> Get a safe value (pass through and mask with the default policy)
236 # 'k' -> pass through the host bit value
237 # 's' -> as 'k' but preserve across save/restore and migration
238 #
239 # Expose to the guest multi-core cpu instead of multiple processors
240 # Example for intel, expose a 8-core processor :
241 #cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
242 # ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
243 # '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']
244 # - CPUID.1[EDX][HT] : Enable HT
245 # - CPUID.1[EBX] : Number of vcpus * 2
246 # - CPUID.4,0[EAX] : Number of vcpus * 2 - 1
247 #vcpus=8
248 #
249 # Example for amd, expose a 5-core processor :
250 # cpuid = ['1:ebx=xxxxxxxx00000001xxxxxxxxxxxxxxxx,
251 # edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
252 # '0x80000008:ecx=xxxxxxxxxxxxxxxx0000xxxx00001010']
253 # - CPUID.1[EBX] : (Thread * Cores ) per processors
254 # - CPUID.1[EDX][HT] : Enable HT
255 # - CPUID.0x80000008[ECX] : Number of vcpus * 2
256 #vcpus=5
257 #
258 # Downgrade the cpuid to make a better compatibility for migration :
259 # Look like a generic 686 :
260 # cpuid = [ '0:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
261 # '1:eax=0x06b1,
262 # ecx=xxxxxxxxxx0000xx00xxx0000000xx0,
263 # edx=xx00000xxxxxxx0xxxxxxxxx0xxxxxx',
264 # '4:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
265 # '0x80000000:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0']
266 # with the highest leaf
267 # - CPUID.0[EAX] : Set the highest leaf
268 # - CPUID.1[EAX] : 686
269 # - CPUID.1[ECX] : Mask some features
270 # - CPUID.1[EDX] : Mask some features
271 # - CPUID.4 : Reply like the highest leaf, in our case CPUID.3
272 # - CPUID.0x80000000 : No extension we are on a Pentium III, reply like the
273 # highest leaf (CPUID.3).
274 #
275 # Configure host CPUID consistency checks, which must be satisfied for this
276 # VM to be allowed to run on this host's processor type:
277 #cpuid_check=[ '1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx1xxxxx' ]
278 # - Host must have VMX feature flag set
279 #
280 # The format is similar to the above for 'cpuid':
281 # '1' -> the bit must be '1'
282 # '0' -> the bit must be '0'
283 # 'x' -> we don't care (do not check)
284 # 's' -> the bit must be the same as on the host that started this VM