-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
bpo-27584: New addition of vSockets to the python socket module #2489
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
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2f7bdaa
bpo-27584: New addition of vSockets to the python socket module
caavery bec6612
bpo-27584: Fixes for V2
caavery c3027e5
bpo-27584: Fixes for V3
caavery d11a8db
bpo-27584: Fixes for V4
caavery ce380ae
bpo-27584: Fixes for V5
caavery 0f653c6
bpo-27584: Fixes for V6
caavery 42026f3
bpo-27584: Fixes for V7
caavery c3a9490
bpo-27584: Fixes for V8
caavery File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-27584: Fixes for V6
Added news file. socket.rst now reflects first Linux introduction of AF_VSOCK. Fixed get_cid in test_socket.py. Replaced PyLong_FromLong with PyLong_FromUnsignedLong in socketmodule.c Got rid of extra AF_VSOCK #define. Added sockaddr_vm to sock_addr.
- Loading branch information
commit 0f653c65ff30396f69d499218699ef1d5a036fd3
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2017-08-24-14-03-14.bpo-27584.r11JHZ.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ``AF_VSOCK`` has been added to the socket interface which allows | ||
| communication between virtual machines and their host. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,9 +109,6 @@ typedef int socklen_t; | |
|
|
||
| #ifdef HAVE_LINUX_VM_SOCKETS_H | ||
| # include <linux/vm_sockets.h> | ||
| # ifndef AF_VSOCK | ||
| # define AF_VSOCK 40 | ||
| # endif | ||
| #else | ||
| # undef AF_VSOCK | ||
| #endif | ||
|
|
@@ -202,6 +199,9 @@ typedef union sock_addr { | |
| #ifdef HAVE_SOCKADDR_ALG | ||
| struct sockaddr_alg alg; | ||
| #endif | ||
| #ifdef HAVE_LINUX_VM_SOCKETS_H | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please be consistent and use |
||
| struct sockaddr_vm vm; | ||
| #endif | ||
| } sock_addr_t; | ||
|
|
||
| /* The object holding a socket. It holds some extra information, | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think
#undef AF_VSOCKis necessary. Please remove it.Uh oh!
There was an error while loading. Please reload this page.
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.
It needs to be there. In the case that vm_sockets.h is not available in include/linux which is the case on the last build bot run. Not all of the bots have the newer kernel.That way the code dependent on vm_sockets.h (AF_VSOCK) will not try to compile.
checking for linux/vm_sockets.h... no
This is also the way its done it at the top of socketmodule.h with AF_NETLINK
I also noticed AF_CAN was not adding the #undef AF_CAN in socketmodule.h so I renamed linux/can.h, ran configure and make and sure enough any code conditionally compiling under #ifdef AF_CAN in socketmodule.c failed.