]> git.apps.os.sepia.ceph.com Git - ceph-ci.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 12:34:04 +0000 (12:34 +0000)
commit4ae4379e83be59395a0743ca154a88d0c33400a6
treef9af098c1edecb27b94df817f1cc6bfbb7f537d2
parent6b8b932f5ec038b35070f91022aed595c74a6eef
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>
(cherry picked from commit 0c25ca656430b4d5280ab7d033495ad8ce4e776c)
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]