libxl: return an error if connection to xenstore fails
PATCH 1/1 libxl: return an error if connection to xenstore fails
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1291293181 0
# Node ID 41f894c00dc1c969889a5974be8d05361ac5cec2 # Parent 658a68a831c3c336af505f456b475a9936490b91
libxl: return an error if connection to xenstore fails
Signed-off-by Ian Campbell <[email protected]>
tools/libxl/libxl_device.c +6 -0
@@ -429,6 +429,11 @@ int libxl__wait_for_device_model(libxl_cchar **l =NULL ; xsh =xs_daemon_open (); +if (xsh ==NULL ) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Unable to open xenstore connection" ); + goto err; + } + path =libxl__sprintf (&gc,"/local/domain/0/device-model/%d/state" , domid);xs_watch (xsh, path, path); tv.tv_sec =LIBXL_DEVICE_MODEL_START_TIMEOUT ;
@@ -469,6 +474,7 @@ again:xs_unwatch (xsh, path, path);xs_daemon_close (xsh);LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Device Model not ready" ); +err:libxl__free_all (&gc);return -1 ; }