[dm-devel] RFC: dm-switch target [v3]

Jim_Ramsay at DELL.com Jim_Ramsay at DELL.com
Wed Nov 2 16:36:19 UTC 2011


Mike Snitzer wrote:
> On Fri, Oct 21 2011 at  4:22pm -0400, Jim Ramsay <jim_ramsay at dell.com> wrote:
> > - Added a sysfs file so userland applications can easily check the version of
> >   this module.
> 
> One would hope that this "version" file isn't needed.  DM already provides
> the ability to query the version of targets via the DM_LIST_VERSIONS dm-
> ioctl.  
...
> But we don't have the ability to ask for a specific target's version.
> 
> (lvm2's tools/dmsetup.c:_targets() illustrates how to collect the targets and
> access their versions -- would require linking against libdm).

Thanks very much for the feedback, Mike.

This sysfs 'version' file is more for userland utilities so they know what version of the netlink message is spoken by the kernel piece.  Since it is related to the netlink socket specifically, it made sense to add it alongside the existing '/sys/module/dm_switch/familyid', so there's easy one-stop-shopping for everything that userland needs to use out the netlink interface.

We certainly could use dmsetup or libdm for the same purpose, but is there much harm in having this version file in sysfs?

> But we could add a --target flag to dmsetup targets (like 'dmsetup ls'
> allows), e.g.: dmsetup targets --target switch

I agree that this would be a valuable addition to dmsetup, but keeping the version file in sysfs would have the benefit of the one-stop-shopping I mention above, as well as not requiring a specific version of the dmsetup tool to be present for userland programs to easily locate the information they require.

-- 
Jim Ramsay




More information about the dm-devel mailing list