]> xenbits.xensource.com Git - xen.git/commitdiff
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)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 15 Aug 2016 10:53:47 +0000 (11:53 +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>
(cherry picked from commit 35dbf099ac18924d40533c9d1b9bfbf1ecb818c9)
(cherry picked from commit 822464961ae1bac44dcabb049255d61d5511e368)
(cherry picked from commit e06d2bae53cb1a3542e7269fd35bf3885dd2e244)

tools/libxl/libxl.c

index 3af4b1e8bb4785ce7c7dca16ff84c115c622e8a6..aa39e78c249c41817af150b976d56e7bdf9125b5 100644 (file)
@@ -1792,7 +1792,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)