[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] libxl: Support linux-stubdom in libxl



That is new patch for libxl.


diff -r 37c77bacb52a tools/libxl/libxl.c
--- a/tools/libxl/libxl.cÂÂÂ Mon May 23 17:38:28 2011 +0100
+++ b/tools/libxl/libxl.cÂÂÂ Wed Jun 01 03:24:57 2011 +0100
@@ -2078,7 +2078,8 @@
ÂÂÂÂ *need_memkb = b_info->target_memkb;
ÂÂÂÂ if (b_info->hvm) {
ÂÂÂÂÂÂÂÂ *need_memkb += b_info->shadow_memkb + LIBXL_HVM_EXTRA_MEMORY;
-ÂÂÂÂÂÂÂ if (dm_info->device_model_stubdomain)
+ÂÂÂÂÂÂ 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))
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.