On 22/08/2017 16:34, Marc-André Lureau wrote: > Could this be handled by udisk? It seems at first the problem is not > specific to qemu.
Yes, possibly. In practice, everybody else who uses persistent reservations seems to run as root. :) >> +static void usage(const char *name) >> +{ >> + (printf) ( > Why '(printf)' ? I noticed qemu-nbd use this too. > It lets you use #ifdef inside the argument list. >> >> + /* Stash one file descriptor per request. */ >> + if (nfds) { >> + for (i = 0; i < nfds; i++) { >> + if (client->fd == -1) { >> + client->fd = fds[i++]; >> + } else { >> + close(fds[i]); > > Isn't this a condition to close the client? Yes, though I still have to go through the descriptors and close them. Paolo