8000 source: add pciclient crate for high level access to lspci by ytsssun · Pull Request #149 · bottlerocket-os/bottlerocket-core-kit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

source: add pciclient crate for high level access to lspci #149

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

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

ytsssun
Copy link
Contributor
@ytsssun ytsssun commented Sep 13, 2024

Description of changes:
Added crate pciclient to provide a high level helper to query the PCI information and get the device information.

Testing done:
Unit tests.

More tests are done in #141 which uses the crate to call lspci and detect EFA.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@ytsssun ytsssun force-pushed the pciclient branch 3 times, most recently from f630bd2 to b19ea44 Compare September 14, 2024 00:33
@ytsssun ytsssun marked this pull request as ready for review September 14, 2024 00:33
Comment on lines 140 to 143
use bon::Builder;
use derive_getters::Getters;
pub use error::PciClientError;
use private::{call_list_devices, check_efa_attachment, PciClient};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We usually include these at the top.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved the bon and derive_getters and private crate functions deps to top. Looks like for Error and Result related statements, we keep them after the definition of the Error mod. See https://github.com/bottlerocket-os/bottlerocket-core-kit/blob/develop/sources/api/storewolf/src/main.rs#L138-L141

Signed-off-by: Yutong Sun <yutongsu@amazon.com>
Copy link
Contributor
@cbgbt cbgbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor
@yeazelm yeazelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ytsssun ytsssun merged commit fe722a5 into bottlerocket-os:develop Sep 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0