Skip to content

CA-309302 Handle some less common cases in direct_copy#88

Merged
edwintorok merged 1 commit into
xapi-project:masterfrom
TimSmithCtx:CA-309302
Feb 5, 2019
Merged

CA-309302 Handle some less common cases in direct_copy#88
edwintorok merged 1 commit into
xapi-project:masterfrom
TimSmithCtx:CA-309302

Conversation

@TimSmithCtx
Copy link
Copy Markdown

The copy wrapper might be handed non-blocking filedescriptors, which
would cause problems. The caller tries not do do that, but it is worth
being robust against it anyway.

Signed-off-by: Tim Smith tim.smith@citrix.com

@edwintorok edwintorok self-requested a review February 4, 2019 15:41
Comment thread src/direct_copy_stubs.c

pfd.fd = fd;
pfd.events = event;
return poll(&pfd, 1, -1);
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.

Since we're fixing EINTR below, what if poll got an EINTR?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fair point. Can just continue in that case.

The copy wrapper might be handed non-blocking filedescriptors, which
would cause problems. The caller tries not do do that, but it is worth
being robust against it anyway.

Signed-off-by: Tim Smith <tim.smith@citrix.com>
Copy link
Copy Markdown
Member

@edwintorok edwintorok left a comment

Choose a reason for hiding this comment

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

Although I prefer having less C code, the EINTR handling here is useful, and I can't spot anything else wrong with the code.
In the future we could investigate whether Lwt_unix.readv/writev could be used instead with Bigarray slices, that should allow us to transfer more than 64k/syscall from OCaml without going through custom C stubs.

@edwintorok edwintorok merged commit 739ef4c into xapi-project:master Feb 5, 2019
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.

2 participants