aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_xshelp.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-11-23 06:59:06 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-11-23 06:59:06 +0000
commitc14ce8a1257fbbc43c4196b186a7677209c6b12e (patch)
treebeb3772633724bc4443868c3abf2f2722358a5f4 /tools/libxl/libxl_xshelp.c
parent3cfaf63e09773f7046e35b9287a94323840fcacf (diff)
downloadxen-c14ce8a1257fbbc43c4196b186a7677209c6b12e.tar.gz
xen-c14ce8a1257fbbc43c4196b186a7677209c6b12e.tar.bz2
xen-c14ce8a1257fbbc43c4196b186a7677209c6b12e.zip
libxenlight: Clean up logging arrangements
* Introduce new variants of the logging functions which include errno values (converted using strerror) in the messages passed to the application's logging callback. * Use the new errno-including logging functions everywhere where appropriate. In general, xc_... functions return errno values or 0; xs_... functions return 0 or -1 (or some such) setting errno. * When libxl_xs_get_dompath fails, do not treat it as an allocation error. It isn't: it usually means xenstored failed. * Remove many spurious \n's from log messages. (The applications log callback is expected to add a \n if it wants to do that, so libxl's logging functions should be passed strings without \n.) Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_xshelp.c')
-rw-r--r--tools/libxl/libxl_xshelp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/libxl/libxl_xshelp.c b/tools/libxl/libxl_xshelp.c
index 6286d02826..f59eee7523 100644
--- a/tools/libxl/libxl_xshelp.c
+++ b/tools/libxl/libxl_xshelp.c
@@ -95,6 +95,11 @@ char * libxl_xs_read(struct libxl_ctx *ctx, xs_transaction_t t, char *path)
char *libxl_xs_get_dompath(struct libxl_ctx *ctx, uint32_t domid)
{
char *s = xs_get_domain_path(ctx->xsh, domid);
+ if (!s) {
+ XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "failed to get dompath for %lu",
+ domid);
+ return NULL;
+ }
libxl_ptr_add(ctx, s);
return s;
}