summaryrefslogtreecommitdiff
path: root/hw/xen_backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xen_backend.c')
-rw-r--r--hw/xen_backend.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 2673ace185..66cb144397 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -592,7 +592,7 @@ static void xenstore_update_be(char *watch, char *type, int dom,
struct XenDevOps *ops)
{
struct XenDevice *xendev;
- char path[XEN_BUFSIZE], *dom0;
+ char path[XEN_BUFSIZE], *dom0, *bepath;
unsigned int len, dev;
dom0 = xs_get_domain_path(xenstore, 0);
@@ -611,15 +611,16 @@ static void xenstore_update_be(char *watch, char *type, int dom,
return;
}
- if (0) {
- /* FIXME: detect devices being deleted from xenstore ... */
- xen_be_del_xendev(dom, dev);
- }
-
xendev = xen_be_get_xendev(type, dom, dev, ops);
if (xendev != NULL) {
- xen_be_backend_changed(xendev, path);
- xen_be_check_state(xendev);
+ bepath = xs_read(xenstore, 0, xendev->be, &len);
+ if (bepath == NULL) {
+ xen_be_del_xendev(dom, dev);
+ } else {
+ free(bepath);
+ xen_be_backend_changed(xendev, path);
+ xen_be_check_state(xendev);
+ }
}
}