]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-wnbd: optionally handle wnbd adapter restart events
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 16 Nov 2022 11:24:34 +0000 (13:24 +0200)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 24 Mar 2023 08:58:15 +0000 (08:58 +0000)
commit0c25ca656430b4d5280ab7d033495ad8ce4e776c
tree20757f0ff81ca6ebe1604f640ab596da67bbc990
parenta47caa156a4e667d6b9ff7236cc9148ba37ea772
rbd-wnbd: optionally handle wnbd adapter restart events

The WNBD adapter may be reset in certain situations (e.g. driver
upgrade, MS WHQL tests, etc).

We're going to monitor the WNBD adapter using WMI[1] events, restarting
the rbd-wnbd disk mappings whenever necessary. Adapter monitoring can be
enabled by passing the --adapter-monitoring-enabled flag to the service.

This feature is optional for the following reasons:

* it's mainly used during development / driver certification
* we had to use a relatively small polling interval, which might imply
  additional resource usage. WMI quotas also have to be considered.

While at it, we're updating two lambdas that are submitted to thread pools,
avoiding default reference capturing and explicitly specifying the variables
that get copied.

[1] https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/dokan/utils.h
src/include/win32/fs_compat.h
src/tools/rbd_wnbd/CMakeLists.txt
src/tools/rbd_wnbd/rbd_wnbd.cc
src/tools/rbd_wnbd/rbd_wnbd.h
src/tools/rbd_wnbd/wnbd_wmi.cc [new file with mode: 0644]
src/tools/rbd_wnbd/wnbd_wmi.h [new file with mode: 0644]