diff options
author | SeongJae Park | 2020-12-14 03:05:47 -0600 |
---|---|---|
committer | Greg Kroah-Hartman | 2020-12-30 04:54:27 -0600 |
commit | 6835334e154652858651ac6336e71290e0cc1396 (patch) | |
tree | 8facb5142dabe1d9c820d4391aad5fcd825b7333 | |
parent | 9ae6d2f4ca8aa871cbb9c2ab78e1848177c5641c (diff) | |
download | kernel-6835334e154652858651ac6336e71290e0cc1396.tar.gz kernel-6835334e154652858651ac6336e71290e0cc1396.tar.xz kernel-6835334e154652858651ac6336e71290e0cc1396.zip |
xen/xenbus/xen_bus_type: Support will_handle watch callback
commit be987200fbaceaef340872841d4f7af2c5ee8dc3 upstream.
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: SeongJae Park <sjpark@amazon.de>
Reported-by: Michael Kurth <mku@amazon.de>
Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/xen/xenbus/xenbus.h | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h index 5f5b8a7d5b80..2a93b7c9c159 100644 --- a/drivers/xen/xenbus/xenbus.h +++ b/drivers/xen/xenbus/xenbus.h | |||
@@ -44,6 +44,8 @@ struct xen_bus_type { | |||
44 | int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename); | 44 | int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename); |
45 | int (*probe)(struct xen_bus_type *bus, const char *type, | 45 | int (*probe)(struct xen_bus_type *bus, const char *type, |
46 | const char *dir); | 46 | const char *dir); |
47 | bool (*otherend_will_handle)(struct xenbus_watch *watch, | ||
48 | const char *path, const char *token); | ||
47 | void (*otherend_changed)(struct xenbus_watch *watch, const char *path, | 49 | void (*otherend_changed)(struct xenbus_watch *watch, const char *path, |
48 | const char *token); | 50 | const char *token); |
49 | struct bus_type bus; | 51 | struct bus_type bus; |
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 4c3d1b84aa0a..44634d970a5c 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -136,7 +136,8 @@ static int watch_otherend(struct xenbus_device *dev) | |||
136 | container_of(dev->dev.bus, struct xen_bus_type, bus); | 136 | container_of(dev->dev.bus, struct xen_bus_type, bus); |
137 | 137 | ||
138 | return xenbus_watch_pathfmt(dev, &dev->otherend_watch, | 138 | return xenbus_watch_pathfmt(dev, &dev->otherend_watch, |
139 | NULL, bus->otherend_changed, | 139 | bus->otherend_will_handle, |
140 | bus->otherend_changed, | ||
140 | "%s/%s", dev->otherend, "state"); | 141 | "%s/%s", dev->otherend, "state"); |
141 | } | 142 | } |
142 | 143 | ||