[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] libxl: Avoid returning empty path from libxl_console_get_tty



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

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

---
CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.