From: Stefano Stabellini Subject: [PATCH 1 of 4] xenconsoled: do not write the pty under serial Date: Mon, 9 Aug 2010 15:01:17 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org xenconsoled: do not write the pty under serial in xenstore if xenconsoled is handling a consolepath. The idea is that pv consoles use the "console" prefix in xenstore and emulated serials use the "serial" prefix in xenstore. There is no need to write the pty for a pv console under "serial", considering that xenconsoled is already writing the pty under "console" too. Signed-off-by: Stefano Stabellini diff -r 6b28b2dac7dd tools/console/daemon/io.c --- a/tools/console/daemon/io.c Thu Aug 05 11:36:24 2010 +0100 +++ b/tools/console/daemon/io.c Mon Aug 09 14:26:22 2010 +0100 @@ -451,27 +451,6 @@ static int domain_create_tty(struct doma free(data); } free(path); - } - - success = asprintf(&path, "%s/limit", dom->serialpath) != -1; - if (!success) - goto out; - data = xs_read(xs, XBT_NULL, path, &len); - if (data) { - dom->buffer.max_capacity = strtoul(data, 0, 0); - free(data); - } - free(path); - - success = asprintf(&path, "%s/tty", dom->serialpath) != -1; - if (!success) - goto out; - success = xs_write(xs, XBT_NULL, path, slave, strlen(slave)); - free(path); - if (!success) - goto out; - - if (dom->use_consolepath) { success = (asprintf(&path, "%s/tty", dom->conspath) != -1); if (!success) goto out; @@ -479,6 +458,23 @@ static int domain_create_tty(struct doma free(path); if (!success) goto out; + } else { + success = asprintf(&path, "%s/limit", dom->serialpath) != -1; + if (!success) + goto out; + data = xs_read(xs, XBT_NULL, path, &len); + if (data) { + dom->buffer.max_capacity = strtoul(data, 0, 0); + free(data); + } + free(path); + success = asprintf(&path, "%s/tty", dom->serialpath) != -1; + if (!success) + goto out; + success = xs_write(xs, XBT_NULL, path, slave, strlen(slave)); + free(path); + if (!success) + goto out; } if (fcntl(dom->master_fd, F_SETFL, O_NONBLOCK) == -1)