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@eu.citrix.com>
This commit is contained in:
Keir Fraser committed 2009-12-02 08:45:16 +00:00
1 parent f20744517f
commit 07443ee6da
2 files changed
+11 -2

No files matched your search

+10 -1
View File
@@ -1352,7 +1352,16 @@ static int libxl_build_xenpv_qemu_args(struct libxl_ctx *ctx,
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) {
+1 -1
View File
@@ -185,7 +185,7 @@ int libxl_is_stubdom(struct libxl_ctx *ctx, int domid)
{
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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.