Skip to content

Commit

Permalink
Use official go bindings for hyperkit.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlorenc committed Jul 13, 2017
1 parent 64ff2aa commit b9b9a88
Show file tree
Hide file tree
Showing 422 changed files with 161,651 additions and 104 deletions.
15 changes: 13 additions & 2 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import:
- package: github.com/zchee/libhyperkit
- package: github.com/jceel/lib9p
version: 7be3e0b914fbb2d2ecfe2984d02bacfd8e762eae
- package: github.com/zchee/go-vmnet
- package: github.com/moby/hyperkit
testImport:
- package: github.com/stretchr/testify
version: v1.1.4
Expand Down
32 changes: 1 addition & 31 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,10 @@
package main

import (
"fmt"
"os"

"github.com/docker/machine/libmachine/drivers/plugin"
"github.com/zchee/docker-machine-driver-xhyve/xhyve"
hyperkit "github.com/zchee/libhyperkit"
)

func main() {
if len(os.Args) >= 2 && os.Args[1] == "xhyve" {
runXhyve()
} else {
plugin.RegisterDriver(xhyve.NewDriver("", ""))
}
}

func runXhyve() {
done := make(chan bool)
ptyCh := make(chan string)

args := os.Args[1:] // Technically we only need 2:, but a bug in hooklift/xhyve requires one arg in the beginning
go func() {
if err := hyperkit.Run(args, ptyCh); err != nil {
fmt.Println(err)
}
done <- true
}()

if os.Args[len(os.Args)-1] != "-M" {
fmt.Printf("Waiting on a pseudo-terminal to be ready... ")
pty := <-ptyCh
fmt.Printf("done\n")
fmt.Printf("Hook up your terminal emulator to %s in order to connect to your VM\n", pty)
}

<-done
plugin.RegisterDriver(xhyve.NewDriver("", ""))
}
7 changes: 7 additions & 0 deletions vendor/github.com/moby/hyperkit/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions vendor/github.com/moby/hyperkit/CODINGSTYLE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions vendor/github.com/moby/hyperkit/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions vendor/github.com/moby/hyperkit/MAINTAINERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b9b9a88

Please sign in to comment.