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

[Xen-changelog] [xen master] libxl: use LOG instead of LIBXL__LOG in libxl_utils.c



commit b8c22d2eba24e6706e8b2dd73ab306793a7d7d08
Author:     Kelley Nielsen <kelleynnn@xxxxxxxxx>
AuthorDate: Mon Nov 11 15:23:56 2013 -0800
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Tue Nov 19 14:13:43 2013 +0000

    libxl: use LOG instead of LIBXL__LOG in libxl_utils.c
    
    To conform to the new coding style, replace the invocation of
    LIBXL__LOG in the function libxl_pipe() in the file libxl_utils.c
    with an invocation of LOG. Create a local libxl__gc gc* for LOG
    to use by invoking GC_INIT(ctx) at the top of the function, and
    clean it up by invoking GC_FREE at the exit. Create a variable,
    ret, to consolidate exits in one place and avoid invoking GC_FREE
    twice.
    
    Suggested-by: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
    Signed-off-by: Kelley Nielsen <kelleynnn@xxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_utils.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index df98abd..cccec9b 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -478,11 +478,14 @@ int libxl__remove_directory(libxl__gc *gc, const char 
*dirpath)
 
 int libxl_pipe(libxl_ctx *ctx, int pipes[2])
 {
+    GC_INIT(ctx);
+    int ret = 0;
     if (pipe(pipes) < 0) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to create a pipe");
-        return -1;
+        LOG(ERROR, "Failed to create a pipe");
+        ret = -1;
     }
-    return 0;
+    GC_FREE;
+    return ret;
 }
 
 int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
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®.