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

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

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux-stubdom: Support linux-stubdom in libxl
From: Jiageng Yu <yujiageng734@xxxxxxxxx>
Date: Tue, 31 May 2011 13:07:01 +0800
Cc:
Delivery-date: Tue, 31 May 2011 09:06:38 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=mjPdth5Z4HIox8nozdundXw1VeQ3CkebYGd5NLge1DU=; b=BN0hPdoiV02Twel4RKZ9/Y4iZBjnY9N8QINTv+O3B//gAPcMg/Q9i2U50INF40L9WD Lyjav93JHB4jWNdkcHl2yWt5VxokWbmBY22mOW11GYvenTSAbNlDyzaScY71wfu2yEq8 e5ubfNgikmvbRoPc+yQnaqB65uEmg08OLB2tw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=EasRIUU7XQv058jkfXGH83r5etNQZgO5m0YQRzW3IV2srJwr4MPh3Xc0/vIFkKf/n4 n2R84y5Nkl398BQap+CjzayOi+FeU+gek7G8fE9tHG0WoN/Ff2DXBzdyKaWRNOz8NDS7 SAeWI+UH9HbIies50Q18cUar0WsbYdYnMJsyo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
author jiageng_yu <yujiageng734@xxxxxxxxx>
Tue, 31 May 2011 02:18:01 +0000 (03:18 +0100)
committer jiageng_yu <yujiageng734@xxxxxxxxx>
 ue, 31 May 2011 02:18:01 +0000 (03:18 +0100)
commit 179b4167dd9e86a06a700d60e277c4477f0c06ef
tree 4e4c8492b480e08d9122abcb37aca52ae5650786 tree | snapshot (tar.gz zip)
parent cf4866b9161a724e4b2c366da73de271cf7ef348 commit | diff

linux-studom: Support linux-stubdom in libxl

Add linux-stubdom support in libxl. Users could start a linux-stubdom
throuh the following options:
device_model_override = 'linux-stubdom'
device_model_stubdomain_override=1

linux-stubdom project: http://repo.or.cz/w/linux-based-stubdoms.git


diff --git a/Makefile b/Makefile
index 9e5c95b..a7535f8 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,10 @@ IOEMU_GIT_REMOTEBRANCH ?= qemu-dm-v15
 IOEMU_GIT_LOCALBRANCH ?= $(IOEMU_GIT_REMOTEBRANCH)
 IOEMU_GITREV ?= $(IOEMU_GIT_ORIGIN)/$(IOEMU_GIT_REMOTEBRANCH)

+#libxl
+LIBXL_DIR = libxl-$(STUBDOM_ARCH)
+LIBXL_SRCDIR = $(XEN_ROOT)/tools/libxl
+
 #download udev
 UDEV_URL?= http://www.us.kernel.org/pub/linux/utils/kernel/hotplug
 UDEV_VERSION=100
@@ -94,7 +98,7 @@ $(TARGETS_LINUX):download-linux-src

+#######
+# libxl
+#######
+
+.link-libxl-dir:
+       mkdir -p $(LIBXL_DIR)
+       set -e; +       cd $(LIBXL_DIR); +      (cd $(LIBXL_SRCDIR) &&
$(MAKE) clean);+ (cd $(LIBXL_SRCDIR) && find *   ! -type l  -type f
$(addprefix ! -name ,       +                       '*.[oda1]'
'config-*' config.mak        +                       '*.html' '*.pod'
                                      +                       )) |
                                               +                while
read f; do rm -f "$$f"; ln -s "$(LIBXL_SRCDIR)/$$f" "$$f"; done
+       patch -d $(LIBXL_DIR) -p3 < libxl.patch
+       touch .link-libxl-dir
+
+.PHONY: libxl
+libxl: .link-libxl-dir
+       (cd $(LIBXL_DIR);$(MAKE) install;)

 ######
 # udev
@@ -137,7 +162,7 @@ udev: udev-$(UDEV_VERSION).tar.bz2
 ###########################

 .PHONY: ioemu-stubdom
-ioemu-stubdom: linux-stubdom-$(STUBDOM_ARCH)-ioemu ioemu udev
+ioemu-stubdom: libxl linux-stubdom-$(STUBDOM_ARCH)-ioemu ioemu udev
        $(warning "ioemu-linux-stubdom")
        sh $(MAKE_RAMDISK_SCRIPT)
linux-stubdom-$(STUBDOM_ARCH)-ioemu/$(INSTALL_PATH) ramdisk-$(TARGETS)
ioemu

@@ -168,6 +193,7 @@ install-ioemu: ioemu-stubdom
 clean:
        rm -fr linux-stubdom-$(STUBDOM_ARCH)-ioemu
        rm -fr udev-$(UDEV_VERSION)
+       rm -fr $(LIBXL_DIR) .link-libxl-dir

 .PHONY: downloadclean
 downloadclean: clean


diff --git a/libxl.patch b/libxl.patch
new file mode 100644
index 0000000..64a49ef
--- /dev/null
+++ b/libxl.patch
@@ -0,0 +1,81 @@
+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   Tue May 31 02:41:59 2011 +0100
+@@ -556,6 +556,14 @@
+     return 0;
+ }
+
++inline int libxl__is_linux_stubdom(libxl_device_model_info *info)
++{
++      
if(!strncmp(info->device_model,"linux-stubdom",strlen(info->device_model)))
++              return 1;
++      else
++              return 0;
++};
++
+ static int libxl__create_stubdom(libxl__gc *gc,
+                                  libxl_device_model_info *info,
+                                  libxl_device_disk *disks, int num_disks,
+@@ -581,7 +589,12 @@
+         goto out;
+     }
+
+-    args = libxl__build_device_model_args(gc, "stubdom-dm", info,
++      if(libxl__is_linux_stubdom(info))
++              args = libxl__build_device_model_args(gc, "linux-stubdom", info,
++                                          disks, num_disks,
++                                          vifs, num_vifs);
++      else
++              args = libxl__build_device_model_args(gc, "stubdom-dm", info,
+                                           disks, num_disks,
+                                           vifs, num_vifs);
+     if (!args) {
+@@ -599,13 +612,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(libxl__is_linux_stubdom(info)){
++              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{
++              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);
+diff -r 37c77bacb52a tools/libxl/libxl_internal.h
+--- a/tools/libxl/libxl_internal.h     Mon May 23 17:38:28 2011 +0100
++++ b/tools/libxl/libxl_internal.h     Tue May 31 02:41:59 2011 +0100
+@@ -249,6 +249,7 @@
+                                 libxl__domain_build_state *state);
+
+ /* for device model creation */
++_hidden int libxl__is_linux_stubdom(libxl_device_model_info *info);
+ _hidden const char *libxl__domain_device_model(libxl__gc *gc,
+                                                libxl_device_model_info *info);
+ _hidden int libxl__create_device_model(libxl__gc *gc,
+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 Tue May 31 02:41:59 2011 +0100
+@@ -1087,7 +1087,7 @@
+             fprintf(stderr,
+                     "WARNING: ignoring device_model directive.n"
+                     "WARNING: Use "device_model_override" instead if
you really want a non-default device_modeln");
+-            if (strstr(buf, "stubdom-dm"))
++            if (strstr(buf, "stubdom-dm") || strstr(buf, "linux-stubdom"))
+                 fprintf(stderr, "WARNING: Or use
"device_model_stubdomain_override" if you want to enable
stubdomainsn");
+         }
+

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

<Prev in Thread] Current Thread [Next in Thread>