qemu: Don't crash if virtiofsd path is non existent

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 <fidencio@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2020-04-03 14:12:12 +02:00
parent 705713b4f9
commit fd625b3fc5

View File

@ -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