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