libxl: Fix libxl__get_domid error reporting
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Jun 2015 17:02:40 +0000 (18:02 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Jun 2015 15:53:51 +0000 (16:53 +0100)
Make it log something if the xenstore path does not exist.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
v4: New patch in this version of the series.

tools/libxl/libxl.c

index 37069b79be74cb9789cee1527a5e8822ba4a6e1b..e9a2d26b41f10ee0bdcea92ca9e752cad7ebf688 100644 (file)
@@ -1962,8 +1962,10 @@ int libxl__get_domid(libxl__gc *gc, uint32_t *domid)
     const char *xs_domid;
 
     rc = libxl__xs_read_checked(gc, XBT_NULL, DOMID_XS_PATH, &xs_domid);
-    if (rc || !xs_domid) {
-        rc = rc ? rc : ERROR_FAIL;
+    if (rc) goto out;
+    if (!xs_domid) {
+        LOG(ERROR, "failed to get own domid (%s)", DOMID_XS_PATH);
+        rc = ERROR_FAIL;
         goto out;
     }