1 diff -r 0f36c2eec2e1 Config.mk
2 --- a/Config.mk Thu Jul 28 15:40:54 2011 +0100
3 +++ b/Config.mk Fri Dec 02 16:52:49 2011 +0000
6 # Note that using SeaBIOS requires the use the upstream qemu as the
9 +SEABIOS_DIR ?= $(XEN_ROOT)/tools/firmware/seabios-unstable
13 diff -r 0f36c2eec2e1 config/Linux.mk
14 --- a/config/Linux.mk Thu Jul 28 15:40:54 2011 +0100
15 +++ b/config/Linux.mk Fri Dec 02 16:52:49 2011 +0000
17 include $(XEN_ROOT)/config/StdGNU.mk
19 # You may use wildcards, e.g. KERNELS=*2.6*
21 +KERNELS ?= linux-2.6-pvops
23 XKERNELS := $(foreach kernel, $(KERNELS), \
24 $(patsubst buildconfigs/mk.%,%, \
25 diff -r 0f36c2eec2e1 tools/firmware/hvmloader/hvmloader.c
26 --- a/tools/firmware/hvmloader/hvmloader.c Thu Jul 28 15:40:54 2011 +0100
27 +++ b/tools/firmware/hvmloader/hvmloader.c Fri Dec 02 16:52:49 2011 +0000
29 const struct bios_info *b;
32 - bios = xenstore_read("hvmloader/bios", "rombios");
33 + bios = xenstore_read("hvmloader/bios", "seabios");
35 for ( b = &bios_configs[0]; b->key != NULL; b++ )
36 if ( !strcmp(bios, b->key) )
38 bios->create_pir_tables();
41 - if ( bios->load_roms )
42 +// if ( bios->load_roms )
45 switch ( virtual_vga )
47 diff -r 0f36c2eec2e1 tools/libxl/libxl.c
48 --- a/tools/libxl/libxl.c Thu Jul 28 15:40:54 2011 +0100
49 +++ b/tools/libxl/libxl.c Fri Dec 02 16:52:49 2011 +0000
57 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb)
59 flexarray_append_pair(front, "backend-id", libxl__sprintf(&gc, "%d", vfb->backend_domid));
60 flexarray_append_pair(front, "state", libxl__sprintf(&gc, "%d", 1));
62 + flexarray_append_pair(back, "videoram", libxl__sprintf(&gc, "%d", vfb->videoram));
63 + flexarray_append_pair(front, "videoram", libxl__sprintf(&gc, "%d", vfb->videoram));
65 libxl__device_generic_add(&gc, &device,
66 libxl__xs_kvs_of_flexarray(&gc, back, back->count),
67 libxl__xs_kvs_of_flexarray(&gc, front, front->count));
69 switch (b_info->type) {
70 case LIBXL_DOMAIN_TYPE_HVM:
71 *need_memkb += b_info->shadow_memkb + LIBXL_HVM_EXTRA_MEMORY;
72 - if (dm_info->device_model_stubdomain)
73 + if (dm_info->device_model_stubdomain ||
74 + dm_info->device_model_linux_stubdomain)
75 *need_memkb += 32 * 1024;
77 case LIBXL_DOMAIN_TYPE_PV:
78 diff -r 0f36c2eec2e1 tools/libxl/libxl.idl
79 --- a/tools/libxl/libxl.idl Thu Jul 28 15:40:54 2011 +0100
80 +++ b/tools/libxl/libxl.idl Fri Dec 02 16:52:49 2011 +0000
83 ("device_model_version", libxl_device_model_version),
84 ("device_model_stubdomain", bool),
85 + ("device_model_linux_stubdomain", bool),
86 ("device_model", string, False, "if you set this you must set device_model_version too"),
87 ("saved_state", string),
88 ("type", libxl_domain_type),
90 ("opengl", bool, False, "opengl enabled or disabled (if enabled requires sdl enabled)"),
92 ("xauthority", string),
93 + ("videoram", integer),
96 libxl_device_vkb = Struct("device_vkb", [
97 diff -r 0f36c2eec2e1 tools/libxl/libxl_create.c
98 --- a/tools/libxl/libxl_create.c Thu Jul 28 15:40:54 2011 +0100
99 +++ b/tools/libxl/libxl_create.c Fri Dec 02 16:52:49 2011 +0000
101 dm_info->dom_name = strdup(c_info->name);
102 dm_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
103 dm_info->device_model_stubdomain = false;
104 + dm_info->device_model_linux_stubdomain = false;
105 dm_info->device_model = NULL;
106 dm_info->target_ram = libxl__sizekb_to_mb(b_info->target_memkb);
107 dm_info->videoram = libxl__sizekb_to_mb(b_info->video_memkb);
108 diff -r 0f36c2eec2e1 tools/libxl/libxl_device.c
109 --- a/tools/libxl/libxl_device.c Thu Jul 28 15:40:54 2011 +0100
110 +++ b/tools/libxl/libxl_device.c Fri Dec 02 16:52:49 2011 +0000
112 tv.tv_sec = LIBXL_DEVICE_MODEL_START_TIMEOUT;
114 nfds = xs_fileno(xsh) + 1;
115 - if (starting && starting->for_spawn->fd > xs_fileno(xsh))
116 - nfds = starting->for_spawn->fd + 1;
117 + //if (starting && starting->for_spawn->fd > xs_fileno(xsh))
118 + // nfds = starting->for_spawn->fd + 1;
120 while (rc > 0 || (!rc && tv.tv_sec > 0)) {
125 FD_SET(xs_fileno(xsh), &rfds);
127 - FD_SET(starting->for_spawn->fd, &rfds);
129 + // FD_SET(starting->for_spawn->fd, &rfds);
130 rc = select(nfds, &rfds, NULL, NULL, &tv);
132 if (FD_ISSET(xs_fileno(xsh), &rfds)) {
133 @@ -597,12 +597,12 @@
137 - if (starting && FD_ISSET(starting->for_spawn->fd, &rfds)) {
138 - unsigned char dummy;
139 - if (read(starting->for_spawn->fd, &dummy, sizeof(dummy)) != 1)
140 - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_DEBUG,
141 - "failed to read spawn status pipe");
143 + //if (starting && FD_ISSET(starting->for_spawn->fd, &rfds)) {
144 + // unsigned char dummy;
145 + // if (read(starting->for_spawn->fd, &dummy, sizeof(dummy)) != 1)
146 + // LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_DEBUG,
147 + // "failed to read spawn status pipe");
151 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model not ready");
152 diff -r 0f36c2eec2e1 tools/libxl/libxl_dm.c
153 --- a/tools/libxl/libxl_dm.c Thu Jul 28 15:40:54 2011 +0100
154 +++ b/tools/libxl/libxl_dm.c Fri Dec 02 16:52:49 2011 +0000
157 #include "flexarray.h"
159 -static const char *libxl_tapif_script(libxl__gc *gc)
160 +static const char *libxl_tapif_script(libxl__gc *gc,
161 + libxl_device_model_info *info)
164 + if(info->device_model_linux_stubdomain)
165 + return libxl__sprintf(gc, "/bin/qemu-ifup");
166 return libxl__strdup(gc, "no");
168 return libxl__sprintf(gc, "%s/qemu-ifup", libxl_xen_script_dir_path());
170 libxl_ctx *ctx = libxl__gc_owner(gc);
173 - if (info->device_model_stubdomain)
174 + if (info->device_model_stubdomain ||
175 + info->device_model_linux_stubdomain)
178 if (info->device_model) {
180 dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path());
182 case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
183 - dm = libxl__strdup(gc, "/usr/bin/qemu");
184 + dm = libxl__strdup(gc, "/usr/local/bin/qemu");
187 LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
189 "-net", libxl__sprintf(gc, "nic,vlan=%d,macaddr=%s,model=%s",
190 vifs[i].devid, smac, vifs[i].model),
191 "-net", libxl__sprintf(gc, "tap,vlan=%d,ifname=%s,bridge=%s,script=%s",
192 - vifs[i].devid, ifname, vifs[i].bridge, libxl_tapif_script(gc)),
193 + vifs[i].devid, ifname, vifs[i].bridge, libxl_tapif_script(gc, info)),
198 flexarray_append(dm_args,
199 libxl__sprintf(gc, "type=tap,id=net%d,ifname=%s,script=%s",
200 vifs[i].devid, ifname,
201 - libxl_tapif_script(gc)));
202 + libxl_tapif_script(gc, info)));
207 flexarray_append(dm_args, "-m");
208 flexarray_append(dm_args, libxl__sprintf(gc, "%d", info->target_ram));
210 + flexarray_append(dm_args, "-machine");
211 + flexarray_append(dm_args, "accel=xen");
213 + if (info->device_model_linux_stubdomain)
214 + flexarray_append(dm_args, "-fbdev");
216 if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
217 for (i = 0; i < num_disks; i++) {
220 if (disks[i].format == LIBXL_DISK_FORMAT_EMPTY)
221 drive = libxl__sprintf
222 (gc, "if=ide,index=%d,media=cdrom", disk);
223 + else if (info->device_model_linux_stubdomain)
224 + drive = libxl__sprintf
225 + (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s",
226 + "/dev/xvdc", disk, "host_cdrom");
228 drive = libxl__sprintf
229 (gc, "file=%s,if=ide,index=%d,media=cdrom,format=%s",
230 @@ -466,10 +480,15 @@
231 drive = libxl__sprintf
232 (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s",
233 disks[i].pdev_path, disk, format);
235 - drive = libxl__sprintf
236 - (gc, "file=%s,if=ide,index=%d,media=disk,format=%s",
237 - disks[i].pdev_path, disk, format);
239 + if (info->device_model_linux_stubdomain)
240 + drive = libxl__sprintf
241 + (gc, "file=%s,if=ide,index=%d,media=disk,format=%s",
242 + "/dev/xvda", disk, "host_device");
244 + drive = libxl__sprintf
245 + (gc, "file=%s,if=ide,index=%d,media=disk,format=%s",
246 + disks[i].pdev_path, disk, format);
248 continue; /* Do not emulate this disk */
250 @@ -618,18 +637,18 @@
251 libxl_domain_build_info b_info;
252 libxl__domain_build_state state;
256 struct xs_permissions perm[2];
258 libxl__device_model_starting *dm_starting = 0;
259 libxl_device_model_info xenpv_dm_info;
261 - if (info->device_model_version != LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL) {
266 - args = libxl__build_device_model_args(gc, "stubdom-dm", info,
267 + if (info->device_model_stubdomain)
268 + args = libxl__build_device_model_args(gc, "stubdom-dm", info,
271 + if(info->device_model_linux_stubdomain)
272 + args = libxl__build_device_model_args(gc, "linux-stubdom", info,
276 @@ -645,16 +664,27 @@
278 memset(&b_info, 0x00, sizeof(libxl_domain_build_info));
279 b_info.max_vcpus = 1;
280 - b_info.max_memkb = 32 * 1024;
281 + b_info.max_memkb = 64 * 1024;
282 b_info.target_memkb = b_info.max_memkb;
284 b_info.type = LIBXL_DOMAIN_TYPE_PV;
285 - b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
286 - libxl_xenfirmwaredir_path());
287 - b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", info->domid);
288 - b_info.u.pv.ramdisk.path = "";
289 b_info.u.pv.features = "";
291 + if(info->device_model_linux_stubdomain){
292 + b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", info->domid);
293 + b_info.u.pv.kernel.path = libxl__abs_path(gc, "vmlinuz-ioemu",
294 + libxl_xenfirmwaredir_path());
295 + b_info.u.pv.ramdisk.path = libxl__abs_path(gc, "ramdisk-ioemu",
296 + libxl_xenfirmwaredir_path());
297 + b_info.video_memkb = 8 * 1024;
299 + }else if(info->device_model_stubdomain){
300 + b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d video=vfb:800*600-32", info->domid);
301 + b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
302 + libxl_xenfirmwaredir_path());
303 + b_info.u.pv.ramdisk.path = "";
306 /* fixme: this function can leak the stubdom if it fails */
308 ret = libxl__domain_make(gc, &c_info, &domid);
310 case STUBDOM_CONSOLE_LOGGING:
311 name = libxl__sprintf(gc, "qemu-dm-%s", libxl_domid_to_name(ctx, info->domid));
312 libxl_create_logfile(ctx, name, &filename);
313 - console[i].output = libxl__sprintf(gc, "file:%s", filename);
314 + //console[i].output = libxl__sprintf(gc, "file:%s", filename);
316 + console[i].output = libxl__sprintf(gc, "/dev/hvc0");
319 case STUBDOM_CONSOLE_SAVE:
320 @@ -805,11 +837,13 @@
324 - if (info->device_model_stubdomain) {
325 + if (info->device_model_stubdomain ||
326 + info->device_model_linux_stubdomain) {
327 libxl_device_vfb vfb;
328 libxl_device_vkb vkb;
330 libxl__vfb_and_vkb_from_device_model_info(gc, info, &vfb, &vkb);
332 rc = libxl__create_stubdom(gc, info,
335 diff -r 0f36c2eec2e1 tools/libxl/xl_cmdimpl.c
336 --- a/tools/libxl/xl_cmdimpl.c Thu Jul 28 15:40:54 2011 +0100
337 +++ b/tools/libxl/xl_cmdimpl.c Fri Dec 02 16:52:49 2011 +0000
338 @@ -1061,6 +1061,8 @@
339 fprintf(stderr, "WARNING: device model override given without specific DM version\n");
340 if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l))
341 dm_info->device_model_stubdomain = l;
342 + else if (!xlu_cfg_get_long (config, "device_model_linux_stubdomain_override", &l))
343 + dm_info->device_model_linux_stubdomain = l;
345 #define parse_extra_args(type) \
346 if (!xlu_cfg_get_list(config, "device_model_args"#type, \