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

fix read/write when input slice is empty #190

Merged

Conversation

andreeaflorescu
Copy link
Member

@andreeaflorescu andreeaflorescu commented Feb 21, 2022

Summary of the PR

This keeps the vm-memory interface consistent with the standard I/O, returning Ok(0) when the reader/writer is empty.

This PR adds a test on top of #186 and fixes the other issues reported by the CI so we can merge it.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and follow
    the 50/72 git commit rule.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • Any newly added unsafe code is properly documented.

jiangliu
jiangliu previously approved these changes Feb 21, 2022
@andreeaflorescu andreeaflorescu changed the title fix read/write when volatile slice is empty fix read/write when input slice is empty Feb 21, 2022
@andreeaflorescu andreeaflorescu force-pushed the fix_empty_read_write branch 2 times, most recently from 5e332bc to f96635e Compare February 25, 2022 13:52
To keep consistent with the standard library, return ok(0) instead
of out bound error when the slice passed as a parameter for read/write
is empty.

Signed-off-by: Andreea Florescu <[email protected]>
Co-author: [email protected]
@andreeaflorescu
Copy link
Member Author

@bonzini can you take a look? it's a revamp of #186

Copy link

@stsquad stsquad left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@andreeaflorescu andreeaflorescu merged commit 063126b into rust-vmm:main Mar 2, 2022
@andreeaflorescu andreeaflorescu deleted the fix_empty_read_write branch March 2, 2022 08:37
@lauralt lauralt mentioned this pull request Mar 17, 2022
3 tasks
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.

4 participants