libxl: return any serial tty path in libxl_console_get_tty
authorBob Liu <bob.liu@oracle.com>
Thu, 4 Aug 2016 01:07:56 +0000 (09:07 +0800)
committerWei Liu <wei.liu2@citrix.com>
Fri, 5 Aug 2016 09:37:14 +0000 (10:37 +0100)
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.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c

index 7bd3e8ccac802ec4a710df254728dfaa74a87542..1de293b5d0f530fdd36b6e7671b0a8773dd50a05 100644 (file)
@@ -1786,7 +1786,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)