virtcontainers: fix the issue of cleanup the vm's path

To use the filepath.Join() instead of the simple
string append method to form the file path, otherwise
it will lose the "/" between the two parts.

Fixes #543.

Signed-off-by: Fupan Li <lifupan@gmail.com>
This commit is contained in:
Fupan Li 2018-08-02 16:14:11 +08:00
parent fc0142ec8e
commit 15860185d9

View File

@ -579,7 +579,7 @@ func (q *qemu) stopSandbox() error {
return err return err
} }
err = os.RemoveAll(RunVMStoragePath + q.id) err = os.RemoveAll(filepath.Join(RunVMStoragePath, q.id))
if err != nil { if err != nil {
q.Logger().WithError(err).Error("Fail to clean up vm directory") q.Logger().WithError(err).Error("Fail to clean up vm directory")
} }