[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1 of 4] xenconsoled: do not write the pty under serial



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 <stefano.stabellini@xxxxxxxxxxxxx>

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)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.