aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console/client
diff options
context:
space:
mode:
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-09-07 21:24:34 +0000
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-09-07 21:24:34 +0000
commit4fa3210b976b98dc727566a3a175b0f9bd9a8b2b (patch)
tree67305bdd0da40043a200139bd18807de4f791e78 /tools/console/client
parent405cabc251556c1153ac337b3e09a8b06c8b18a0 (diff)
downloadxen-4fa3210b976b98dc727566a3a175b0f9bd9a8b2b.tar.gz
xen-4fa3210b976b98dc727566a3a175b0f9bd9a8b2b.tar.bz2
xen-4fa3210b976b98dc727566a3a175b0f9bd9a8b2b.zip
Move console tty/limit information into console directory in domain dir.
Also only store port number of console event channel. Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'tools/console/client')
-rw-r--r--tools/console/client/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 512e08a807..4c7b2710b8 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -170,8 +170,7 @@ int main(int argc, char **argv)
{ 0 },
};
- char *str_pty;
- char path[1024];
+ char *str_pty, *path;
int spty;
unsigned int len = 0;
struct xs_handle *xs;
@@ -214,7 +213,13 @@ int main(int argc, char **argv)
signal(SIGTERM, sighandler);
- snprintf(path, sizeof(path), "/console/%d/tty", domid);
+ path = xs_get_domain_path(xs, domid);
+ if (path == NULL)
+ err(errno, "xs_get_domain_path()");
+ path = realloc(path, strlen(path) + strlen("/console/tty") + 1);
+ if (path == NULL)
+ err(ENOMEM, "realloc");
+ strcat(path, "/console/tty");
str_pty = xs_read(xs, path, &len);
/* FIXME consoled currently does not assume domain-0 doesn't have a
@@ -252,6 +257,7 @@ int main(int argc, char **argv)
err(errno, "Could not open tty `%s'", str_pty);
}
free(str_pty);
+ free(path);
init_term(STDIN_FILENO, &attr);
console_loop(xc_handle, domid, spty);