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: ch: Change state when VM stopped #8630
runtime-rs: ch: Change state when VM stopped #8630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @jodh-intel
// which results in this method being called potentially a second | ||
// time. Without this check, we'll return an error representing EPIPE | ||
// since the CH API socket is at that point invalid. | ||
if self.state != VmmState::VmRunning { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest to explicitly check for Stopped State here, but looks like there are only 3 states defined. I would eventually like to explicitly distinguish between NotReady and Stopped, but this would work for now.
/test |
/retest-arm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jodh-intel is there a reason we don't update the state within cloud_hypervisor_shutdown
?
Also I wanted to check I'm understanding this correctly, if cloud_hypervisor_shutdown
returns an error the state will remain VmRunning
?
@jongwu - Is there a known problem with the ARM jenkins CI as I'm seeing lots of errors like this:
|
Move the state setting to the `Hypervisor` trait calls. This makes the code clearer. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
3dbcf9a
to
24d1eae
Compare
@cmaf - I've moved the state handling to the Hypervisor API calls now for clarity and consistency (see new commit).
@cmaf - Good catch. I've updated the branch to set the state to |
/test |
Make the CH (Cloud Hypervisor) `stop_vm()` method check the VM state before attempting to stop the VM, and update the state once the VM has stopped. This avoids the method failing if called multiple times which will happen if the workload exits before the container manager requests that the container stop. This change ensures the CH driver finishes cleanly. Fixes: kata-containers#8629. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
24d1eae
to
2a518f0
Compare
/test |
Make the CH (Cloud Hypervisor)
stop_vm()
method check the VM state before attempting to stop the VM, and update the state once the VM has stopped.This avoids the method failing if called multiple times which will happen if the workload exits before the container manager requests that the container stop.
This change ensures the CH driver finishes cleanly.
Fixes: #8629.