Stefan de Konink wrote:
snprintf(sysfs_path, PATH_MAX,
"/sys/class/iscsi_session/session%s/device/"
"target%d:%d:%d/%d:%d:%d:%d/block",
session, target, channel, id, target, channel, id, lun);
xen01 5:0:0:1 # pwd
/sys/class/iscsi_session/session5/device/target5:0:0/5:0:0:1
xen01 5:0:0:1 # ls -l
total 0
lrwxrwxrwx 1 root root 0 May 14 13:14 block:sdd ->
../../../../../../block/sdd
Ug. Yeah, that will do it. What kernel version are you running that your sysfs
looks like that?
It seems we have been shoved into a corner; we can't rely on the output of the
iscsiadm tools, since we have already seen those change between versions. And
apparently we can't rely on sysfs paths to stay stable either. Either we need
some iscsiadm command with a known, stable output that we can call, or we need
some sort of iSCSI API that we can call to get this information. Either way, I
think we need help from the iSCSI people, because the current position seem to
be untenable.
Chris Lalancette