PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

code with libsysfs functions


Your Ad Here

Your Ad Here

Hi all,

Can somebody please help me understand the code below. I am running it in a RHEL 4.0 (kernel 2.6).

#include "libsysfs.h" .... int slsysfsscanfornewdevices(int ctrlId) { struct sysfsclbutt *sclbuttp; struct sysfsclbuttdevice *scdevp; struct dlist *lcdevp; struct sysfsattribute *sattrp; unsigned int thisadapterhndl; .... .... sclbuttp = sysfsopenclbutt(globalscsihostname); lcdevp = sysfsgetclbuttdevices(sclbuttp); dlistforeachdata(lcdevp, scdevp, struct sysfsclbuttdevice) { hostno = 0;

if (thisadapterhndl != (unsigned int)hostno) other controller continue;

this is the controller we want to rescan sattrp = sysfsgetclbuttdevattr(scdevp, "scan"); sysfswriteattribute(sattrp, "- - -", 5); break; } sysfscloseclbutt(sclbuttp); }

need xp to Linux migration advice
Hi All, I need the group's advice. I am in a situation where I need to create a safer environment than that provided by anti-malware, firewall, and common sense. I am dealing with someone...

I understand most of it: it is trying to get a list of devices in the sysfs filesystem, and for the intended device it is getting the attribute named "scan". But I do not understand the call to sysfswriteattribute. What is it trying to accomplish? I think the attribute "scan" corresponds to the filesys-clbutt-scsihost-host1-scan (is that correct?). What does it actually stand for?

Secondly, as the name suggests, the function is scanning for new SCSI devices. But even after adding a new SCSI device by running this program (and it works because the output of another program shows this newly added device), I am not finding it inproc-scsi-scsi. Am I looking in the right place? Where shall i look to be sure that the device has been added?

I posted this question on comp.unix.programmer, but didn't get any reply. I hope this is not a wrong group for this post. Thanks a lot.



Your Ad Here

List | Previous | Next

need xp to Linux migration advice

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

Old technology