mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: return an error if connection to xenstore fails
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
af14d5a195
commit
c17ffaf89f
1 file changed
+6
@@ -429,6 +429,11 @@ int libxl__wait_for_device_model(libxl_ctx *ctx,
|
||||
char **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;
|
||||
}
|
||||
|
||||