vc: Check return value from os.MkdirAll in virtiofsdArgs

Fixes #2297

Signed-off-by: Ted Yu yuzhihong@gmail.com
This commit is contained in:
Ted Yu 2019-11-30 08:42:49 -08:00
parent d054556f60
commit 628799a42f

View File

@ -662,7 +662,9 @@ func (clh *cloudHypervisor) virtiofsdArgs(sockPath string) ([]string, error) {
sourcePath := filepath.Join(kataHostSharedDir(), clh.id)
if _, err := os.Stat(sourcePath); os.IsNotExist(err) {
os.MkdirAll(sourcePath, os.ModePerm)
if err = os.MkdirAll(sourcePath, os.ModePerm); err != nil {
return nil, err
}
}
args := []string{