From 17c0244cf7846c47413b4603a3b39ec6c311dbff Mon Sep 17 00:00:00 2001 From: balopat Date: Mon, 28 Jan 2019 17:28:57 -0800 Subject: [PATCH] reverting unnecessary change --- pkg/drivers/hyperkit/driver.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/drivers/hyperkit/driver.go b/pkg/drivers/hyperkit/driver.go index 60067f75ccb9..996a6289db04 100644 --- a/pkg/drivers/hyperkit/driver.go +++ b/pkg/drivers/hyperkit/driver.go @@ -181,6 +181,8 @@ func (d *Driver) Start() error { if err != nil { return errors.Wrap(err, "new-ing Hyperkit") } + + // TODO: handle the rest of our settings. h.Kernel = d.ResolveStorePath("bzimage") h.Initrd = d.ResolveStorePath("initrd") h.VMNet = true @@ -189,20 +191,13 @@ func (d *Driver) Start() error { h.CPUs = d.CPU h.Memory = d.Memory h.UUID = d.UUID + if vsockPorts, err := d.extractVSockPorts(); err != nil { return err } else if len(vsockPorts) >= 1 { h.VSock = true h.VSockPorts = vsockPorts } - h.Disks = []hyperkit.DiskConfig{ - { - Path: pkgdrivers.GetDiskPath(d.BaseDriver), - Size: d.DiskSize, - Driver: "virtio-blk", - }, - } - //} log.Infof("Using UUID %s", h.UUID) mac, err := GetMACAddressFromUUID(h.UUID) @@ -213,7 +208,13 @@ func (d *Driver) Start() error { // Need to strip 0's mac = trimMacAddress(mac) log.Infof("Generated MAC %s", mac) - + h.Disks = []hyperkit.DiskConfig{ + { + Path: pkgdrivers.GetDiskPath(d.BaseDriver), + Size: d.DiskSize, + Driver: "virtio-blk", + }, + } log.Infof("Starting with cmdline: %s", d.Cmdline) if err := h.Start(d.Cmdline); err != nil { return errors.Wrapf(err, "starting with cmd line: %s", d.Cmdline) @@ -407,6 +408,7 @@ func (d *Driver) sendSignal(s os.Signal) error { func (d *Driver) getPid() int { pidPath := d.ResolveStorePath(machineFileName) + f, err := os.Open(pidPath) if err != nil { log.Warnf("Error reading pid file: %v", err)