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 5 of 9] libxl: only use interactive PyGrub mode when

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 5 of 9] libxl: only use interactive PyGrub mode when a console is attached
From: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
Date: Fri, 30 Sep 2011 14:43:05 +0200
Delivery-date: Fri, 30 Sep 2011 05:50:41 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:in-reply-to:references:user-agent:date :from:to; bh=JfmJ0E0ZrBVgpMwAzszcxfhOjKX4s1F1jy0fjeOKDlQ=; b=VUCCD2OJFgSH+35JYq/eholq2TjQEAHWVCxfZ62ZBmSQ9/TksMQDUcmia8UUAladZH R/cOWDXOotl1YLiPr/7khyhgZlF2R3geVGkvbrNJO4fFp0JhjFren3KmAapgugSgyp2q DxsUMmu+JdSttrAJuZOnywfxIdxZwr20BUBH0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1317386580@loki>
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: <patchbomb.1317386580@loki>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.9.2
# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
# Date 1317386335 -7200
# Node ID 84a27a9f39f29194a7344e842b2055f592a42250
# Parent  156626fef95b36184ad44dfcb049bae2545435f0
libxl: only use interactive PyGrub mode when a console is attached

Sometimes PyGrub freezed when trying to create a domain without the console 
attached (without "-c"). This patch adds the "-q" option to PyGrub when "-c" is 
not specified at creation time. PyGrub freezed trying to set terminal 
attributes (like reset_prog_mode or nocbreak).

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>

diff -r 156626fef95b -r 84a27a9f39f2 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Fri Sep 30 14:38:55 2011 +0200
+++ b/tools/libxl/libxl.h       Fri Sep 30 14:38:55 2011 +0200
@@ -287,7 +287,8 @@ int libxl_get_max_cpus(libxl_ctx *ctx);
 int libxl_run_bootloader(libxl_ctx *ctx,
                          libxl_domain_build_info *info,
                          libxl_device_disk *disk,
-                         uint32_t domid);
+                         uint32_t domid,
+                         libxl_console_ready cb);
 
   /* 0 means ERROR_ENOMEM, which we have logged */
 
diff -r 156626fef95b -r 84a27a9f39f2 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c    Fri Sep 30 14:38:55 2011 +0200
+++ b/tools/libxl/libxl_bootloader.c    Fri Sep 30 14:38:55 2011 +0200
@@ -33,7 +33,8 @@
 static char **make_bootloader_args(libxl__gc *gc,
                                    libxl_domain_build_info *info,
                                    uint32_t domid,
-                                   const char *fifo, char *disk)
+                                   const char *fifo, char *disk,
+                                   libxl_console_ready cb)
 {
     flexarray_t *args;
     int nr = 0;
@@ -55,6 +56,8 @@ static char **make_bootloader_args(libxl
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output=%s", fifo));
     flexarray_set(args, nr++, "--output-format=simple0");
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", 
"/var/run/libxl/"));
+    if (!cb)
+        flexarray_set(args, nr++, "-q");
 
     if (info->u.pv.bootloader_args) {
         char *saveptr;
@@ -300,7 +303,8 @@ static void parse_bootloader_result(libx
 int libxl_run_bootloader(libxl_ctx *ctx,
                          libxl_domain_build_info *info,
                          libxl_device_disk *disk,
-                         uint32_t domid)
+                         uint32_t domid,
+                         libxl_console_ready cb)
 {
     libxl__gc gc = LIBXL_INIT_GC(ctx);
     int ret, rc = 0;
@@ -362,7 +366,7 @@ int libxl_run_bootloader(libxl_ctx *ctx,
         goto out_close;
     }
 
-    args = make_bootloader_args(&gc, info, domid, fifo, diskpath);
+    args = make_bootloader_args(&gc, info, domid, fifo, diskpath, cb);
     if (args == NULL) {
         rc = ERROR_NOMEM;
         goto out_close;
diff -r 156626fef95b -r 84a27a9f39f2 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Fri Sep 30 14:38:55 2011 +0200
+++ b/tools/libxl/libxl_create.c        Fri Sep 30 14:38:55 2011 +0200
@@ -461,7 +461,7 @@ static int do_domain_create(libxl__gc *g
     }
 
     if ( restore_fd < 0 ) {
-        ret = libxl_run_bootloader(ctx, &d_config->b_info, d_config->num_disks 
> 0 ? &d_config->disks[0] : NULL, domid);
+        ret = libxl_run_bootloader(ctx, &d_config->b_info, d_config->num_disks 
> 0 ? &d_config->disks[0] : NULL, domid, cb);
         if (ret) {
             LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
                        "failed to run bootloader: %d", ret);

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