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

[Xen-changelog] [xen stable-4.4] tools: libxl: Handle failure to create qemu dm logfile



commit 1749addcc6a213aef9c57ed7e8548d72d475c36f
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Mon Jul 13 13:31:23 2015 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Wed Aug 12 12:26:46 2015 +0100

    tools: libxl: Handle failure to create qemu dm logfile
    
    If libxl_create_logfile fails for some reason then
    libxl__create_qemu_logfile previously just carried on and dereferenced
    the uninitialised logfile.
    
    Check for the error from libxl_create_logfile, which has already
    logged for us.
    
    This was reported as Debian bug #784880.
    
    Reported-by: Russell Coker <russell@xxxxxxxxxxxx>
    Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Cc: 784880@xxxxxxxxxxxxxxx
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    (cherry picked from commit e9d3a859977913704605e0fd87887451b12d4722)
    (cherry picked from commit 9a4c62515c2cac2db23f88957579792b3bdb81b3)
---
 tools/libxl/libxl_dm.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 4dbfddc..d7d2d3b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -45,9 +45,11 @@ static const char *qemu_xen_path(libxl__gc *gc)
 static int libxl__create_qemu_logfile(libxl__gc *gc, char *name)
 {
     char *logfile;
-    int logfile_w;
+    int rc, logfile_w;
+
+    rc = libxl_create_logfile(CTX, name, &logfile);
+    if (rc) return rc;
 
-    libxl_create_logfile(CTX, name, &logfile);
     logfile_w = open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0644);
     free(logfile);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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