mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 17:37:20 +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:
		| @@ -668,7 +668,8 @@ func (q *qemu) setupVirtiofsd(ctx context.Context) (err error) { | |||||||
|  |  | ||||||
| func (q *qemu) stopVirtiofsd(ctx context.Context) (err error) { | func (q *qemu) stopVirtiofsd(ctx context.Context) (err error) { | ||||||
| 	if q.state.VirtiofsdPid == 0 { | 	if q.state.VirtiofsdPid == 0 { | ||||||
| 		return errors.New("invalid virtiofsd PID(0)") | 		q.Logger().Warn("The virtiofsd had stopped") | ||||||
|  | 		return nil | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	err = q.virtiofsd.Stop(ctx) | 	err = q.virtiofsd.Stop(ctx) | ||||||
| @@ -975,6 +976,10 @@ func (q *qemu) stopSandbox(ctx context.Context, waitOnly bool) error { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	if err := q.stopVirtiofsd(ctx); err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user