Skip to contentSkip to conversation

libxl: Avoid returning empty path from libxl_console_get_tty

PATCH In review Anthony PERARD 2 participants 2 messages Jan 15, 2015 – Jan 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: Avoid returning empty path from libxl_console_get_tty

This could happen if xenconsoled have not populate the xenstore key yet.

---
CC: Ian Jackson <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Wei Liu <[email protected]>

---
 tools/libxl/libxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl.c +1 -1
index 50a8928..83fcf30 100644
@@ -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;
Signature · 1 line
Anthony PERARD