◐ Shell
reader mode source ↗
Skip to content

bpo-27584: New addition of vSockets to the python socket module#2489

Merged
tiran merged 8 commits into
python:masterfrom
caavery:bpo-27584
Sep 6, 2017
Merged

bpo-27584: New addition of vSockets to the python socket module#2489
tiran merged 8 commits into
python:masterfrom
caavery:bpo-27584

Conversation

@caavery

@caavery caavery commented Jun 29, 2017

Copy link
Copy Markdown
Contributor

Support for AF_VSOCK on Linux only

https://bugs.python.org/issue27584

@caavery

caavery commented Jun 29, 2017

Copy link
Copy Markdown
Contributor Author

The patch is also in Issue number 27584 along with a README file that explains how to setup the environment for tests.

@berkerpeksag berkerpeksag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

Thank you for the PR. Could you please add your name to Misc/ACKS?

@berkerpeksag

berkerpeksag commented Jul 7, 2017

Copy link
Copy Markdown
Member

Looks like your branch contains additional commits and unfortunately it makes code review harder. Could you rebase your branch against current master? You might find https://devguide.python.org/gitbootcamp/#syncing-with-upstream helpful.

@caavery

caavery commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag

So you want me to sync my github branch bpo-27584 with the upstream cpython branch? Is that correct? I'm just a little unclear as to what you are asking.

Cathy

@caavery

caavery commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag

Or do you want me to rebase both my master ( fork of upstream ) and my bpo-27584 branch?

Thanks again

@berkerpeksag

Copy link
Copy Markdown
Member

So you want me to sync my github branch bpo-27584 with the upstream cpython branch? Is that correct?

Correct. Your branch bpo-27584 now contains 34 commits and 30 of them are unrelated to the vSockets feature as you can see at https://github.com/python/cpython/pull/2489/files (the reason is probably this merge commit)

@caavery

caavery commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag

Sorry I seem to have an issue.
git fetch upstream
git rebase upstream/master

Python Dev~/caavery.github/cpython# git push origin bpo-27584
To git@github.com:caavery/cpython.git
! [rejected] bpo-27584 -> bpo-27584 (non-fast-forward)
error: failed to push some refs to 'git@github.com:caavery/cpython.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

@caavery

caavery commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

@berkerpeksag

Sorry this is my first time with github and working with remote branches. I just forced the push into my branch bpo-27584. My branch says that 'This branch is 4 commits ahead of python:master. ' which is what I think you wanted.

@berkerpeksag

Copy link
Copy Markdown
Member

My branch says that 'This branch is 4 commits ahead of python:master. ' which is what I think you wanted.

Looks great, thanks! I will try to take another look at the patch while we wait for Kushal's review.

@caavery

caavery commented Jul 19, 2017

Copy link
Copy Markdown
Contributor Author

@kushaldas

Is there anything else I should be doing? The patches have passed all tests so far and I have addressed all the issues raised.

Thanks,

Cathy

@tiran tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

I added some comments.

You also have to add the vsock struct to typedef union sock_addr in socketmodule.h.

Please use blurb to add a news entry, too.

@bedevere-bot

Copy link
Copy Markdown

A Python core developer, tiran, has requested some changes be
made to your pull request before we can consider merging it. If you
could please address their requests along with any other requests in
other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment
on this pull request containing the phrase I didn't expect the Spanish Inquisition!
I will then notify tiran along with any other core developers
who have left a review that you're ready for them to take another look
at this pull request.

@caavery

caavery commented Aug 25, 2017

Copy link
Copy Markdown
Contributor Author

I didn't expect the Spanish Inquisition!

@bedevere-bot

Copy link
Copy Markdown

Nobody expects the Spanish Inquisition!

@kushaldas, @tiran: please review the changes made to this pull request.

@tiran tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

You are almost there!

32 hidden items Load more…
@bedevere-bot

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I didn't expect the Spanish Inquisition!. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@caavery

caavery commented Aug 26, 2017

Copy link
Copy Markdown
Contributor Author

OK there seems to be a problem with the build now. I'll address it next week. Thanks.

@tiran

tiran commented Aug 28, 2017

Copy link
Copy Markdown
Member

You were right, either #undef AF_VSOCK is required or you have to replace all #ifdef AF_VSOCK with #ifdef HAVE_LINUX_VM_SOCKETS_H. The address family and the VM socket struct are defined in different header files. AF_VSOCK can be present w/o linux/vm_sockets.h.

@caavery

caavery commented Sep 5, 2017

Copy link
Copy Markdown
Contributor Author

I didn't expect the Spanish Inquisition!

@bedevere-bot

Copy link
Copy Markdown

Nobody expects the Spanish Inquisition!

@kushaldas, @tiran: please review the changes made to this pull request.

Fixed syntax and naming problems.
Fixed #ifdef AF_VSOCK checking
Restored original aclocal.m4
Added checking for fcntl and thread modules.
Fixed white space error
Added back comma in (CID, port).
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.
Minor cleanup.
Put back #undef AF_VSOCK as it is  necessary when vm_sockets.h is not installed.

@tiran tiran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

LGTM, thanks!

@vstinner

Copy link
Copy Markdown
Member

FYI I wrote PR gh-119463 to skip the tests if get_cid() returns VMADDR_CID_ANY. Apparently, the Linux kernel 6.9 changed /dev/vsock device.

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.