xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jiageng Yu <yujiageng734@gmail.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	"Xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH] libxl: Support linux-stubdom in libxl
Date: Thu, 2 Jun 2011 14:40:05 +0100	[thread overview]
Message-ID: <BANLkTikNRNzgPo9nZ7i8Fgf3FVQ6zTZt_w@mail.gmail.com> (raw)
In-Reply-To: <1306933116.775.237.camel@zakaz.uk.xensource.com>


[-- Attachment #1.1: Type: text/plain, Size: 5213 bytes --]

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))

[-- Attachment #1.2: Type: text/html, Size: 6938 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-06-02 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 13:54 [PATCH] libxl: Support linux-stubdom in libxl Jiageng Yu
2011-05-31 14:38 ` Stefano Stabellini
2011-06-01 12:58 ` Ian Campbell
2011-06-02 13:40   ` Jiageng Yu [this message]
2011-06-02 14:25     ` Ian Campbell
2011-06-02 14:31       ` Stefano Stabellini
2011-06-02 14:35         ` Ian Campbell
2011-06-06 11:56           ` ZhouPeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTikNRNzgPo9nZ7i8Fgf3FVQ6zTZt_w@mail.gmail.com \
    --to=yujiageng734@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).