-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add PCI device info to ghwc #209
Conversation
Adds a new `ghwc pci` subcommand that lists PCI devices. Deprecates the old PCIInfo.Products, PCIInfo.Classes and PCIInfo.Vendors maps because these are now fully contained in the github.com/jaypipes/pcidb library. ``` [jaypipes@thelio ghw]$ go run cmd/ghwc/main.go pci PCI (45 devices) [jaypipes@thelio ghw]$ go run cmd/ghwc/main.go pci --format yaml | head -n30 pci: Devices: - address: "0000:00:00.0" class: id: "06" name: Bridge product: id: "1450" name: Family 17h (Models 00h-0fh) Root Complex programming_interface: id: "00" name: unknown subclass: id: "00" name: Host bridge subsystem: id: "1450" name: unknown vendor: id: "1022" name: Advanced Micro Devices, Inc. [AMD] - address: "0000:00:00.2" class: id: "08" name: Generic system peripheral product: id: "1451" name: Family 17h (Models 00h-0fh) I/O Memory Management Unit programming_interface: id: "00" ``` Issue #207
@@ -692,31 +692,29 @@ are exposed on the `ghw.PCIInfo` struct. | |||
The `ghw.PCI()` function returns a `ghw.PCIInfo` struct. The `ghw.PCIInfo` | |||
struct contains a number of fields that may be queried for PCI information: | |||
|
|||
* `ghw.PCIInfo.Devices` is a slice of pointers to `ghw.PCIDevice` structs that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not clear to me if calling ListDevices()
is now deprecated or still fully supported. Both approaches works from client perspective. As API consumer I for myself prefer to have functions as part of the APIs (e.g. calling ListDevices() explicitely to get a fresh list of devices) but this is mostly personal taste.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced ListDevices() with a PCIInfo.Devices slice to make the interface match the other "XXXInfo" structs for consistency purposes. I've gone ahead and deprecated the ListDevices exported function and will unexport it in the v1.0 release (as of yet, I don't have a release date target for v1.0 though) :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good with a question inside about the API.
Adds a new
ghwc pci
subcommand that lists PCI devices. Deprecates theold PCIInfo.Products, PCIInfo.Classes and PCIInfo.Vendors maps because
these are now fully contained in the github.com/jaypipes/pcidb library.
Issue #207