Skip to contentSkip to conversation

tools: libxl: check errors from libxl_create_logfile for stubdom log

PATCH In review Ian Campbell 2 participants 3 messages Jul 15, 2015 – Jul 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: libxl: check errors from libxl_create_logfile for stubdom log

Spotted by Coverity after the recent similar fix to libxl__create_qemu_logfile.

---
 tools/libxl/libxl_dm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxl/libxl_dm.c +2 -1
index f9911ac..36deb2c 100644
@@ -1257,7 +1257,8 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             case STUBDOM_CONSOLE_LOGGING:
                 name = libxl__sprintf(gc, "qemu-dm-%s",
                                       libxl_domid_to_name(ctx, guest_domid));
-                libxl_create_logfile(ctx, name, &filename);
+                ret = libxl_create_logfile(ctx, name, &filename);
+                if (ret) goto out;
                 console[i].output = libxl__sprintf(gc, "file:%s", filename);
                 free(filename);
                 break;
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ian Campbell

Spotted by Coverity after the recent similar fix to libxl__create_qemu_logfile.

Quoted 20 lines
---
 tools/libxl/libxl_dm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxl/libxl_dm.c +2 -1
index f9911ac..36deb2c 100644
@@ -1257,7 +1257,8 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
             case STUBDOM_CONSOLE_LOGGING:
                 name = libxl__sprintf(gc, "qemu-dm-%s",
                                       libxl_domid_to_name(ctx, guest_domid));
-                libxl_create_logfile(ctx, name, &filename);
+                ret = libxl_create_logfile(ctx, name, &filename);
+                if (ret) goto out;
                 console[i].output = libxl__sprintf(gc, "file:%s", filename);
                 free(filename);
                 break;
Signature · 1 line
2.1.4