cmd: Adjust run_hyperkit to interface changes

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2018-01-24 14:09:27 +00:00
parent 47f139eb08
commit 87667051f2

View File

@ -26,6 +26,10 @@ const (
hyperkitNetworkingDefault = hyperkitNetworkingDockerForMac hyperkitNetworkingDefault = hyperkitNetworkingDockerForMac
) )
func init() {
hyperkit.SetLogger(log.StandardLogger())
}
// Process the run arguments and execute run // Process the run arguments and execute run
func runHyperKit(args []string) { func runHyperKit(args []string) {
flags := flag.NewFlagSet("hyperkit", flag.ExitOnError) flags := flag.NewFlagSet("hyperkit", flag.ExitOnError)
@ -206,12 +210,15 @@ func runHyperKit(args []string) {
id = strconv.Itoa(i) id = strconv.Itoa(i)
} }
if d.Size != 0 && d.Path == "" { if d.Size != 0 && d.Path == "" {
d.Path = filepath.Join(*state, "disk"+id+".img") d.Path = filepath.Join(*state, "disk"+id+".raw")
} }
if d.Path == "" { if d.Path == "" {
log.Fatalf("disk specified with no size or name") log.Fatalf("disk specified with no size or name")
} }
hd := hyperkit.DiskConfig{Path: d.Path, Size: d.Size} hd, err := hyperkit.NewDisk(d.Path, d.Size)
if err != nil {
log.Fatalf("NewDisk failed: %v", err)
}
h.Disks = append(h.Disks, hd) h.Disks = append(h.Disks, hd)
} }