Skip to contentSkip to conversation

libxl: return any serial tty path in libxl_console_get_tty

PATCH Applied Bob Liu 3 participants 4 messages Aug 4, 2016 – Aug 5, 2016

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH v2 1/1 libxl: return any serial tty path in libxl_console_get_tty

When specifying a serial list in domain config, users of libxl_console_get_tty cannot get the tty path of a second specified pty serial, since right now it always returns the tty path of serial 0.

---
v2: Rename the patch title.

---
 tools/libxl/libxl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl.c +1 -1
index 2cf7451..00af286 100644
@@ -1795,7 +1795,7 @@ int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num,
 
     switch (type) {
     case LIBXL_CONSOLE_TYPE_SERIAL:
-        tty_path = GCSPRINTF("%s/serial/0/tty", dom_path);
+        tty_path = GCSPRINTF("%s/serial/%d/tty", dom_path, cons_num);
         break;
     case LIBXL_CONSOLE_TYPE_PV:
         if (cons_num == 0)
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v2 1/1
#1 lore raw
Quoted 5 lines · Bob Liu

When specifying a serial list in domain config, users of libxl_console_get_tty cannot get the tty path of a second specified pty serial, since right now it always returns the tty path of serial 0.

Ian, I think this is a backport candidate.

Quoted 22 lines

---
v2: Rename the patch title.

---
 tools/libxl/libxl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl.c +1 -1
index 2cf7451..00af286 100644
@@ -1795,7 +1795,7 @@ int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num,
 
     switch (type) {
     case LIBXL_CONSOLE_TYPE_SERIAL:
-        tty_path = GCSPRINTF("%s/serial/0/tty", dom_path);
+        tty_path = GCSPRINTF("%s/serial/%d/tty", dom_path, cons_num);
         break;
     case LIBXL_CONSOLE_TYPE_PV:
         if (cons_num == 0)
Signature · 1 line
1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 11 lines · Wei Liu
Quoted 5 lines · Bob Liu

When specifying a serial list in domain config, users of libxl_console_get_tty cannot get the tty path of a second specified pty serial, since right now it always returns the tty path of serial 0.

Ian, I think this is a backport candidate.

Pushed.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Applied
#3 lore raw

Wei Liu writes ("Re: [PATCH v2] libxl: return any serial tty path in libxl_console_get_tty"):

Quoted 2 lines · Wei Liu
Quoted 1 line

Ian, I think this is a backport candidate.

Queued, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel