From: Anthony PERARD Subject: [PATCH] libxl: Avoid returning empty path from libxl_console_get_tty Date: Thu, 15 Jan 2015 17:55:56 +0000 Message-ID: <1421344556-15716-1-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Anthony PERARD , Wei Liu , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org This could happen if xenconsoled have not populate the xenstore key yet. Signed-off-by: Anthony PERARD --- CC: Ian Jackson CC: Ian Campbell CC: Wei Liu --- tools/libxl/libxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 50a8928..83fcf30 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1731,7 +1731,7 @@ int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num, } tty = libxl__xs_read(gc, XBT_NULL, tty_path); - if (!tty) { + if (!tty || tty[0] == '\0') { LOGE(ERROR,"unable to read console tty path `%s'",tty_path); rc = ERROR_FAIL; goto out; -- Anthony PERARD