mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-23 10:12:10 +00:00
qemu: Report all errors on virtiofsd execution
The virtiofs daemon may run into errors other than the file not existing, e.g. the file may not be executable. Fixes: #2682 Message is now: virtiofs daemon /usr/local/bin/hello returned with error: fork/exec /usr/local/bin/virtiofsd: permission denied instead of panic: runtime error: invalid memory address or nil Fixes: #2582 Message is now: virtiofs daemon /usr/local/bin/hello-not-found returned with error: fork/exec /usr/local/bin/hello-not-found: no such file or directory instead of: virtiofsd path (/usr/local/bin/hello-no-found) does not exist Signed-off-by: Christophe de Dinechin <dinechin@redhat.com> Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
parent
042426d73a
commit
487520ff74
@ -646,10 +646,6 @@ func (q *qemu) setupVirtiofsd() (err error) {
|
||||
var listener *net.UnixListener
|
||||
var fd *os.File
|
||||
|
||||
if _, err = os.Stat(q.config.VirtioFSDaemon); os.IsNotExist(err) {
|
||||
return fmt.Errorf("virtiofsd path (%s) does not exist", q.config.VirtioFSDaemon)
|
||||
}
|
||||
|
||||
sockPath, err := q.vhostFSSocketPath(q.id)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -680,9 +676,10 @@ func (q *qemu) setupVirtiofsd() (err error) {
|
||||
}
|
||||
|
||||
err = cmd.Start()
|
||||
if err == nil {
|
||||
q.state.VirtiofsdPid = cmd.Process.Pid
|
||||
if err != nil {
|
||||
return fmt.Errorf("virtiofs daemon %v returned with error: %v", q.config.VirtioFSDaemon, err)
|
||||
}
|
||||
q.state.VirtiofsdPid = cmd.Process.Pid
|
||||
fd.Close()
|
||||
|
||||
// Monitor virtiofsd's stderr and stop sandbox if virtiofsd quits
|
||||
|
Loading…
Reference in New Issue
Block a user