mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-16 16:32:03 +00:00
qemu: stop the virtiofsd specifically
We'd better stop the virtiofsd specifically after stop qemu, instead of depending on the qemu's termination to notify virtiofsd to exit. Fixes: #2211 Signed-off-by: fupan.lfp <fupan.lfp@antgroup.com>
This commit is contained in:
parent
f3cf46a621
commit
0f7a54adf3
@ -716,7 +716,8 @@ func (q *qemu) stopVirtiofsd(ctx context.Context) (err error) {
|
||||
|
||||
// kill virtiofsd
|
||||
if q.state.VirtiofsdPid == 0 {
|
||||
return errors.New("invalid virtiofsd PID(0)")
|
||||
q.Logger().Warn("The virtiofsd had stopped")
|
||||
return nil
|
||||
}
|
||||
|
||||
err = syscall.Kill(q.state.VirtiofsdPid, syscall.SIGKILL)
|
||||
@ -1018,6 +1019,10 @@ func (q *qemu) stopSandbox(ctx context.Context, waitOnly bool) error {
|
||||
}
|
||||
}
|
||||
|
||||
if err := q.stopVirtiofsd(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user