libxl: Avoid returning empty path from libxl_console_get_tty
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.
Signed-off-by Anthony PERARD <[email protected]>
---
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
@@ -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
Quoted 3 lines · Anthony PERARD
This could happen if xenconsoled have not populate the xenstore key yet.
Signed-off-by Anthony PERARD <[email protected]>
Acked + applied, thanks.