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

feat(ovfs): add filesystem to handle message #4720

Merged
merged 13 commits into from
Jun 27, 2024

Conversation

zjregee
Copy link
Member

@zjregee zjregee commented Jun 12, 2024

No description provided.

@zjregee zjregee changed the title feat: add server to handle message feat(ovfs): add server to handle message Jun 12, 2024
@zjregee zjregee changed the title feat(ovfs): add server to handle message feat(ovfs): add filesystem to handle message Jun 13, 2024
}

impl TryFrom<u32> for Opcode {
type Error = ();
Copy link
Member

Choose a reason for hiding this comment

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

Use () as error doesn't look good to me.

/// InHeader represents the incoming message header in the filesystem call.
#[repr(C)]
#[derive(Debug, Default, Clone, Copy)]
pub struct InHeader {
Copy link
Member

Choose a reason for hiding this comment

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

This is a pub struct, how about adding comments for every field?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't found any official documentation describing what each field here means, and now each field here is just a reference to virtiofsd.

In addition, all structs here will only be used internally and will not be exposed to users. I'll add a link to virtiofsd, or I can add explanations for the fields I use.

Copy link
Member

Choose a reason for hiding this comment

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

In addition, all structs here will only be used internally and will not be exposed to users.

Hi, I'd like comments here to make our lives easier. As time passes, we might forget what these fields mean. Leaving comments can save readers a lot of time by reducing guesswork.

I'll add a link to virtiofsd, or I can add explanations for the fields I use.

Adding a link to virtiofsd is enough. And adding explanations for used fields will be very helpful.

out: Option<T>,
data: Option<&[u8]>,
unique: u64,
mut w: Writer,
Copy link
Member

Choose a reason for hiding this comment

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

How about make reply_ok a function of Writer? Does this idea make sense?

Copy link
Member Author

@zjregee zjregee Jun 22, 2024

Choose a reason for hiding this comment

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

It seems unnecessary. If I add a function called write_objs to the writer, I still need to encapsulate a reply_ok in the filesystem. If I move reply_ok directly to the writer, it will introduce certain semantics that the writer does not need to be aware of.

I now put both methods reply_ok reply_error inside the filesystem.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, we can refactor this part while ovfs is ready to use.

@zjregee
Copy link
Member Author

zjregee commented Jun 25, 2024

Hi, @Xuanwo, it's ready for review now.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks, let's move!

@Xuanwo Xuanwo merged commit 6c657a8 into apache:main Jun 27, 2024
25 checks passed
@zjregee zjregee deleted the ovfs-add-server branch June 27, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants