libxl: libxl__xs_path_cleanup don't print error if ENOENT
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 26 Jul 2012 09:55:09 +0000 (10:55 +0100)
committerRoger Pau Monne <roger.pau@citrix.com>
Thu, 26 Jul 2012 09:55:09 +0000 (10:55 +0100)
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_xshelp.c

index 7ca17328f97e73d9c34bf07e48c25d08601b79b6..855ac8561185968e86cde9e45bef8ebc3ed27825 100644 (file)
@@ -219,7 +219,8 @@ int libxl__xs_path_cleanup(libxl__gc *gc, xs_transaction_t t, char *user_path)
 
     path = libxl__strdup(gc, user_path);
     if (!xs_rm(CTX->xsh, t, path)) {
-        LOGE(DEBUG, "unable to remove path %s", path);
+        if (errno != ENOENT)
+            LOGE(DEBUG, "unable to remove path %s", path);
         rc = ERROR_FAIL;
         goto out;
     }
@@ -235,7 +236,8 @@ int libxl__xs_path_cleanup(libxl__gc *gc, xs_transaction_t t, char *user_path)
         if (!libxl__xs_directory(gc, t, path, &nb) || nb != 0) break;
 
         if (!xs_rm(CTX->xsh, t, path)) {
-            LOGE(DEBUG, "unable to remove path %s", path);
+            if (errno != ENOENT)
+                LOGE(DEBUG, "unable to remove path %s", path);
             rc = ERROR_FAIL;
             goto out;
         }