]> git.itanic.dy.fi Git - linux-stable/commitdiff
xen/xenbus/xen_bus_type: Support will_handle watch callback
authorSeongJae Park <sjpark@amazon.de>
Mon, 14 Dec 2020 09:05:47 +0000 (10:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:42:45 +0000 (13:42 +0100)
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>
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenbus/xenbus_probe.h

index c560c1b8489a0a432e8da6f1378d24562ddf5d67..ba7590d75985e5129490109388e485ff26e349e3 100644 (file)
@@ -137,7 +137,8 @@ static int watch_otherend(struct xenbus_device *dev)
                container_of(dev->dev.bus, struct xen_bus_type, bus);
 
        return xenbus_watch_pathfmt(dev, &dev->otherend_watch,
-                                   NULL, bus->otherend_changed,
+                                   bus->otherend_will_handle,
+                                   bus->otherend_changed,
                                    "%s/%s", dev->otherend, "state");
 }
 
index c9ec7ca1f7ab6f4e3f78099c434d2533f0881b2f..2c394c6ba605ce5f1d880c8c084d191de082b142 100644 (file)
@@ -42,6 +42,8 @@ struct xen_bus_type {
        int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename);
        int (*probe)(struct xen_bus_type *bus, const char *type,
                     const char *dir);
+       bool (*otherend_will_handle)(struct xenbus_watch *watch,
+                                    const char **vec, unsigned int len);
        void (*otherend_changed)(struct xenbus_watch *watch, const char **vec,
                                 unsigned int len);
        struct bus_type bus;