mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/xenstored: support complete log capabilities in stubdom
With 9pfs being fully available in Xenstore-stubdom now, there is no reason to not fully support all logging capabilities in stubdom. Open the logfile on stubdom only after the 9pfs file system has been mounted. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jason Andryuk <jandryuk@gmail.com> Reviewed-by: Julien Grall <jgrall@amazon.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
This commit is contained in:
1 parent
93892648ff
commit
a76f8809f1
4 files changed
+20
-17
No files matched your search
@@ -58,7 +58,6 @@ XENSTORED_ARGS=
|
||||
## Default: Not defined, tracing off
|
||||
#
|
||||
# Log xenstored messages
|
||||
# Only evaluated if XENSTORETYPE is "daemon".
|
||||
#XENSTORED_TRACE=[yes|on|1]
|
||||
|
||||
## Type: integer
|
||||
|
||||
@@ -98,6 +98,7 @@ test -f @CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons && . @CONFIG_DIR@/@CONFIG_LEAF
|
||||
[ -z "$XENSTORE_DOMAIN_SIZE" ] && XENSTORE_DOMAIN_SIZE=8
|
||||
XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS --memory $XENSTORE_DOMAIN_SIZE"
|
||||
[ -z "$XENSTORE_MAX_DOMAIN_SIZE" ] || XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS --maxmem $XENSTORE_MAX_DOMAIN_SIZE"
|
||||
[ -z "$XENSTORED_TRACE" ] || XENSTORE_DOMAIN_ARGS="$XENSTORE_DOMAIN_ARGS -T xenstored-trace.log"
|
||||
|
||||
echo -n Starting $XENSTORE_DOMAIN_KERNEL...
|
||||
${LIBEXEC_BIN}/init-xenstore-domain $XENSTORE_DOMAIN_ARGS || exit 1
|
||||
|
||||
+16
-16
@@ -201,6 +201,21 @@ static int do_control_quota_s(const void *ctx, struct connection *conn,
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
static int do_control_logfile(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
{
|
||||
if (num != 1)
|
||||
return EINVAL;
|
||||
|
||||
close_log();
|
||||
talloc_free(tracefile);
|
||||
tracefile = absolute_filename(NULL, vec[0]);
|
||||
reopen_log();
|
||||
|
||||
send_ack(conn, XS_CONTROL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __MINIOS__
|
||||
static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
@@ -214,21 +229,6 @@ static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static int do_control_logfile(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
{
|
||||
if (num != 1)
|
||||
return EINVAL;
|
||||
|
||||
close_log();
|
||||
talloc_free(tracefile);
|
||||
tracefile = talloc_strdup(NULL, vec[0]);
|
||||
reopen_log();
|
||||
|
||||
send_ack(conn, XS_CONTROL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_control_memreport(const void *ctx, struct connection *conn,
|
||||
const char **vec, int num)
|
||||
{
|
||||
@@ -309,10 +309,10 @@ static struct cmd_s cmds[] = {
|
||||
"[-c <cmdline>] [-F] [-t <timeout>] <file>\n"
|
||||
" Default timeout is 60 seconds.", 5 },
|
||||
#endif
|
||||
{ "logfile", do_control_logfile, "<file>" },
|
||||
#ifdef __MINIOS__
|
||||
{ "memreport", do_control_memreport, "" },
|
||||
#else
|
||||
{ "logfile", do_control_logfile, "<file>" },
|
||||
{ "memreport", do_control_memreport, "[<file>]" },
|
||||
#endif
|
||||
{ "print", do_control_print, "<string>" },
|
||||
|
||||
@@ -122,6 +122,9 @@ static void mount_thread(void *p)
|
||||
}
|
||||
|
||||
p9_device = init_9pfront(0, XENSTORE_LIB_DIR);
|
||||
|
||||
/* Start logging if selected. */
|
||||
reopen_log();
|
||||
}
|
||||
|
||||
void mount_9pfs(void)
|
||||
|
||||