Skip to contentSkip to conversation

xenconsoled: do not write the pty under serial

PATCH In review Stefano Stabellini 2 participants 2 messages Aug 9, 2010 – Aug 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

tools/console/daemon/io.c +17 -21
diff -r 6b28b2dac7dd tools/console/daemon/io.c
@@ -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)
#1 lore raw

Stefano Stabellini writes ("[Xen-devel] [PATCH 1 of 4] xenconsoled: do not write the pty under serial"):

Quoted 10 lines

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.

From your earlier document I don't understand why xenconsoled ever

needs to write anything under "serial". According to the document only HVM guests have emulated serial ports and they are only ever handled by qemu.

Umm, it occurs to me that your document doesn't seem to cover the stubdom case.

Ian.