iSCSI/CAM & tags
Danny Braniss
danny at cs.huji.ac.il
Thu Oct 13 09:47:09 PDT 2005
I need to 'syncronize' the discovery of devices on the target with
the iscsi module so that is can set the tag opening size. At the
moment im doing this in the user mode control (iscontrol) with
a sleep.
...
sleep(5);
// this call will return the needed info:
// cam_id, target_id, nluns, luns[].
if(ioctl(sess->fd, ISCSIGETCAM, &sess->cam) != 0) {
syslog(LOG_WARNING, "ISCSIGETCAM failed: %d", errno);
return;
}
...
while(sess->camdev == NULL) {
sess->camdev = cam_open_btl(sess->cam.path_id,
sess->cam.target_id,
sess->cam.target_lun[i], O_RDWR,
NULL);
if(sess->camdev != NULL) {
if(count-- == 0) {
syslog(LOG_WARNING, "%s", cam_errbuf);
debug(3, "%s", cam_errbuf);
return;
}
}
sleep(1);
}
There must be a better way.
any ideas are welcomed.
danny
More information about the freebsd-scsi
mailing list