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: Support creating file with open_file_nonblock #4028

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JonathanWoollett-Light
Copy link
Contributor

Changes

Updates the OpenOptions with .create(true) to support creating a file when if it doesn't exist.

Reason

This also brings the functionality inline with the documentation which notes
Create and opens a File for writing to it.. This improves usability simplifying setting up the logger.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@JonathanWoollett-Light JonathanWoollett-Light added Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Fix Indicates a fix to existing code labels Aug 11, 2023
@JonathanWoollett-Light JonathanWoollett-Light mentioned this pull request Aug 11, 2023
9 tasks
@JonathanWoollett-Light JonathanWoollett-Light force-pushed the create-log-file branch 3 times, most recently from 564f44b to 8f21d19 Compare August 12, 2023 17:13
@codecov
Copy link

codecov bot commented Aug 12, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (9c51dc6) 82.65% compared to head (cd11fe9) 82.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4028      +/-   ##
==========================================
- Coverage   82.65%   82.65%   -0.01%     
==========================================
  Files         221      221              
  Lines       28169    28170       +1     
==========================================
  Hits        23283    23283              
- Misses       4886     4887       +1     
Flag Coverage Δ
4.14-c7g.metal 78.09% <100.00%> (-0.01%) ⬇️
4.14-m5d.metal 79.88% <100.00%> (-0.01%) ⬇️
4.14-m6a.metal 79.02% <100.00%> (-0.01%) ⬇️
4.14-m6g.metal 78.10% <100.00%> (-0.01%) ⬇️
4.14-m6i.metal 79.88% <100.00%> (-0.01%) ⬇️
5.10-c7g.metal 81.04% <100.00%> (-0.01%) ⬇️
5.10-m5d.metal 82.57% <100.00%> (-0.01%) ⬇️
5.10-m6a.metal 81.81% <100.00%> (+<0.01%) ⬆️
5.10-m6g.metal 81.04% <100.00%> (-0.01%) ⬇️
5.10-m6i.metal 82.57% <100.00%> (+<0.01%) ⬆️
6.1-c7g.metal 81.04% <100.00%> (+<0.01%) ⬆️
6.1-m5d.metal 82.57% <100.00%> (-0.01%) ⬇️
6.1-m6a.metal 81.81% <100.00%> (-0.01%) ⬇️
6.1-m6g.metal 81.04% <100.00%> (-0.01%) ⬇️
6.1-m6i.metal 82.57% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/vmm/src/vmm_config/logger.rs 89.23% <ø> (-1.54%) ⬇️
src/vmm/src/vmm_config/metrics.rs 90.00% <ø> (ø)
src/vmm/src/vmm_config/mod.rs 70.58% <100.00%> (+0.43%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Updates the `OpenOptions` with `.create(true)` to support creating a
file when if it doesn't exist. This also brings the functionality
inline with the documentation which notes
`Create and opens a File for writing to it.`. This improves usability
simplifying setting up the logger.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
@JonathanWoollett-Light JonathanWoollett-Light changed the title fix: Support creating file withopen_file_nonblock fix: Support creating file with open_file_nonblock Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Fix Indicates a fix to existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant