Skip to content

Conversation

@TimosAmpel
Copy link
Contributor

Summary of the PR

This PR updates the current implementation of vhost-device-console and addresses
the comments noted at the PR #717.

Specifically,

  • Eliminates the use of 'select' function and 'nix' dependency
  • Registers all input FDs to the main worker epoll handler
  • Increases the unit tests' coverage
  • Move the device into the main workspace

Requirements

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@stefano-garzarella
Copy link
Member

Summary of the PR

This PR updates the current implementation of vhost-device-console and addresses the comments noted at the PR #717.

Specifically,

* Eliminates the use of 'select' function and 'nix' dependency

Cool, thanks for that!

* Registers all input FDs to the main worker epoll handler

* Increases the unit tests' coverage

* Move the device into the main workspace

All these steps in one commit?

This list should immediately make it clear that we need at least 3/4 separate commits. Please let's try to have commits as small as possible, also to make it easier for reviewers.

@TimosAmpel TimosAmpel force-pushed the vhost-device-console-main-pr branch 2 times, most recently from 9bf3173 to a35f354 Compare October 10, 2024 09:32
@TimosAmpel
Copy link
Contributor Author

Summary of the PR

This PR updates the current implementation of vhost-device-console and addresses the comments noted at the PR #717.
Specifically,

* Eliminates the use of 'select' function and 'nix' dependency

Cool, thanks for that!

* Registers all input FDs to the main worker epoll handler

* Increases the unit tests' coverage

* Move the device into the main workspace

All these steps in one commit?

This list should immediately make it clear that we need at least 3/4 separate commits. Please let's try to have commits as small as possible, also to make it easier for reviewers.

Thanks for the comment! I did split it into three difference commits, I believe that should be ok.

Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

Thanks for the comment! I did split it into three difference commits, I believe that should be ok.

@TimosAmpel thanks for that!

We need to adjust coverage value on both main work space and staging workspace to make CI happy.

Also I suggest better commit title/description, here some suggestions:

  • patch 1
vhost-device-console: use worker's epoll for input events

Eliminate the use of select and 'nix' package. This is done by
registering the input events (stdin or tcplistener) onto the main
worker's epoll.
  • patch 2
vhost-device-console: improve tests

[add a little descriptions of the new tests]
  • patch 3
vhost-device-console: promote to main workspace

The current implementation seems ready to be promoted to the
main workspace since the device supports .... [add what we support, and what is still missing]

@TimosAmpel TimosAmpel force-pushed the vhost-device-console-main-pr branch 2 times, most recently from c684280 to 23268c9 Compare November 5, 2024 13:56
@TimosAmpel
Copy link
Contributor Author

Hello @stefano-garzarella, thanks for your comments and sorry for my delayed answer.
In the last push I have updated the commit messages based on what you requested and
also modified the coverage values for both main and staging workspaces.

Since in the last commit vhost-device-console was move to main I reverted the coverage
value of the staging to what it was before that patch serie.

Let me know if you have more comments regarding those updates.

Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

@TimosAmpel great job with the coverage!

I tested it and I did a quick review. Just 1 comment, more curiosity, but in general LGTM, we can eventually improve the code later, but the main features are there.

Thanks for your work!

@stefano-garzarella
Copy link
Member

@TimosAmpel I just noticed that Cargo.lock need to be updated on the main workspace and staging, so maybe you can do that in 3rd patch.

@TimosAmpel
Copy link
Contributor Author

@TimosAmpel great job with the coverage!

I tested it and I did a quick review. Just 1 comment, more curiosity, but in general LGTM, we can eventually improve the code later, but the main features are there.

Thanks for your work!

Thanks a lot for the review too!

@TimosAmpel TimosAmpel force-pushed the vhost-device-console-main-pr branch 2 times, most recently from 95edaa0 to b35037b Compare November 7, 2024 12:54
@TimosAmpel
Copy link
Contributor Author

@TimosAmpel I just noticed that Cargo.lock need to be updated on the main workspace and staging, so maybe you can do that in 3rd patch.

The Cargo.lock files for both main and staging have been updated in 3rd patch (also the coverage under staging needed a bit of tuning, I see the CI is satisfied now)

Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

LGTM!

@epilys @stsquad @vireshk I did a quick review and tested with upstream Linux and QEMU, so I agree that we can promote it to the main workspace, also because the coverage is good enough!

@stefano-garzarella
Copy link
Member

Just as a reminder, when we merge this we need to do the following steps:

@TimosAmpel
Copy link
Contributor Author

Just as a reminder, when we merge this we need to do the following steps:

Very nice! Thanks for the review @stefano-garzarella, we'll do as soon as this is merged

@epilys
Copy link
Member

epilys commented Nov 7, 2024

@stefano-garzarella btw all of us are at an employee meeting this week, we might have time from Saturday onwards.

@stefano-garzarella
Copy link
Member

@stefano-garzarella btw all of us are at an employee meeting this week, we might have time from Saturday onwards.

@epilys thanks for the update! Take your time, we don't need to rush ;-)

Copy link
Collaborator

@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.

Looks good from here too.

@TimosAmpel
Copy link
Contributor Author

Looks good from here too.

Thanks for your feedback @stsquad.

Eliminate the use of select and 'nix' package. This is done by
registering the input events (stdin or tcplistener) onto the main
worker's epoll.

Signed-off-by: Timos Ampelikiotis <[email protected]>
Add tests for the new input events and increase overall test coverage.

Signed-off-by: Timos Ampelikiotis <[email protected]>
The current implementation seems ready to be promoted to the
main workspace since the device supports test coverage have been
increased and the basic functionality is implemented.

Cargo.lock files both in main and staging workspaces are updated.

Support for VIRTIO_CONSOLE_F_SIZE and VIRTIO_CONSOLE_F_EMERG_WRITE
is still missing.

Signed-off-by: Timos Ampelikiotis <[email protected]>
@TimosAmpel TimosAmpel force-pushed the vhost-device-console-main-pr branch from b35037b to 76053f1 Compare November 9, 2024 13:06
@stsquad stsquad merged commit 0b06c22 into rust-vmm:main Nov 9, 2024
2 checks passed
@TimosAmpel
Copy link
Contributor Author

Just as a reminder, when we merge this we need to do the following steps:

Hello @garzarella and @epilys,
Since both console and CAN device have been moved on the main workspace,
do you think that we could also complete the above points? (mainly the crates.io
and the creation of the tag/release)

@epilys
Copy link
Member

epilys commented Nov 15, 2024

@TimosAmpel certainly, the usual workflow is to make an issue and a maintainer will assign themselves to make the release. I will make an issue myself in a moment

@TimosAmpel
Copy link
Contributor Author

@TimosAmpel certainly, the usual workflow is to make an issue and a maintainer will assign themselves to make the release. I will make an issue myself in a moment

Thanks @epilys, I will do so the next time :)

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