I tried to test some recovery code but struggle on what it is supposed to do.
And also for example, why the special handling for unprivileged devices:
#define ublk_un_privileged_prep_data(dev, data) \
char buf[UBLKC_PATH_MAX]; \
if (ublk_is_unprivileged(dev)) { \
snprintf(buf, UBLKC_PATH_MAX, "%s%d", UBLKC_DEV, \
dev->dev_info.dev_id); \
data.flags |= CTRL_CMD_HAS_BUF | CTRL_CMD_HAS_DATA; \
data.len = sizeof(buf); \
data.dev_path_len = UBLKC_PATH_MAX; \
data.addr = (__u64)buf; \
}
I want to make sure I understand what the recover code does and how to use it.
Can you add some text explaining recovery, what scenarios it is supposed to cover, how it works and how to use it?
I can later re-work it and add it to the manpage once I understand it.
(An initial test starting a loop device, killing the target with kill -9 and trying ublk recover -n 0 did not work as I expected it would).
regards
ronnie sahlberg