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

runtime-rs: Separate init_config() from new() for struct VsockDevice #8672

Merged
merged 1 commit into from Dec 18, 2023

Conversation

BbolroC
Copy link
Member

@BbolroC BbolroC commented Dec 14, 2023

As a follow-up for #8516, guest_cid and vhost_fd are not necessarily initialised via new(). Instead, the fields should be initialised later when they are really used to construct hypervisor's parameters.
This commit is to separate init_config() from new() to initialise guest_cid and vhost_fd and leave only the assignment of id for the existing function.

Fixes: #8671

Signed-off-by: Hyounggyu Choi Hyounggyu.Choi@ibm.com

Copy link
Member

@studychao studychao left a comment

Choose a reason for hiding this comment

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

LGTM, but a little question

})
}

pub async fn init_config(&mut self) -> Result<File> {
Copy link
Member

Choose a reason for hiding this comment

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

seems like this function is not used anywhere, will the actual usage of this will be introduced later?

Copy link
Member Author

@BbolroC BbolroC Dec 15, 2023

Choose a reason for hiding this comment

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

yeah, coming soon from #8185 😉 For the details could you find the last 4 commits at https://github.com/BbolroC/kata-containers/pull/1/commits, for which I got a good feedback from @Apokleos

CC: @pmores

@Apokleos Apokleos requested a review from gkurz December 15, 2023 07:13
Copy link
Contributor

@Apokleos Apokleos left a comment

Choose a reason for hiding this comment

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

Thx @BbolroC for your work! one comment!

Copy link
Contributor

@Apokleos Apokleos left a comment

Choose a reason for hiding this comment

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

Thx @BbolroC for your work. LGTM!

@BbolroC
Copy link
Member Author

BbolroC commented Dec 18, 2023

/test

Copy link
Member

@gkurz gkurz left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @BbolroC !

As a follow-up for kata-containers#8516, guest_cid and vhost_fd are not necessarily initialised
via new(). Instead, the fields should be initialised later when they are really
used to construct hypervisor's parameters.
This commit is to separate init_config() from new() to initialise guest_cid
and vhost_fd and leave only the assignment of id for the existing function.

Fixes: kata-containers#8671

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
@BbolroC
Copy link
Member Author

BbolroC commented Dec 18, 2023

/test

@BbolroC BbolroC merged commit ceea888 into kata-containers:main Dec 18, 2023
168 of 176 checks passed
@BbolroC BbolroC deleted the introduce-vsock-device-init branch December 18, 2023 21:04
BbolroC added a commit to pmores/kata-containers that referenced this pull request Dec 20, 2023
This is to call VsockDevice::init_config() implemented by kata-containers#8672 when
vhost_fd and guest_cid should be instantiated. They are immediately
passed to a VM instead of staying and being managed by the runtime.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
BbolroC added a commit to BbolroC/kata-containers that referenced this pull request Dec 22, 2023
This is to call VsockDevice::init_config() implemented by kata-containers#8672 when
vhost_fd and guest_cid should be instantiated. They are immediately
passed to a VM instead of staying and being managed by the runtime.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

runtime-rs: guest_id and vhost_fd for VsockDevice should be initialised when necessary
5 participants