]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/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)
committerJuergen Gross <jgross@suse.com>
Mon, 14 Dec 2020 09:05:47 +0000 (10:05 +0100)
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>
drivers/xen/xenbus/xenbus.h
drivers/xen/xenbus/xenbus_probe.c

index 5f5b8a7d5b80b998425dfcd5cc900d5ba4855c2e..2a93b7c9c159929557f845c549b7f7676efd3a11 100644 (file)
@@ -44,6 +44,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 *path, const char *token);
        void (*otherend_changed)(struct xenbus_watch *watch, const char *path,
                                 const char *token);
        struct bus_type bus;
index 4c3d1b84aa0a32d2f60fae0317fbd28ab92df995..44634d970a5ca1f3bb4b0a1278e245121cd69135 100644 (file)
@@ -136,7 +136,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");
 }