WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] libxl: Support linux-stubdom in libxl
From: Jiageng Yu <yujiageng734@xxxxxxxxx>
Date: Thu, 2 Jun 2011 14:40:05 +0100
Cc: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Thu, 02 Jun 2011 06:40:46 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zNt0Ec5BH+f9vSYfE6Odcbo9plH8k9Q3die7YTUZDC8=; b=xrG6LPNDGcHW9TzgcgJ4+STl9D0g9gmLojgX2WRJtzmrnjNcSlK2ZAtClAn4Gd7GPU gv0QQWwmDbW6aZew8uaD/j+tl4uw0PnIw4/XwGe1J8XTkAJYpR8xNsyo2hn1sAaSuuwq KrkJKvlO4red4mUqSjg/fLYDm63pe3OSeaMJo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=fDhLntE18KDOG9kRIfehFPx0NwExNI8SKI8FlXInir1yEVuyOA0gIhCw+rUb3SxMwI 1Xk0FJbNxjEc3kckuQDY2MBCaLhFZxFL3Ow5W84juaxr6piwqERDrCwDGOVUFhtFElwx e6IH+7QOO/6LLfza0Nnzt5unNQ0un0yuveM2w=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1306933116.775.237.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BANLkTikCb2GEodgNCDyL9_qgfLE42hc+pA@xxxxxxxxxxxxxx> <1306933116.775.237.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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