mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-02-23 15:34:28 +01:00
Merge pull request #3823 from fidencio/wip/clh-stop-virtiofsd-if-clh-fails-to-boot-up-the-vm
clh: stop virtofsd if clh fails to boot up the vm
This commit is contained in:
@@ -565,12 +565,16 @@ func (clh *cloudHypervisor) StartVM(ctx context.Context, timeout int) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if shutdownErr := clh.stopVirtiofsDaemon(ctx); shutdownErr != nil {
|
||||
clh.Logger().WithError(shutdownErr).Warn("error shutting down VirtiofsDaemon")
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
pid, err := clh.launchClh()
|
||||
if err != nil {
|
||||
if shutdownErr := clh.stopVirtiofsDaemon(ctx); shutdownErr != nil {
|
||||
clh.Logger().WithError(shutdownErr).Warn("error shutting down VirtiofsDaemon")
|
||||
}
|
||||
return fmt.Errorf("failed to launch cloud-hypervisor: %q", err)
|
||||
}
|
||||
clh.state.PID = pid
|
||||
|
||||
Reference in New Issue
Block a user