Closed mattysweeps closed 1 month ago
The requirement is reasonable.
Are you fine with C macro defined by autoconf with AC_ARG_WITH or AC_ARG_ENABLE for overriding the default name of "/dev/ublk-control" ?
A C macro would work but a runtime configuration option like #75 would be more flexible and open up more opportunities such as:
This morning I realized I need to tweak #75 because there's another C macro in include/ublksrv_priv.h
.
/* todo: relace the hardcode name with /dev/char/maj:min */
#define UBLKC_DEV "/dev/ublkc"
So for now a C macro is probably the better approach, and runtime configuration options can be revisited if/when more flexibility is needed.
ublksrv_cmd.c hard codes the filename of the ublk control device with
#define CTRL_DEV "/dev/ublk-control"
.While this works for almost all use cases, some users might mount devtmpfs somewhere else, such as
/mnt/devtmpfs/
. This means the control device is actually/mnt/devtmpfs/ublk-control
.One solution would be to add an optional field to
struct ublksrv_dev_data
so users who callublksrv_ctrl_init()
can set the appropriate filename.