]> xenbits.xensource.com Git - xen.git/commit
tools/console: xenconsole tolerate tty errors
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 27 Feb 2014 17:46:49 +0000 (17:46 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 20 Oct 2015 16:53:54 +0000 (17:53 +0100)
commit2ddcdd96a0996fe755c6a9ba08182925c57ea412
treecdef59309ed3d4f13d444f331550e67de74688d0
parent998424e33db121270690586320e899a03c88b4aa
tools/console: xenconsole tolerate tty errors

Since 28d386fc4341 (XSA-57), libxl writes an empty value for the
console tty node, with read-only permission for the guest, when
setting up pv console "frontends".  (The actual tty value is later set
by xenconsoled.)   Writing an empty node is not strictly necessary to
stop the frontend from writing dangerous values here, but it is a good
belt-and-braces approach.

Unfortunately this confuses xenconsole.  It reads the empty value, and
tries to open it as the tty.  xenconsole then exits.

Fix this by having xenconsole treat an empty value the same way as no
value at all.

Also, make the error opening the tty be nonfatal: we just print a
warning, but do not exit.  I think this is helpful in theoretical
situations where xenconsole is racing with libxl and/or xenconsoled.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
---
v2: Combine two conditions and move the free
(cherry picked from commit 39ba2989b10b6a1852e253b204eb010f8e7026f1)
(cherry picked from commit 7b161be2e51c519754ac4435d63c8fc03db606ec)

Conflicts:
tools/console/client/main.c
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/console/client/main.c