On Fri, Jun 3, 2016 at 4:48 AM, Fam Zheng <f...@redhat.com> wrote: > +typedef enum { > + /* The values are ordered so that lower number implies higher > restriction. > + * Starting from 1 to make 0 an invalid value. > + * */ > + BDRV_LOCKF_EXCLUSIVE = 1, > + BDRV_LOCKF_SHARED, > + BDRV_LOCKF_UNLOCK, > +} BdrvLockfCmd; > +
We started to talk about new APIs in librbd to support this feature where we don't need to worry about admin action should QEMU crash while holding the lock. Any chance for separating the UNLOCK enum into the exclusive vs shared case? We could do some magic in the rbd block driver to guess how it was locked but it seems like it would be cleaner (at least for us) to explicitly call out what type of unlock you are requesting since it will involve different API methods. -- Jason