int register_xenstore_notifier(struct notifier_block *nb) { int ret = 0; if (is_xenstored_ready()) ret = nb->notifier_call(nb, 0, NULL); else blocking_notifier_chain_register(&xenstore_chain, nb); return ret; }
void xenbus_probe(void *unused) { BUG_ON(!is_xenstored_ready()); /* Enumerate devices in xenstore and watch for changes. */ xenbus_probe_devices(&xenbus_frontend); register_xenbus_watch(&fe_watch); xenbus_backend_probe_and_watch(); /* Notify others that xenstore is up */ blocking_notifier_call_chain(&xenstore_chain, 0, NULL); }
static ssize_t uuid_show(struct hyp_sysfs_attr *attr, char *buffer) { char *vm, *val; int ret; if (!is_xenstored_ready()) return -EBUSY; vm = xenbus_read(XBT_NIL, "vm", "", NULL); if (IS_ERR(vm)) return PTR_ERR(vm); val = xenbus_read(XBT_NIL, vm, "uuid", NULL); kfree(vm); if (IS_ERR(val)) return PTR_ERR(val); ret = sprintf(buffer, "%s\n", val); kfree(val); return ret; }