2014-05-12 21:35:37 -04:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
)
|
|
|
|
|
|
|
|
const VMWARE_PLAYER_VERSION = "6"
|
|
|
|
|
|
|
|
// Player6Driver is a driver that can run VMware Player 6
|
|
|
|
// installations.
|
|
|
|
|
|
|
|
type Player6Driver struct {
|
|
|
|
Player5Driver
|
|
|
|
}
|
|
|
|
|
2018-06-16 20:38:42 -04:00
|
|
|
func (d *Player6Driver) Clone(dst, src string, linked bool) error {
|
2014-05-12 21:35:37 -04:00
|
|
|
// TODO(rasa) check if running player+, not just player
|
|
|
|
|
2018-06-30 11:31:42 -04:00
|
|
|
var cloneType string
|
|
|
|
if linked {
|
|
|
|
cloneType = "linked"
|
|
|
|
} else {
|
|
|
|
cloneType = "full"
|
|
|
|
}
|
|
|
|
|
2014-05-12 21:35:37 -04:00
|
|
|
cmd := exec.Command(d.Player5Driver.VmrunPath,
|
|
|
|
"-T", "ws",
|
|
|
|
"clone", src, dst,
|
2018-06-30 11:31:42 -04:00
|
|
|
cloneType)
|
2014-05-12 21:35:37 -04:00
|
|
|
|
|
|
|
if _, _, err := runAndLog(cmd); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Player6Driver) Verify() error {
|
|
|
|
if err := d.Player5Driver.Verify(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return playerVerifyVersion(VMWARE_PLAYER_VERSION)
|
|
|
|
}
|
2017-04-13 18:39:55 -04:00
|
|
|
|
|
|
|
func (d *Player6Driver) GetVmwareDriver() VmwareDriver {
|
|
|
|
return d.Player5Driver.VmwareDriver
|
|
|
|
}
|