/** * \param dev The NewBus device representing this XenBus bus. * \param child The NewBus device representing a child of dev%'s XenBus bus. */ static void xenbusb_verify_device(device_t dev, device_t child) { if (xs_exists(XST_NIL, xenbus_get_node(child), "") == 0) { /* * Device tree has been removed from Xenbus. * Tear down the device. */ xenbusb_delete_child(dev, child); } }
int generic_remove_xs_entry(struct xs_handle *h, char *path) { int ret = 0; if (xs_exists(h, path)) { if (!xs_rm(h, XBT_NULL, path)) { printf("Failed to remove xs entry %s\n", path); goto out; } } ret = 1; out: return ret; }
int remove_xs_entry(struct xs_handle *h, char *dom_uuid, char *dom_path) { char *path = NULL; int ret = 0; if (asprintf(&path, "/vss/%s/%s",dom_uuid, dom_path)==-1) goto out; if (xs_exists(h, path)) { if (!xs_rm(h, XBT_NULL, path)) { printf("Failed to remove xs entry %s\n", path); goto out; } } ret = 1; out: free(path); return ret; }