Stefan de Konink wrote:
I think if you can get iscsi_sysfs.c; get_block_dev_from_lun you have
the
code already to do this all. So basically get openiscsi into a lib with
helper functions.
OK. I took a look at this further, and I figured out what is going on here.
The original impetus for me to re-write the code in
virStorageBackendISCSIMakeLUN() was because I thought the open-iscsi people had
changed the output of iscsiadm --mode session -r $session -P 3. However, that's
not what actually happened. What actually happened is that the sysfs files that
export this information changed somewhere between 2.6.21 and 2.6.24 (which is
what I was using at the time). So, the code you point to above in open-iscsi
tools *also* doesn't work. That code is expecting the block devices to look
like block:sdd, which is what you have in your 2.6.21 kernel; but in later
kernels, it no longer looks like that.
All that being said, the less we have to depend on parsing, and the more we can
poke around sysfs and get values, the better. So in that sense, the change was
for the better. I've attached a patch which seems to do the right thing on my
2.6.25 based machine; can you test it on 2.6.21 and see if it works?
Chris Lalancette