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

[Xen-changelog] [xen-unstable] libxenlight: write stubdoms logs to file

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxenlight: write stubdoms logs to file
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 02 Dec 2009 00:55:19 -0800
Delivery-date: Wed, 02 Dec 2009 00:55:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259743516 0
# Node ID b647216151cd9b2c27f5152325135fa47e1e49d3
# Parent  7183cd08d71b828737f5dcb6769ea7e5a62c4242
libxenlight: write stubdoms logs to file

It turns out that there is a better way to write stubdoms logs to file
than using libxl_console_attach: qemu is the one that provides the
console backend for stubdoms and qemu is able to redirect a serial to
file, so we can use this feature to make sure the first stubdom
console is always redirected to a logfile.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/libxl/libxl.c       |   11 ++++++++++-
 tools/libxl/libxl_utils.c |    2 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff -r 7183cd08d71b -r b647216151cd tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Wed Dec 02 08:44:40 2009 +0000
+++ b/tools/libxl/libxl.c       Wed Dec 02 08:45:16 2009 +0000
@@ -1352,7 +1352,16 @@ static int libxl_build_xenpv_qemu_args(s
             num++;
     }
     if (num > 0) {
-        info->serial = "pty";
+        uint32_t guest_domid = libxl_is_stubdom(ctx, vfb->domid);
+        if (guest_domid) {
+            char *filename;
+            char *name = libxl_sprintf(ctx, "qemu-dm-%s", 
libxl_domid_to_name(ctx, guest_domid));
+            libxl_create_logfile(ctx, name, &filename);
+            info->serial = libxl_sprintf(ctx, "file:%s", filename);
+            free(filename);
+        } else {
+            info->serial = "pty";
+        }
         num--;
     }
     if (num > 0) {
diff -r 7183cd08d71b -r b647216151cd tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Wed Dec 02 08:44:40 2009 +0000
+++ b/tools/libxl/libxl_utils.c Wed Dec 02 08:45:16 2009 +0000
@@ -185,7 +185,7 @@ int libxl_is_stubdom(struct libxl_ctx *c
 {
     char *target = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, 
"%s/target", libxl_xs_get_dompath(ctx, domid)));
     if (target)
-        return 1;
+        return atoi(target);
     else
         return 0;
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxenlight: write stubdoms logs to file, Xen patchbot-unstable <=