Merge pull request #2298 from tedyu/mkdir-all-ret

vc: Check return value from os.MkdirAll in virtiofsdArgs
This commit is contained in:
James O. D. Hunt
2019-12-02 09:43:21 +00:00
committed by GitHub

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{