Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 492109 Details for
Bug 684646
vpdupdate errors in install.log.syslog
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
Patch to fix the bogus entries in lsvpd
lsvpd-1.6.10-fix-device-scan.diff (text/plain), 4.08 KB, created by
IBM Bug Proxy
on 2011-04-14 13:41:27 UTC
(
hide
)
Description:
Patch to fix the bogus entries in lsvpd
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2011-04-14 13:41:27 UTC
Size:
4.08 KB
patch
obsolete
>Index: lsvpd-1.6.10.org/src/include/sysfstreecollector.hpp >=================================================================== >--- lsvpd-1.6.10.org.orig/src/include/sysfstreecollector.hpp >+++ lsvpd-1.6.10.org/src/include/sysfstreecollector.hpp >@@ -134,6 +134,8 @@ namespace lsvpd > Component * getInitialDetails(const string&, const string&); > void findDevices(vector<Component*>&, const string&, const string&); > void findDevicePaths(vector<Component*>&); >+ int isDevice(const string& devDir); >+ int findDevice(const string& devName); > string getDevTreePath(string sysPath); > string getClassLink( const string& sysDir ); > string getClassLink( const Component* comp ); >Index: lsvpd-1.6.10.org/src/internal/sys_interface/sysfstreecollector.cpp >=================================================================== >--- lsvpd-1.6.10.org.orig/src/internal/sys_interface/sysfstreecollector.cpp >+++ lsvpd-1.6.10.org/src/internal/sys_interface/sysfstreecollector.cpp >@@ -578,6 +578,43 @@ namespace lsvpd > } > > /** >+ * isDevice >+ * @brief Check if the dir corresponds to a device by checking if it has >+ * a "uevent" file in it. >+ * @param deviceDir Path to the sysfs directory >+ * @return True if the dir represents a device, else false. >+ */ >+ int SysFSTreeCollector::isDevice(const string& deviceDir) >+ { >+ struct stat statBuf; >+ string tmp = deviceDir + "/uevent"; >+ >+ return !stat(tmp.c_str(), &statBuf); >+ } >+ >+ /** >+ * filterDevice >+ * @brief Filter the nodes which need not be listed in VPD. >+ * As of now here is the list of excluded nodes : >+ * host[0-9]+ >+ * target[0-9]+ >+ * >+ * @param devName - device name >+ * @return True if this device needs to be added. >+ * TODO: Use regex for scalability >+ */ >+ int SysFSTreeCollector::filterDevice(const string& devName) >+ { >+ int id; >+ const char *s = devName.c_str(); >+ >+ if ((sscanf(s, "target%d", &id) == 1) || >+ (sscanf(s, "host%d", &id) == 1)) >+ return 0; >+ return 1; >+ } >+ >+ /** > * findDevices > * @brief Starting at a device, recursively search for and fill out any > * child devices. >@@ -593,42 +630,28 @@ namespace lsvpd > string newDevDir; > vector<string> listing; > Component *tmpDev; >- string tmp; >+ string tmp, devName; > int tmp_count = 0; > > fsw.fs_getDirContents(searchDir, 'd', listing); > while (listing.size() > 0) > { >- newDevDir = searchDir + "/" + listing.back(); >+ devName = listing.back(); >+ newDevDir = searchDir + "/" + devName; > listing.pop_back(); > >- /* If dir entry is a directory, it must be a device */ >+ /* If dir entry is a directory, it may be a device */ > if (FSWalk::fs_isDir(newDevDir)) { > >- /* if device is shown to NOT be a physical device, do not >- * add to vector */ >- tmp = getAttrValue(newDevDir , "phys_device" ); >- if (tmp[0] == '0') >- continue; > /* Last check - if dir == one of a few known to exist for > * each device, this is not a new device */ >- tmp = newDevDir; >- int lastSlash = tmp.rfind("/", tmp.length()) + 1; >- >- tmp = tmp.substr(lastSlash, tmp.length() - lastSlash); >- if ((tmp == "power") >- || (tmp == "id") >- || (tmp == "topology") >- || (tmp == "statistics") >- || (tmp == "capabilities")) >- continue; >- >- tmp_count++; >- /* Found device */ >- tmpDev = getInitialDetails(parentDir, newDevDir); >- devs.push_back(tmpDev); >- /* Find child devices */ >- findDevices(devs, newDevDir, newDevDir); >+ if (isDevice(newDevDir) && filterDevice(devName)) { >+ /* Found device */ >+ tmpDev = getInitialDetails(parentDir, newDevDir); >+ devs.push_back(tmpDev); >+ findDevices(devs, newDevDir, newDevDir); >+ } else >+ findDevices(devs, parentDir, newDevDir); > } > } > } >@@ -658,8 +681,12 @@ namespace lsvpd > fsw.fs_getDirContents("/sys/devices", 'd', fullList); > while (fullList.size() > 0 ) > { >- curPath = "/sys/devices/" + fullList.back(); >+ devPath = fullList.back(); > fullList.pop_back(); >+ /* Skip the virtual devices */ >+ if (devPath == "virtual") >+ continue; >+ curPath = "/sys/devices/" + devPath; > if (FSWalk::fs_isDir(curPath)) { > findDevices(devs, "", curPath); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 684646
:
484063
|
484064
| 492109