Commit be987200 authored by SeongJae Park's avatar SeongJae Park Committed by Juergen Gross

xen/xenbus/xen_bus_type: Support will_handle watch callback

This commit adds support of the 'will_handle' watch callback for
'xen_bus_type' users.

This is part of XSA-349

Cc: stable@vger.kernel.org
Signed-off-by: default avatarSeongJae Park <sjpark@amazon.de>
Reported-by: default avatarMichael Kurth <mku@amazon.de>
Reported-by: default avatarPawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 2e85d32b
...@@ -44,6 +44,8 @@ struct xen_bus_type { ...@@ -44,6 +44,8 @@ struct xen_bus_type {
int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename); int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename);
int (*probe)(struct xen_bus_type *bus, const char *type, int (*probe)(struct xen_bus_type *bus, const char *type,
const char *dir); const char *dir);
bool (*otherend_will_handle)(struct xenbus_watch *watch,
const char *path, const char *token);
void (*otherend_changed)(struct xenbus_watch *watch, const char *path, void (*otherend_changed)(struct xenbus_watch *watch, const char *path,
const char *token); const char *token);
struct bus_type bus; struct bus_type bus;
......
...@@ -136,7 +136,8 @@ static int watch_otherend(struct xenbus_device *dev) ...@@ -136,7 +136,8 @@ static int watch_otherend(struct xenbus_device *dev)
container_of(dev->dev.bus, struct xen_bus_type, bus); container_of(dev->dev.bus, struct xen_bus_type, bus);
return xenbus_watch_pathfmt(dev, &dev->otherend_watch, return xenbus_watch_pathfmt(dev, &dev->otherend_watch,
NULL, bus->otherend_changed, bus->otherend_will_handle,
bus->otherend_changed,
"%s/%s", dev->otherend, "state"); "%s/%s", dev->otherend, "state");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment