Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Changelog

[xen-unstable] libxl, xl: fix bootloader immediate console attach



Xen changelog RSS feed   Index | Next | Previous | View Threaded

patchbot at xen

May 18, 2012, 10:11 AM

Post #1 of 1 (85 views)
[xen-unstable] libxl, xl: fix bootloader immediate console attach

# HG changeset patch
# User Ian Jackson <ian.jackson [at] eu>
# Date 1337262342 -3600
# Node ID 8dce7a4121b9debb47b5c05f1b2741cbde5df56a
# Parent 753d2b91a7885eb81093acec0e7ce4eaec094b8d
libxl, xl: fix bootloader immediate console attach

Fix bugs related to console handling:

* In libxl_primary_console_exec, if libxl__domain_type fails, do
not abort, but instead log and return an error. This can occur
if the domid is invalid.

* In xl's autoconnect_console, rename the ctx formal parameter so
that when postfork creates a new ctx and puts it in the global ctx,
we don't end up using the old one (via the formal parameter which
has shadowed the global).

* In xl's autoconnect_console, pass the domid from the event
to libxl_primary_console_exec, rather than using the global domid
(which has not yet been set, since it is only set at completion
of the ao).

This causes xl create -c to once more work with pygrub.

Signed-off-by: Ian Jackson <ian.jackson [at] eu>
Acked-by: Ian Campbell <ian.campbell [at] citrix>
Committed-by: Ian Campbell <ian.campbell [at] citrix>

diff -r 753d2b91a788 -r 8dce7a4121b9 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Thu May 17 14:45:41 2012 +0100
+++ b/tools/libxl/libxl.c Thu May 17 14:45:42 2012 +0100
@@ -1188,6 +1188,10 @@ int libxl_primary_console_exec(libxl_ctx
rc = libxl_console_exec(ctx, domid_vm, 0, LIBXL_CONSOLE_TYPE_PV);
+ case -1:
+ LOG(ERROR,"unable to get domain type for domid=%"PRIu32,domid_vm);
+ rc = ERROR_FAIL;
+ break;
diff -r 753d2b91a788 -r 8dce7a4121b9 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Thu May 17 14:45:41 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c Thu May 17 14:45:42 2012 +0100
@@ -1496,9 +1496,11 @@ static int freemem(libxl_domain_build_in

-static void autoconnect_console(libxl_ctx *ctx, libxl_event *ev, void *priv)
+static void autoconnect_console(libxl_ctx *ctx_ignored,
+ libxl_event *ev, void *priv)
pid_t *pid = priv;
+ uint32_t bldomid = ev->domid;

libxl_event_free(ctx, ev);

@@ -1512,7 +1514,7 @@ static void autoconnect_console(libxl_ct

- libxl_primary_console_exec(ctx, domid);
+ libxl_primary_console_exec(ctx, bldomid);
/* Do not return. xl continued in child process */
fprintf(stderr, "Unable to attach console\n");

Xen-changelog mailing list
Xen-changelog [at] lists

Xen changelog RSS feed   Index | Next | Previous | View Threaded

Interested in having your list archived? Contact Gossamer Threads
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.