Since this cannot automatically recover from a crashed QEMU client with an RBD image, perhaps this RBD locking should not default to enabled. Additionally, this will conflict with the "exclusive-lock" feature available since the Ceph Hammer-release since both utilize the same locking construct.
As a quick background, the optional exclusive-lock feature can be enabled/disabled on image and safely/automatically handles the case of recovery from a crashed client. Under normal conditions, the RBD exclusive-lock feature automatically acquires the lock upon the first attempt to write to the image and transparently transitions ownership of the lock between two or more clients -- used for QEMU live-migration.
I'd be happy to add a new librbd API method to explicitly expose acquiring and releasing the RBD exclusive lock since it certainly solves a couple compromises in our current QEMU integration.