Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
qemu: Don't crash if virtiofsd path is non existent
Browse files Browse the repository at this point in the history
Instead, report an error and exit gracefully, as shown below:
```
dahmer fidencio # podman run -ti --runtime=/usr/bin/kata-runtime fedora sh
Error: virtiofsd path (/usr/libexec/virtiofsd) does not exist: OCI runtime error
```

Fixes: #2582

Signed-off-by: Fabiano Fidêncio <[email protected]>
  • Loading branch information
fidencio committed Apr 3, 2020
1 parent 705713b commit fd625b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,10 @@ 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
Expand Down

0 comments on commit fd625b3

Please sign in to comment.