Skip to content
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

feat(socket_listener): Add vsock support to socket listener and writer #14172

Merged
merged 19 commits into from
Oct 25, 2023
Merged

feat(socket_listener): Add vsock support to socket listener and writer #14172

merged 19 commits into from
Oct 25, 2023

Conversation

ke55ler
Copy link
Contributor

@ke55ler ke55ler commented Oct 24, 2023

resolves #6382

Added virtual socket (vsock) support to the inputs.socket_listener and outputs.socket_writer plugins
So far I could find out, it is not possible to create a vsock listener on the host and write to the same virtual socket from the host, you have to connect from a virtual machine, therefore I have not included additional unit tests

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Oct 24, 2023
@srebhan srebhan changed the title feat(inputs.socket_listener/outputs.socket_listener): add vsock support to socket listener and writer feat(socket_listener): Add vsock support to socket listener and writer Oct 24, 2023
@srebhan srebhan added plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Oct 24, 2023
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the nice feature @ke55ler! Just some small comments regarding comments. :-)


addrTuple := strings.SplitN(u.String(), ":", 2)

//check if address string has two tokens
Copy link
Member

Choose a reason for hiding this comment

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

Please leave a space between // and the comment as otherwise this might be interpreted as a comment targetted for a machine/go directive...

Suggested change
//check if address string has two tokens
// Check address string for containing two tokens

Comment on lines 98 to 100
//parse CID and port number from address string
// CID and port numner are 32 bit
// source: https://man7.org/linux/man-pages/man7/vsock.7.html
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Suggested change
//parse CID and port number from address string
// CID and port numner are 32 bit
// source: https://man7.org/linux/man-pages/man7/vsock.7.html
// Parse CID and port number from address string both being 32-bit
// source: https://man7.org/linux/man-pages/man7/vsock.7.html

if spl[0] == "vsock" {
addrTuple := strings.SplitN(spl[1], ":", 2)

//check if address string has two tokens
Copy link
Member

Choose a reason for hiding this comment

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

See comment on input

Suggested change
//check if address string has two tokens
// Check address string for containing two tokens

Comment on lines 70 to 72
//parse CID and port number from address string
// CID and port numner are 32 bit
// source: https://man7.org/linux/man-pages/man7/vsock.7.html
Copy link
Member

Choose a reason for hiding this comment

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

See comment on input

Suggested change
//parse CID and port number from address string
// CID and port numner are 32 bit
// source: https://man7.org/linux/man-pages/man7/vsock.7.html
// Parse CID and port number from address string both being 32-bit
// source: https://man7.org/linux/man-pages/man7/vsock.7.html

@srebhan srebhan self-assigned this Oct 24, 2023
@telegraf-tiger
Copy link
Contributor

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@powersj powersj merged commit 4e84fc8 into influxdata:master Oct 25, 2023
@github-actions github-actions bot added this to the v1.29.0 milestone Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants