diff --git a/vendor.conf b/vendor.conf index 325d8235b..3bf35ba7a 100644 --- a/vendor.conf +++ b/vendor.conf @@ -9,7 +9,7 @@ github.com/docker/distribution 07f32ac1831ed0fc71960b7da5d6bb83cb6881b5 github.com/docker/engine-api cf82c64276ebc2501e72b241f9fdc1e21e421743 github.com/docker/go-connections e15c02316c12de00874640cd76311849de2aeed5 github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3 -github.com/docker/hyperkit/go 57e91c5bb6655514aa71d00dd1949db891903d34 +github.com/docker/hyperkit/go 89b0a4a88ec340c756a6bd14af57e26f69d29d09 github.com/docker/infrakit cb420e3e50ea60afe58538b1d3cab1cb14059433 github.com/ghodss/yaml 0ca9ea5df5451ffdf184b4428c902747c2c11cd7 github.com/golang/protobuf/proto c9c7427a2a70d2eb3bafa0ab2dc163e45f143317 diff --git a/vendor/github.com/docker/hyperkit/go/hyperkit.go b/vendor/github.com/docker/hyperkit/go/hyperkit.go index 54cf6a32e..f79ff94b1 100644 --- a/vendor/github.com/docker/hyperkit/go/hyperkit.go +++ b/vendor/github.com/docker/hyperkit/go/hyperkit.go @@ -69,6 +69,8 @@ type HyperKit struct { StateDir string `json:"state_dir"` // VPNKitSock is the location of the VPNKit socket used for networking. VPNKitSock string `json:"vpnkit_sock"` + // UUID is a string containing a UUID for the VM. It can be used in conjunction with VPNKit to get consistent IP address. + UUID string `json:"uuid"` // DiskImage is the path to the disk image to use DiskImage string `json:"disk"` // ISOImage is the (optional) path to a ISO image to attach @@ -144,12 +146,12 @@ func New(hyperkit, statedir, vpnkitsock, diskimage string) (*HyperKit, error) { func FromState(statedir string) (*HyperKit, error) { b, err := ioutil.ReadFile(filepath.Join(statedir, jsonFile)) if err != nil { - return nil, fmt.Errorf("Can't read json file: ", err) + return nil, fmt.Errorf("Can't read json file: %s", err) } h := &HyperKit{} err = json.Unmarshal(b, h) if err != nil { - return nil, fmt.Errorf("Can't parse json file: ", err) + return nil, fmt.Errorf("Can't parse json file: %s", err) } // Make sure the pid written by hyperkit is the same as in the json @@ -353,7 +355,11 @@ func (h *HyperKit) buildArgs(cmdline string) { a = append(a, "-s", "0:0,hostbridge") if h.VPNKitSock != "" { - a = append(a, "-s", fmt.Sprintf("1:0,virtio-vpnkit,path=%s", h.VPNKitSock)) + if h.UUID == "" { + a = append(a, "-s", fmt.Sprintf("1:0,virtio-vpnkit,path=%s", h.VPNKitSock)) + } else { + a = append(a, "-s", fmt.Sprintf("1:0,virtio-vpnkit,path=%s,uuid=%s", h.VPNKitSock, h.UUID)) + } } if h.DiskImage != "" { a = append(a, "-s", fmt.Sprintf("2:0,virtio-blk,%s", h.DiskImage)) @@ -502,7 +508,7 @@ func checkHyperKit(hyperkit string) (string, error) { if hyperkit != "" { p, err := exec.LookPath(hyperkit) if err != nil { - return "", fmt.Errorf("Could not find hyperkit executable: ", hyperkit) + return "", fmt.Errorf("Could not find hyperkit executable %s: %s", hyperkit, err) } return p, nil }