+ if (dm_info->device_model_stubdomain ||
+ dm_info->device_model_linux_stubdomain)
*need_memkb += 32 * 1024;
} else
*need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
diff -r 37c77bacb52a tools/libxl/libxl.idl
--- a/tools/libxl/libxl.idl Mon May 23 17:38:28 2011 +0100
+++ b/tools/libxl/libxl.idl Wed Jun 01 03:24:57 2011 +0100
@@ -196,6 +196,7 @@
("dom_name", string),
("device_model_version", libxl_device_model_version),
("device_model_stubdomain", bool),
+ ("device_model_linux_stubdomain", bool),
("device_model", string, False, "if you set this you must set device_model_version too"),
("saved_state", string),
("type", libxl_domain_type),
diff -r 37c77bacb52a tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c Mon May 23 17:38:28 2011 +0100
+++ b/tools/libxl/libxl_create.c Wed Jun 01 03:24:57 2011 +0100
@@ -110,6 +110,7 @@
dm_info->dom_name = strdup(c_info->name);
dm_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
dm_info->device_model_stubdomain = false;
+ dm_info->device_model_linux_stubdomain = false;
dm_info->device_model = NULL;
dm_info->target_ram = libxl__sizekb_to_mb(b_info->target_memkb);
dm_info->videoram = libxl__sizekb_to_mb(b_info->video_memkb);
diff -r 37c77bacb52a tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c Mon May 23 17:38:28 2011 +0100
+++ b/tools/libxl/libxl_dm.c Wed Jun 01 03:24:57 2011 +0100
@@ -44,7 +44,8 @@
libxl_ctx *ctx = libxl__gc_owner(gc);
const char *dm;
- if (info->device_model_stubdomain)
+ if (info->device_model_stubdomain ||
+ info->device_model_linux_stubdomain)
return NULL;
if (info->device_model) {
@@ -571,7 +572,7 @@
libxl_domain_build_info b_info;
libxl__domain_build_state state;
uint32_t domid;
- char **args;
+ char **args=NULL;
struct xs_permissions perm[2];
xs_transaction_t t;
libxl__device_model_starting *dm_starting = 0;
@@ -581,7 +582,12 @@
goto out;
}
- args = libxl__build_device_model_args(gc, "stubdom-dm", info,
+ if(info->device_model_stubdomain)
+ args = libxl__build_device_model_args(gc, "stubdom-dm", info,
+ disks, num_disks,
+ vifs, num_vifs);
+ if(info->device_model_linux_stubdomain)
+ args = libxl__build_device_model_args(gc, "linux-stubdom", info,
disks, num_disks,
vifs, num_vifs);
if (!args) {
@@ -599,13 +605,22 @@
b_info.max_vcpus = 1;
b_info.max_memkb = 32 * 1024;
b_info.target_memkb = b_info.max_memkb;
- b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
- libxl_xenfirmwaredir_path());
b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", info->domid);
- b_info.u.pv.ramdisk.path = "";
b_info.u.pv.features = "";
b_info.hvm = 0;
+ if(info->device_model_linux_stubdomain){
+ b_info.u.pv.kernel.path = libxl__abs_path(gc, "vmlinuz-ioemu",
+ libxl_xenfirmwaredir_path());
+ b_info.u.pv.ramdisk.path = libxl__abs_path(gc, "ramdisk-ioemu",
+ libxl_xenfirmwaredir_path());
+ } else if(info->device_model_stubdomain){
+ b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
+ libxl_xenfirmwaredir_path());
+ b_info.u.pv.ramdisk.path = "";
+ }
+
/* fixme: this function can leak the stubdom if it fails */
ret = libxl__domain_make(gc, &c_info, &domid);
@@ -745,7 +760,8 @@
char **pass_stuff;
const char *dm;
- if (info->device_model_stubdomain) {
+ if (info->device_model_stubdomain ||
+ info->device_model_linux_stubdomain) {
libxl_device_vfb vfb;
libxl_device_vkb vkb;
diff -r 37c77bacb52a tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Mon May 23 17:38:28 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c Wed Jun 01 03:24:57 2011 +0100
@@ -1109,6 +1109,8 @@
fprintf(stderr, "WARNING: device model override given without specific DM version\n");
if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l))
dm_info->device_model_stubdomain = l;
+ if (!xlu_cfg_get_long (config, "device_model_linux_stubdomain_override", &l))
+ dm_info->device_model_linux_stubdomain = l;
if (!xlu_cfg_get_long (config, "stdvga", &l))
dm_info->stdvga = l;
if (!xlu_cfg_get_long (config, "vnc", &l))