exit(EINVAL);
}
- xs = xs_daemon_open();
+ xs = xs_open(0);
if (xs == NULL) {
err(errno, "Could not contact XenStore");
}
bool xen_setup(void)
{
- xs = xs_daemon_open();
+ xs = xs_open(0);
if (xs == NULL) {
dolog(LOG_ERR,
"Failed to contact xenstore (%m). Is it running?");
out:
if (xs)
- xs_daemon_close(xs);
+ xs_close(xs);
if (xc)
xc_interface_close(xc);
return false;
rc = ERROR_FAIL; goto out;
}
- ctx->xsh = xs_daemon_open();
- if (!ctx->xsh)
- ctx->xsh = xs_domain_open();
+ ctx->xsh = xs_open(0);
if (!ctx->xsh) {
LOGEV(ERROR, errno, "cannot connect to xenstore");
rc = ERROR_FAIL; goto out;
if (ctx->xch) xc_interface_close(ctx->xch);
libxl_version_info_dispose(&ctx->version_info);
- if (ctx->xsh) xs_daemon_close(ctx->xsh);
+ if (ctx->xsh) xs_close(ctx->xsh);
if (ctx->xce) xenevtchn_close(ctx->xce);
libxl__poller_put(ctx, ctx->poller_app);
unsigned int num;
char **l = NULL;
- xsh = xs_daemon_open();
+ xsh = xs_open(0);
if (xsh == NULL) {
LOG(ERROR, "Unable to open xenstore connection");
goto err;
free(p);
xs_unwatch(xsh, path, path);
- xs_daemon_close(xsh);
+ xs_close(xsh);
return rc;
again:
free(p);
LOG(ERROR, "%s not ready", what);
xs_unwatch(xsh, path, path);
- xs_daemon_close(xsh);
+ xs_close(xsh);
err:
return -1;
}
int rc;
assert(!CTX->xsh);
- CTX->xsh = xs_daemon_open();
+ CTX->xsh = xs_open(0);
if (!CTX->xsh) {
LOGE(ERROR, "%s: xenstore reopen failed", what);
rc = ERROR_FAIL; goto out;
return NULL;
}
- handle->xshandle = xs_daemon_open_readonly(); /* open handle to xenstore*/
+ handle->xshandle = xs_open(0); /* open handle to xenstore*/
if (handle->xshandle == NULL) {
perror("unable to open xenstore");
xc_interface_close(handle->xc_handle);
for (i = 0; i < NUM_COLLECTORS; i++)
collectors[i].uninit(handle);
xc_interface_close(handle->xc_handle);
- xs_daemon_close(handle->xshandle);
+ xs_close(handle->xshandle);
free(handle->priv);
free(handle);
}
char ref[16];
char* domid_str = NULL;
xs_transaction_t xs_trans = XBT_NULL;
- xs = xs_domain_open();
+ xs = xs_open(0);
if (!xs)
goto fail;
domid_str = xs_read(xs, 0, "domid", NULL);
}
fail_xs_open:
free(domid_str);
- xs_daemon_close(xs);
+ xs_close(xs);
fail:
return ret;
}
ctrl->write.order = ctrl->read.order = 0;
ctrl->is_server = 0;
- xs = xs_daemon_open();
- if (!xs)
- xs = xs_domain_open();
+ xs = xs_open(0);
if (!xs)
goto fail;
out:
if (xs)
- xs_daemon_close(xs);
+ xs_close(xs);
return ctrl;
fail:
libxenvchan_close(ctrl);
if (xch)
xc_interface_close(xch);
if (xs_handle)
- xs_daemon_close(xs_handle);
+ xs_close(xs_handle);
}
/* Never shrink dom0 below 1 GiB */
return 2;
}
- xs_handle = xs_daemon_open();
+ xs_handle = xs_open(0);
if (xs_handle == NULL)
{
perror("Failed to open xenstore connection");
PySequence_SetItem(self->watches, i, Py_None);
}
- xs_daemon_close(xh);
+ xs_close(xh);
self->xh = NULL;
Py_INCREF(Py_None);
&readonly))
goto fail;
- self->xh = (readonly ? xs_daemon_open_readonly() : xs_daemon_open());
+ self->xh = xs_open(0);
if (!self->xh)
goto fail;
static void xshandle_dealloc(XsHandle *self)
{
if (self->xh) {
- xs_daemon_close(self->xh);
+ xs_close(self->xh);
self->xh = NULL;
}
unsigned int plen;
struct xs_handle *xs;
- xs = xs_daemon_open();
+ xs = xs_open(0);
if (!xs)
return -1;
sprintf(path, "/local/domain/%d/memory/target", domid);
memstr = xs_read(xs, XBT_NULL, path, &plen);
- xs_daemon_close(xs);
+ xs_close(xs);
if (!memstr || !plen)
return -1;
static int
xen_setup(void)
{
- xs = xs_daemon_open();
+ xs = xs_open(0);
if (xs == NULL) {
dolog(LOG_ERR,
"Failed to contact xenstore (%s). Is it running?",
out:
if (xs) {
- xs_daemon_close(xs);
+ xs_close(xs);
xs = NULL;
}
return -1;
#ifndef RUN_STANDALONE
daemonize();
#endif
- xs = (struct xs_handle *)xs_daemon_open();
+ xs = xs_open(0);
if ( xs == NULL )
return -1;
if ( write_one_time_battery_info() == 0 )
{
- xs_daemon_close(xs);
+ xs_close(xs);
return -1;
}
wait_for_and_update_battery_status_request();
- xs_daemon_close(xs);
+ xs_close(xs);
return 0;
}