Merge pull request #2583 from fidencio/wip/virtiofsd_not_present

qemu: Don't crash if virtiofsd path is non existent
This commit is contained in:
Julio Montes 2020-04-03 09:21:14 -06:00 committed by GitHub
commit 2b92007a5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -639,6 +639,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