├── design └── architecture.md ├── vendor ├── google.golang.org │ └── grpc │ │ ├── AUTHORS │ │ ├── codes │ │ └── code_string.go │ │ ├── doc.go │ │ ├── naming │ │ ├── go18.go │ │ └── go17.go │ │ ├── resolver │ │ └── dns │ │ │ ├── go18.go │ │ │ └── go17.go │ │ ├── internal │ │ └── internal.go │ │ └── credentials │ │ └── credentials_util_go18.go ├── github.com │ ├── docker │ │ ├── docker │ │ │ ├── project │ │ │ │ └── CONTRIBUTORS.md │ │ │ ├── hack │ │ │ │ ├── make │ │ │ │ │ └── .build-deb │ │ │ │ │ │ ├── docker-engine.udev │ │ │ │ │ │ ├── docker-engine.docker.init │ │ │ │ │ │ ├── docker-engine.docker.upstart │ │ │ │ │ │ └── docker-engine.docker.default │ │ │ │ └── generate-authors.sh │ │ │ ├── docs │ │ │ │ └── static_files │ │ │ │ │ └── contributors.png │ │ │ ├── pkg │ │ │ │ ├── mount │ │ │ │ │ ├── mountinfo_windows.go │ │ │ │ │ ├── mounter_unsupported.go │ │ │ │ │ ├── mountinfo_unsupported.go │ │ │ │ │ ├── flags_unsupported.go │ │ │ │ │ ├── mountinfo_solaris.go │ │ │ │ │ ├── mounter_solaris.go │ │ │ │ │ ├── mountinfo_freebsd.go │ │ │ │ │ ├── flags_freebsd.go │ │ │ │ │ └── mountinfo.go │ │ │ │ ├── system │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ │ ├── umask_windows.go │ │ │ │ │ ├── utimes_unsupported.go │ │ │ │ │ ├── umask.go │ │ │ │ │ ├── chtimes_unix.go │ │ │ │ │ ├── mknod_windows.go │ │ │ │ │ ├── stat_openbsd.go │ │ │ │ │ ├── xattrs_unsupported.go │ │ │ │ │ ├── lstat.go │ │ │ │ │ ├── stat_unsupported.go │ │ │ │ │ ├── meminfo.go │ │ │ │ │ ├── process_unix.go │ │ │ │ │ ├── syscall_unix.go │ │ │ │ │ ├── process_windows.go │ │ │ │ │ ├── path_unix.go │ │ │ │ │ ├── lstat_windows.go │ │ │ │ │ ├── utimes_freebsd.go │ │ │ │ │ ├── stat_freebsd.go │ │ │ │ │ ├── chtimes_windows.go │ │ │ │ │ ├── utimes_linux.go │ │ │ │ │ ├── stat_darwin.go │ │ │ │ │ ├── mknod.go │ │ │ │ │ ├── stat_linux.go │ │ │ │ │ ├── stat_solaris.go │ │ │ │ │ ├── stat_windows.go │ │ │ │ │ ├── exitcode.go │ │ │ │ │ └── stat.go │ │ │ │ ├── symlink │ │ │ │ │ └── fs_unix.go │ │ │ │ ├── reexec │ │ │ │ │ ├── command_unsupported.go │ │ │ │ │ ├── command_windows.go │ │ │ │ │ ├── command_unix.go │ │ │ │ │ └── command_linux.go │ │ │ │ └── longpath │ │ │ │ │ └── longpath.go │ │ │ └── NOTICE │ │ └── go-units │ │ │ └── duration.go │ ├── philhofer │ │ └── fwd │ │ │ ├── writer_appengine.go │ │ │ ├── writer_unsafe.go │ │ │ └── LICENSE.md │ ├── kr │ │ └── pty │ │ │ ├── types.go │ │ │ ├── ztypes_386.go │ │ │ ├── ztypes_arm.go │ │ │ ├── ztypes_amd64.go │ │ │ ├── ztypes_arm64.go │ │ │ ├── ztypes_ppc64.go │ │ │ ├── ztypes_s390x.go │ │ │ ├── ztypes_ppc64le.go │ │ │ ├── pty_unsupported.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ioctl.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── types_freebsd.go │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ ├── types_dragonfly.go │ │ │ ├── doc.go │ │ │ ├── run.go │ │ │ ├── util.go │ │ │ ├── pty_linux.go │ │ │ └── License │ ├── kardianos │ │ └── osext │ │ │ ├── osext_go18.go │ │ │ ├── osext_plan9.go │ │ │ ├── osext_windows.go │ │ │ ├── osext.go │ │ │ └── osext_procfs.go │ ├── Microsoft │ │ └── go-winio │ │ │ ├── syscall.go │ │ │ └── LICENSE │ ├── golang │ │ ├── protobuf │ │ │ ├── AUTHORS │ │ │ └── CONTRIBUTORS │ │ └── snappy │ │ │ ├── decode_amd64.go │ │ │ ├── AUTHORS │ │ │ └── encode_amd64.go │ ├── vishvananda │ │ ├── netlink │ │ │ ├── nl │ │ │ │ ├── nl_unspecified.go │ │ │ │ ├── xfrm_monitor_linux.go │ │ │ │ ├── mpls_linux.go │ │ │ │ └── addr_linux.go │ │ │ ├── route_unspecified.go │ │ │ ├── netlink_linux.go │ │ │ ├── link_tuntap_linux.go │ │ │ ├── neigh.go │ │ │ ├── socket.go │ │ │ ├── order.go │ │ │ ├── rule.go │ │ │ └── protinfo.go │ │ └── netns │ │ │ └── netns_unspecified.go │ ├── opencontainers │ │ ├── runc │ │ │ ├── libcontainer │ │ │ │ └── system │ │ │ │ │ ├── unsupported.go │ │ │ │ │ ├── sysconfig.go │ │ │ │ │ ├── sysconfig_notcgo.go │ │ │ │ │ ├── syscall_linux_386.go │ │ │ │ │ ├── syscall_linux_arm.go │ │ │ │ │ ├── syscall_linux_64.go │ │ │ │ │ └── xattrs_linux.go │ │ │ └── NOTICE │ │ └── runtime-spec │ │ │ └── specs-go │ │ │ ├── version.go │ │ │ └── state.go │ ├── Sirupsen │ │ └── logrus │ │ │ ├── terminal_appengine.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_solaris.go │ │ │ ├── doc.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_windows.go │ │ │ ├── LICENSE │ │ │ └── hooks.go │ ├── gogo │ │ └── protobuf │ │ │ ├── GOLANG_CONTRIBUTORS │ │ │ ├── AUTHORS │ │ │ └── CONTRIBUTORS │ ├── RoaringBitmap │ │ └── roaring │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── shortiterator.go │ │ │ └── popcnt_generic.go │ ├── kata-containers │ │ └── agent │ │ │ └── protocols │ │ │ └── grpc │ │ │ └── version.go │ ├── tinylib │ │ └── msgp │ │ │ ├── msgp │ │ │ ├── appengine.go │ │ │ ├── advise_other.go │ │ │ ├── advise_linux.go │ │ │ ├── size.go │ │ │ ├── file_port.go │ │ │ ├── circular.go │ │ │ └── unsafe.go │ │ │ └── LICENSE │ ├── willf │ │ └── bitset │ │ │ ├── popcnt_generic.go │ │ │ └── popcnt.go │ ├── hashicorp │ │ └── yamux │ │ │ └── util.go │ ├── rgbkrk │ │ └── libvirt-go │ │ │ ├── go_libvirt.h │ │ │ ├── constants_1.2.14.go │ │ │ └── LICENSE │ ├── urfave │ │ └── cli │ │ │ ├── cli.go │ │ │ └── LICENSE │ ├── vdemeester │ │ └── shakers │ │ │ └── bool.go │ ├── mohae │ │ └── deepcopy │ │ │ └── LICENSE │ └── glycerine │ │ └── go-unsnap-stream │ │ └── LICENSE └── golang.org │ └── x │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── http2 │ │ ├── not_go19.go │ │ ├── go16.go │ │ ├── go19.go │ │ ├── not_go16.go │ │ └── not_go18.go │ ├── trace │ │ ├── trace_go17.go │ │ └── trace_go16.go │ └── context │ │ └── go19.go │ ├── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── unix │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── constants.go │ │ ├── syscall_no_getwd.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── env_unset.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── flock_linux_32bit.go │ │ ├── asm_solaris_amd64.s │ │ ├── gccgo_linux_sparc64.go │ │ ├── gccgo_linux_amd64.go │ │ ├── race0.go │ │ ├── env_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── asm_linux_arm64.s │ │ ├── str.go │ │ ├── file_unix.go │ │ ├── race.go │ │ ├── asm_linux_s390x.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_mips64x.s │ │ ├── flock.go │ │ ├── asm_freebsd_arm.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_darwin_386.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── bluetooth_linux.go │ │ ├── asm_darwin_arm64.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_386.s │ │ ├── syscall_solaris_amd64.go │ │ ├── openbsd_pledge.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_openbsd_386.go │ │ ├── gccgo_c.c │ │ └── sockcmsg_linux.go │ └── windows │ │ ├── mksyscall.go │ │ ├── env_unset.go │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── race0.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── str.go │ │ ├── env_windows.go │ │ ├── race.go │ │ ├── memory_windows.go │ │ └── eventlog.go │ └── text │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── language │ ├── go1_2.go │ ├── common.go │ ├── gen_common.go │ └── go1_1.go │ ├── secure │ └── bidirule │ │ ├── bidirule10.0.0.go │ │ └── bidirule9.0.0.go │ └── collate │ └── index.go ├── logo.png ├── hack ├── format.sh ├── update-generated-hyperstart-proto.sh ├── install-bats.sh ├── verify-gofmt.sh ├── test-cmd.sh └── validate-vet.sh ├── cli ├── nsenter │ ├── nsenter_unsupported.go │ ├── nsenter.go │ ├── namespace.h │ ├── nsenter_gccgo.go │ └── nsexec.c ├── nsset.go └── filesystem_linux.go ├── OWNERS ├── tests └── bats-integration │ ├── testdata │ └── hello-world.tar │ ├── version.bats │ ├── kill.bats │ ├── start.bats │ └── delete.bats ├── hypervisor ├── kvmtool │ ├── lkvm_unsupported.go │ └── lkvm_arm64.go ├── xen │ ├── constants.go │ └── xen_unsupported.go ├── xenpv │ └── xenpv_unsupported.go ├── libvirt │ └── libvirt_unsupported.go ├── qemu │ └── constants.go ├── types │ └── types.go ├── network │ ├── network_unsupported.go │ ├── network_darwin.go │ ├── network_test.go │ └── network.go └── log.go ├── lib ├── vsock │ └── vsock_unsupported.go ├── utils │ ├── mount_darwin.go │ ├── mount_linux.go │ └── buffer.go └── term │ ├── tc_other.go │ ├── tty.go │ └── tc_linux_cgo.go ├── factory ├── base │ └── base.go ├── direct │ └── direct.go └── multi │ └── multi.go ├── NOTICE ├── api └── status.go ├── agent ├── pipe.go └── api │ └── hyperstart │ └── constants.go ├── .gitignore ├── autogen.sh ├── Makefile.am ├── .travis.yml └── Gopkg.toml /design/architecture.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperhq/runv/HEAD/logo.png -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/project/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | ../CONTRIBUTING.md -------------------------------------------------------------------------------- /hack/format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -name "*.go" | grep -v vendor | xargs gofmt -s -w 3 | -------------------------------------------------------------------------------- /cli/nsenter/nsenter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux !cgo 2 | 3 | package nsenter 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.udev: -------------------------------------------------------------------------------- 1 | ../../../contrib/udev/80-docker.rules -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.docker.init: -------------------------------------------------------------------------------- 1 | ../../../contrib/init/sysvinit-debian/docker -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.docker.upstart: -------------------------------------------------------------------------------- 1 | ../../../contrib/init/upstart/docker.conf -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/hack/make/.build-deb/docker-engine.docker.default: -------------------------------------------------------------------------------- 1 | ../../../contrib/init/sysvinit-debian/docker.default -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | reviewers: 2 | - feiskyer 3 | - WeiZhang555 4 | 5 | approvers: 6 | - gnawux 7 | - laijs 8 | - gao-feng 9 | - bergwolf 10 | -------------------------------------------------------------------------------- /tests/bats-integration/testdata/hello-world.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperhq/runv/HEAD/tests/bats-integration/testdata/hello-world.tar -------------------------------------------------------------------------------- /hypervisor/kvmtool/lkvm_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build linux,!arm64 2 | 3 | package kvmtool 4 | 5 | func arch_arguments() []string { 6 | return nil 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/philhofer/fwd/writer_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package fwd 4 | 5 | func unsafestr(s string) []byte { return []byte(s) } 6 | -------------------------------------------------------------------------------- /hack/update-generated-hyperstart-proto.sh: -------------------------------------------------------------------------------- 1 | protoc --proto_path=hyperstart/api/grpc/ --go_out=plugins=grpc:hyperstart/api/grpc/ hyperstart/api/grpc/hyperstart.proto 2 | -------------------------------------------------------------------------------- /hypervisor/xen/constants.go: -------------------------------------------------------------------------------- 1 | // +build linux,with_xen 2 | 3 | package xen 4 | 5 | const ( 6 | REQUIRED_VERSION = 4005000 7 | PCI_AVAILABLE_ADDRESS = 3 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/types.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package pty 4 | 5 | import "C" 6 | 7 | type ( 8 | _C_int C.int 9 | _C_uint C.uint 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/docs/static_files/contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperhq/runv/HEAD/vendor/github.com/docker/docker/docs/static_files/contributors.png -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_windows.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | func parseMountTable() ([]*Info, error) { 4 | // Do NOT return an error! 5 | return nil, nil 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_go18.go: -------------------------------------------------------------------------------- 1 | //+build go1.8 2 | 3 | package osext 4 | 5 | import "os" 6 | 7 | func executable() (string, error) { 8 | return os.Executable() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /hypervisor/xen/xen_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !with_xen 2 | 3 | package xen 4 | 5 | import "github.com/hyperhq/runv/hypervisor" 6 | 7 | func InitDriver() hypervisor.HypervisorDriver { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /hypervisor/xenpv/xenpv_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !with_xen490 2 | 3 | package xenpv 4 | 5 | import "github.com/hyperhq/runv/hypervisor" 6 | 7 | func InitDriver() hypervisor.HypervisorDriver { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_arm64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | // +build arm64 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types.go 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types.go 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /hypervisor/libvirt/libvirt_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !with_libvirt 2 | 3 | package libvirt 4 | 5 | import "github.com/hyperhq/runv/hypervisor" 6 | 7 | func InitDriver() hypervisor.HypervisorDriver { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types.go 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /cli/nsenter/nsenter.go: -------------------------------------------------------------------------------- 1 | // +build linux,!gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/pty_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!darwin,!freebsd,!dragonfly 2 | 3 | package pty 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | func open() (pty, tty *os.File, err error) { 10 | return nil, nil, ErrUnsupported 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/nl_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package nl 4 | 5 | import "encoding/binary" 6 | 7 | var SupportedNlFamilies = []int{} 8 | 9 | func NativeEndian() binary.ByteOrder { 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // RunningInUserNS is a stub for non-Linux systems 6 | // Always returns false 7 | func RunningInUserNS() bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /hack/install-bats.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /tmp \ 4 | && git clone https://github.com/sstephenson/bats.git \ 5 | && cd bats \ 6 | && git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f \ 7 | && ./install.sh /usr/local \ 8 | && rm -rf /tmp/bats 9 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import "io" 6 | 7 | // IsTerminal returns true if stderr's file descriptor is a terminal. 8 | func IsTerminal(f io.Writer) bool { 9 | return true 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/route_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | func (r *Route) ListFlags() []string { 6 | return []string{} 7 | } 8 | 9 | func (n *NexthopInfo) ListFlags() []string { 10 | return []string{} 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Buf *byte 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Buf *byte 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | The contributors to the Go protobuf repository: 2 | 3 | # This source code was written by the Go contributors. 4 | # The master list of contributors is in the main Go distribution, 5 | # visible at http://tip.golang.org/CONTRIBUTORS. -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig.go: -------------------------------------------------------------------------------- 1 | // +build cgo,linux cgo,freebsd 2 | 3 | package system 4 | 5 | /* 6 | #include 7 | */ 8 | import "C" 9 | 10 | func GetClockTicks() int { 11 | return int(C.sysconf(C._SC_CLK_TCK)) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ioctl.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pty 4 | 5 | import "syscall" 6 | 7 | func ioctl(fd, cmd, ptr uintptr) error { 8 | _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr) 9 | if e != 0 { 10 | return e 11 | } 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /lib/vsock/vsock_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd netbsd openbsd solaris 2 | 3 | package vsock 4 | 5 | import ( 6 | "fmt" 7 | "net" 8 | ) 9 | 10 | func Dial(cid uint32, port uint32) (net.Conn, error) { 11 | return nil, fmt.Errorf("vsock is not supported") 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/errors.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | // ErrNotSupportedPlatform means the platform is not supported. 9 | ErrNotSupportedPlatform = errors.New("platform and architecture is not supported") 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!solaris 2 | 3 | package system 4 | 5 | // ReadMemInfo is not supported on platforms other than linux and windows. 6 | func ReadMemInfo() (*MemInfo, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | -------------------------------------------------------------------------------- /lib/utils/mount_darwin.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | func Mount(src, dst string, readOnly bool) error { 8 | //return syscall.Symlink(src, dst) 9 | return syscall.Link(src, dst) 10 | } 11 | 12 | func Umount(path string) { 13 | syscall.Unlink(path) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/umask_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Umask is not supported on the windows platform. 6 | func Umask(newmask int) (oldmask int, err error) { 7 | // should not be called on cli code path 8 | return 0, ErrNotSupportedPlatform 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Pad_cgo_0 [4]byte 13 | Buf *byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/netlink_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "github.com/vishvananda/netlink/nl" 4 | 5 | // Family type definitions 6 | const ( 7 | FAMILY_ALL = nl.FAMILY_ALL 8 | FAMILY_V4 = nl.FAMILY_V4 9 | FAMILY_V6 = nl.FAMILY_V6 10 | FAMILY_MPLS = nl.FAMILY_MPLS 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // LUtimesNano is only supported on linux and freebsd. 8 | func LUtimesNano(path string, ts []syscall.Timespec) error { 9 | return ErrNotSupportedPlatform 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/types_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package pty 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | const ( 12 | _C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */ 13 | ) 14 | 15 | type fiodgnameArg C.struct_fiodgname_arg 16 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/ztypes_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_dragonfly.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Name *byte 12 | Len uint32 13 | Pad_cgo_0 [4]byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/github.com/RoaringBitmap/roaring/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of roaring authors for copyright purposes. 2 | 3 | Todd Gruben (@tgruben), 4 | Daniel Lemire (@lemire), 5 | Elliot Murphy (@statik), 6 | Bob Potter (@bpot), 7 | Tyson Maly (@tvmaly), 8 | Will Glynn (@willglynn), 9 | Brent Pedersen (@brentp) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /vendor/github.com/kata-containers/agent/protocols/grpc/version.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2017 HyperHQ Inc. 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | package grpc 8 | 9 | // APIVersion specifies the version of the gRPC communications protocol used 10 | // by Kata Containers. 11 | const APIVersion = "0.0.1" 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/umask.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Umask sets current process's file mode creation mask to newmask 10 | // and returns oldmask. 11 | func Umask(newmask int) (oldmask int, err error) { 12 | return syscall.Umask(newmask), nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package msgp 4 | 5 | // let's just assume appengine 6 | // uses 64-bit hardware... 7 | const smallint = false 8 | 9 | func UnsafeString(b []byte) string { 10 | return string(b) 11 | } 12 | 13 | func UnsafeBytes(s string) []byte { 14 | return []byte(s) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /factory/base/base.go: -------------------------------------------------------------------------------- 1 | package base 2 | 3 | import "github.com/hyperhq/runv/hypervisor" 4 | 5 | type Factory interface { 6 | Config() *hypervisor.BootConfig 7 | // get the base vm of the factory 8 | // the vm should be stared(init-connected) paused and can be hotadd cpu/mem 9 | GetBaseVm() (*hypervisor.Vm, error) 10 | CloseFactory() 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/symlink/fs_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package symlink 4 | 5 | import ( 6 | "path/filepath" 7 | ) 8 | 9 | func evalSymlinks(path string) (string, error) { 10 | return filepath.EvalSymlinks(path) 11 | } 12 | 13 | func isDriveOrRoot(p string) bool { 14 | return p == string(filepath.Separator) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/advise_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // TODO: darwin, BSD support 10 | 11 | func adviseRead(mem []byte) {} 12 | 13 | func adviseWrite(mem []byte) {} 14 | 15 | func fallocate(f *os.File, sz int64) error { 16 | return f.Truncate(sz) 17 | } 18 | -------------------------------------------------------------------------------- /tests/bats-integration/version.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | @test "runv version" { 6 | skip "need to update the check" 7 | runv -v 8 | [ "$status" -eq 0 ] 9 | [[ ${lines[0]} =~ runv\ version\ [0-9]+\.[0-9]+\.[0-9]+ ]] 10 | [[ ${lines[1]} =~ commit:+ ]] 11 | [[ ${lines[2]} =~ spec:\ [0-9]+\.[0-9]+\.[0-9]+ ]] 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd,!solaris,!darwin 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Command is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin. 10 | func Command(args ...string) *exec.Cmd { 11 | return nil 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | func mount(device, target, mType string, flag uintptr, data string) error { 6 | panic("Not implemented") 7 | } 8 | 9 | func unmount(target string, flag int) error { 10 | panic("Not implemented") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/types_dragonfly.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package pty 4 | 5 | /* 6 | #define _KERNEL 7 | #include 8 | #include 9 | #include 10 | */ 11 | import "C" 12 | 13 | const ( 14 | _C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */ 15 | ) 16 | 17 | type fiodgnameArg C.struct_fiodname_args 18 | -------------------------------------------------------------------------------- /vendor/github.com/RoaringBitmap/roaring/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of roaring contributors 2 | 3 | Todd Gruben (@tgruben), 4 | Daniel Lemire (@lemire), 5 | Elliot Murphy (@statik), 6 | Bob Potter (@bpot), 7 | Tyson Maly (@tvmaly), 8 | Will Glynn (@willglynn), 9 | Brent Pedersen (@brentp), 10 | Jason E. Aten (@glycerine) 11 | Vali Malinoiu (@0x4139) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "fmt" 7 | "runtime" 8 | ) 9 | 10 | func parseMountTable() ([]*Info, error) { 11 | return nil, fmt.Errorf("mount.parseMountTable is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 12 | } 13 | -------------------------------------------------------------------------------- /cli/nsenter/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef NSENTER_NAMESPACE_H 2 | #define NSENTER_NAMESPACE_H 3 | 4 | #ifndef _GNU_SOURCE 5 | # define _GNU_SOURCE 6 | #endif 7 | #include 8 | 9 | /* All of these are taken from include/uapi/linux/sched.h */ 10 | #ifndef CLONE_NEWNET 11 | # define CLONE_NEWNET 0x40000000 /* New network namespace */ 12 | #endif 13 | 14 | #endif /* NSENTER_NAMESPACE_H */ 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /hypervisor/qemu/constants.go: -------------------------------------------------------------------------------- 1 | package qemu 2 | 3 | const ( 4 | QMP_INIT = iota 5 | QMP_SESSION 6 | QMP_FINISH 7 | QMP_EVENT 8 | QMP_INTERNAL_ERROR 9 | QMP_QUIT 10 | QMP_TIMEOUT 11 | QMP_RESULT 12 | QMP_ERROR 13 | ) 14 | 15 | const ( 16 | QmpSockName = "qmp.sock" 17 | QemuPidFile = "pidfile" 18 | QemuLogDir = "/var/log/hyper/qemu" 19 | 20 | QMP_EVENT_SHUTDOWN = "SHUTDOWN" 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "time" 7 | ) 8 | 9 | //setCTime will set the create time on a file. On Unix, the create 10 | //time is updated as a side effect of setting the modified time, so 11 | //no action is required. 12 | func setCTime(path string, ctime time.Time) error { 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/link_tuntap_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | // ideally golang.org/x/sys/unix would define IfReq but it only has 4 | // IFNAMSIZ, hence this minimalistic implementation 5 | const ( 6 | SizeOfIfReq = 40 7 | IFNAMSIZ = 16 8 | ) 9 | 10 | type ifReq struct { 11 | Name [IFNAMSIZ]byte 12 | Flags uint16 13 | pad [SizeOfIfReq - IFNAMSIZ - 2]byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/mknod_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Mknod is not implemented on Windows. 6 | func Mknod(path string, mode uint32, dev int) error { 7 | return ErrNotSupportedPlatform 8 | } 9 | 10 | // Mkdev is not implemented on Windows. 11 | func Mkdev(major int64, minor int64) uint32 { 12 | panic("Mkdev not implemented on Windows.") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_openbsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtim}, nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/philhofer/fwd/writer_unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package fwd 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | // unsafe cast string as []byte 11 | func unsafestr(b string) []byte { 12 | l := len(b) 13 | return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 14 | Len: l, 15 | Cap: l, 16 | Data: (*reflect.StringHeader)(unsafe.Pointer(&b)).Data, 17 | })) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | // not supported prior to go1.9 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 15 | return t1.ExpectContinueTimeout 16 | } 17 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | HyperHQ 2 | Copyright 2015 HyperHQ, Inc. 3 | 4 | This product includes software developed at HyperHQ, Inc. (https://www.hyper.sh). 5 | 6 | This product contains software (https://github.com/golang/glog) developed by Google, Inc. 7 | It is licensed under the Apache License Version 2.0. 8 | 9 | This product contains software (https://github.com/riobard/go-virtualbox) developed 10 | by Riobard Zhan, much appreciated for his work. 11 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/doc.go: -------------------------------------------------------------------------------- 1 | // Package pty provides functions for working with Unix terminals. 2 | package pty 3 | 4 | import ( 5 | "errors" 6 | "os" 7 | ) 8 | 9 | // ErrUnsupported is returned if a function is not 10 | // available on the current platform. 11 | var ErrUnsupported = errors.New("unsupported") 12 | 13 | // Opens a pty and its corresponding tty. 14 | func Open() (pty, tty *os.File, err error) { 15 | return open() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/RoaringBitmap/roaring/shortiterator.go: -------------------------------------------------------------------------------- 1 | package roaring 2 | 3 | type shortIterable interface { 4 | hasNext() bool 5 | next() uint16 6 | } 7 | 8 | type shortIterator struct { 9 | slice []uint16 10 | loc int 11 | } 12 | 13 | func (si *shortIterator) hasNext() bool { 14 | return si.loc < len(si.slice) 15 | } 16 | 17 | func (si *shortIterator) next() uint16 { 18 | a := si.slice[si.loc] 19 | si.loc++ 20 | return a 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | s.RegisterOnShutdown(conf.state.startGracefulShutdown) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /hack/verify-gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit 3 | set -o nounset 4 | set -o pipefail 5 | 6 | find_files() { 7 | find . -not \( \ 8 | \( \ 9 | -wholename '*/vendor/*' \ 10 | \) -prune \ 11 | \) -name '*.go' 12 | } 13 | 14 | GOFMT="gofmt -s" 15 | bad_files=$(find_files | xargs $GOFMT -l) 16 | if [[ -n "${bad_files}" ]]; then 17 | echo "!!! '$GOFMT' needs to be run on the following files: " 18 | echo "${bad_files}" 19 | exit 1 20 | fi 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/xattrs_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // Lgetxattr is not supported on platforms other than linux. 6 | func Lgetxattr(path string, attr string) ([]byte, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | 10 | // Lsetxattr is not supported on platforms other than linux. 11 | func Lsetxattr(path string, attr string, data []byte, flags int) error { 12 | return ErrNotSupportedPlatform 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // langAliasType is the type of an alias in langAliasMap. 8 | type langAliasType int8 9 | 10 | const ( 11 | langDeprecated langAliasType = iota 12 | langMacro 13 | langLegacy 14 | 15 | langAliasTypeUnknown langAliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Lstat takes a path to a file and returns 10 | // a system.StatT type pertaining to that file. 11 | // 12 | // Throws an error if the file does not exist 13 | func Lstat(path string) (*StatT, error) { 14 | s := &syscall.Stat_t{} 15 | if err := syscall.Lstat(path, s); err != nil { 16 | return nil, err 17 | } 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd,!solaris,!openbsd,!darwin 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtimespec}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | // IsTerminal returns true if the given file descriptor is a terminal. 13 | func IsTerminal(f io.Writer) bool { 14 | switch v := f.(type) { 15 | case *os.File: 16 | _, err := unix.IoctlGetTermios(int(v.Fd()), unix.TCGETA) 17 | return err == nil 18 | default: 19 | return false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/hack/generate-authors.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." 5 | 6 | # see also ".mailmap" for how email addresses and names are deduplicated 7 | 8 | { 9 | cat <<-'EOH' 10 | # This file lists all individuals having contributed content to the repository. 11 | # For how it is generated, see `hack/generate-authors.sh`. 12 | EOH 13 | echo 14 | git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf 15 | } > AUTHORS 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // MemInfo contains memory statistics of the host system. 4 | type MemInfo struct { 5 | // Total usable RAM (i.e. physical RAM minus a few reserved bits and the 6 | // kernel binary code). 7 | MemTotal int64 8 | 9 | // Amount of free memory. 10 | MemFree int64 11 | 12 | // Total amount of swap space available. 13 | SwapTotal int64 14 | 15 | // Amount of swap space that is currently unused. 16 | SwapFree int64 17 | } 18 | -------------------------------------------------------------------------------- /lib/term/tc_other.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !linux !cgo 3 | 4 | package term 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | func tcget(fd uintptr, p *Termios) syscall.Errno { 12 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) 13 | return err 14 | } 15 | 16 | func tcset(fd uintptr, p *Termios) syscall.Errno { 17 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/neigh.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Neigh represents a link layer neighbor from netlink. 9 | type Neigh struct { 10 | LinkIndex int 11 | Family int 12 | State int 13 | Type int 14 | Flags int 15 | IP net.IP 16 | HardwareAddr net.HardwareAddr 17 | } 18 | 19 | // String returns $ip/$hwaddr $label 20 | func (neigh *Neigh) String() string { 21 | return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func configureTransport(t1 *http.Transport) (*Transport, error) { 15 | return nil, errTransportVersion 16 | } 17 | 18 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 19 | return 0 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/process_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd solaris darwin 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // IsProcessAlive returns true if process with a given pid is running. 10 | func IsProcessAlive(pid int) bool { 11 | err := syscall.Kill(pid, syscall.Signal(0)) 12 | if err == nil || err == syscall.EPERM { 13 | return true 14 | } 15 | 16 | return false 17 | } 18 | 19 | // KillProcess force-stops a process. 20 | func KillProcess(pid int) { 21 | syscall.Kill(pid, syscall.SIGKILL) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/syscall_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // Unmount is a platform-specific helper function to call 8 | // the unmount syscall. 9 | func Unmount(dest string) error { 10 | return syscall.Unmount(dest, 0) 11 | } 12 | 13 | // CommandLineToArgv should not be used on Unix. 14 | // It simply returns commandLine in the only element in the returned array. 15 | func CommandLineToArgv(commandLine string) ([]string, error) { 16 | return []string{commandLine}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build !go1.8 6 | 7 | package osext 8 | 9 | import ( 10 | "os" 11 | "strconv" 12 | "syscall" 13 | ) 14 | 15 | func executable() (string, error) { 16 | f, err := os.Open("/proc/" + strconv.Itoa(os.Getpid()) + "/text") 17 | if err != nil { 18 | return "", err 19 | } 20 | defer f.Close() 21 | return syscall.Fd2path(int(f.Fd())) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/popcnt_generic.go: -------------------------------------------------------------------------------- 1 | // +build !amd64 appengine 2 | 3 | package bitset 4 | 5 | func popcntSlice(s []uint64) uint64 { 6 | return popcntSliceGo(s) 7 | } 8 | 9 | func popcntMaskSlice(s, m []uint64) uint64 { 10 | return popcntMaskSliceGo(s, m) 11 | } 12 | 13 | func popcntAndSlice(s, m []uint64) uint64 { 14 | return popcntAndSliceGo(s, m) 15 | } 16 | 17 | func popcntOrSlice(s, m []uint64) uint64 { 18 | return popcntOrSliceGo(s, m) 19 | } 20 | 21 | func popcntXorSlice(s, m []uint64) uint64 { 22 | return popcntXorSliceGo(s, m) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/advise_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux,!appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func adviseRead(mem []byte) { 11 | syscall.Madvise(mem, syscall.MADV_SEQUENTIAL|syscall.MADV_WILLNEED) 12 | } 13 | 14 | func adviseWrite(mem []byte) { 15 | syscall.Madvise(mem, syscall.MADV_SEQUENTIAL) 16 | } 17 | 18 | func fallocate(f *os.File, sz int64) error { 19 | err := syscall.Fallocate(int(f.Fd()), 0, 0, sz) 20 | if err == syscall.ENOTSUP { 21 | return f.Truncate(sz) 22 | } 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/RoaringBitmap/roaring/popcnt_generic.go: -------------------------------------------------------------------------------- 1 | // +build !amd64 appengine 2 | 3 | package roaring 4 | 5 | func popcntSlice(s []uint64) uint64 { 6 | return popcntSliceGo(s) 7 | } 8 | 9 | func popcntMaskSlice(s, m []uint64) uint64 { 10 | return popcntMaskSliceGo(s, m) 11 | } 12 | 13 | func popcntAndSlice(s, m []uint64) uint64 { 14 | return popcntAndSliceGo(s, m) 15 | } 16 | 17 | func popcntOrSlice(s, m []uint64) uint64 { 18 | return popcntOrSliceGo(s, m) 19 | } 20 | 21 | func popcntXorSlice(s, m []uint64) uint64 { 22 | return popcntXorSliceGo(s, m) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/gen_common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | // This file contains code common to the maketables.go and the package code. 10 | 11 | // langAliasType is the type of an alias in langAliasMap. 12 | type langAliasType int8 13 | 14 | const ( 15 | langDeprecated langAliasType = iota 16 | langMacro 17 | langLegacy 18 | 19 | langAliasTypeUnknown langAliasType = -1 20 | ) 21 | -------------------------------------------------------------------------------- /hypervisor/types/types.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | const ( 4 | E_OK = iota 5 | E_VM_SHUTDOWN 6 | E_POD_RUNNING 7 | E_BAD_REQUEST 8 | E_FAILED 9 | E_NO_TTY 10 | E_JSON_PARSE_FAIL 11 | E_UNEXPECTED 12 | ) 13 | 14 | // status for POD or container 15 | const ( 16 | S_POD_NONE = iota 17 | S_POD_CREATED 18 | S_POD_RUNNING 19 | S_POD_FAILED 20 | S_POD_SUCCEEDED 21 | S_POD_PAUSED 22 | 23 | S_VM_IDLE 24 | S_VM_ASSOCIATED 25 | S_VM_PAUSED 26 | ) 27 | 28 | type VmResponse struct { 29 | VmId string 30 | Code int 31 | Cause string 32 | Reply interface{} 33 | Data interface{} 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Self returns the path to the current process's binary. 10 | // Uses os.Args[0]. 11 | func Self() string { 12 | return naiveSelf() 13 | } 14 | 15 | // Command returns *exec.Cmd which has Path as current binary. 16 | // For example if current binary is "docker.exe" at "C:\", then cmd.Path will 17 | // be set to "C:\docker.exe". 18 | func Command(args ...string) *exec.Cmd { 19 | return &exec.Cmd{ 20 | Path: Self(), 21 | Args: args, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/yamux/util.go: -------------------------------------------------------------------------------- 1 | package yamux 2 | 3 | // asyncSendErr is used to try an async send of an error 4 | func asyncSendErr(ch chan error, err error) { 5 | if ch == nil { 6 | return 7 | } 8 | select { 9 | case ch <- err: 10 | default: 11 | } 12 | } 13 | 14 | // asyncNotify is used to signal a waiting goroutine 15 | func asyncNotify(ch chan struct{}) { 16 | select { 17 | case ch <- struct{}{}: 18 | default: 19 | } 20 | } 21 | 22 | // min computes the minimum of two values 23 | func min(a, b uint32) uint32 { 24 | if a < b { 25 | return a 26 | } 27 | return b 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig_notcgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo windows 2 | 3 | package system 4 | 5 | func GetClockTicks() int { 6 | // TODO figure out a better alternative for platforms where we're missing cgo 7 | // 8 | // TODO Windows. This could be implemented using Win32 QueryPerformanceFrequency(). 9 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx 10 | // 11 | // An example of its usage can be found here. 12 | // https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx 13 | 14 | return 100 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/process_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // IsProcessAlive returns true if process with a given pid is running. 4 | func IsProcessAlive(pid int) bool { 5 | // TODO Windows containerd. Not sure this is needed 6 | // p, err := os.FindProcess(pid) 7 | // if err == nil { 8 | // return true 9 | // } 10 | return false 11 | } 12 | 13 | // KillProcess force-stops a process. 14 | func KillProcess(pid int) { 15 | // TODO Windows containerd. Not sure this is needed 16 | // p, err := os.FindProcess(pid) 17 | // if err == nil { 18 | // p.Kill() 19 | // } 20 | } 21 | -------------------------------------------------------------------------------- /cli/nsset.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | 7 | "github.com/containernetworking/plugins/pkg/ns" 8 | ) 9 | 10 | func nsSetRun(nsPid int, cb func() error) error { 11 | runtime.LockOSThread() 12 | defer runtime.UnlockOSThread() 13 | 14 | curr, err := ns.GetCurrentNS() 15 | if err != nil { 16 | return err 17 | } 18 | defer curr.Close() 19 | 20 | target, err := ns.GetNS(fmt.Sprintf("/proc/%d/ns/net", nsPid)) 21 | if err != nil { 22 | return err 23 | } 24 | if err = target.Set(); err != nil { 25 | return err 26 | } 27 | defer curr.Set() 28 | 29 | return cb() 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd solaris darwin 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | ) 8 | 9 | // Self returns the path to the current process's binary. 10 | // Uses os.Args[0]. 11 | func Self() string { 12 | return naiveSelf() 13 | } 14 | 15 | // Command returns *exec.Cmd which has Path as current binary. 16 | // For example if current binary is "docker" at "/usr/bin/", then cmd.Path will 17 | // be set to "/usr/bin/docker". 18 | func Command(args ...string) *exec.Cmd { 19 | return &exec.Cmd{ 20 | Path: Self(), 21 | Args: args, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/path_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | // DefaultPathEnv is unix style list of directories to search for 6 | // executables. Each directory is separated from the next by a colon 7 | // ':' character . 8 | const DefaultPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 9 | 10 | // CheckSystemDriveAndRemoveDriveLetter verifies that a path, if it includes a drive letter, 11 | // is the system drive. This is a no-op on Linux. 12 | func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { 13 | return path, nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/NOTICE: -------------------------------------------------------------------------------- 1 | runc 2 | 3 | Copyright 2012-2015 Docker, Inc. 4 | 5 | This product includes software developed at Docker, Inc. (http://www.docker.com). 6 | 7 | The following is courtesy of our legal counsel: 8 | 9 | 10 | Use and transfer of Docker may be subject to certain restrictions by the 11 | United States and other governments. 12 | It is your responsibility to ensure that your use and/or transfer does not 13 | violate applicable laws. 14 | 15 | For more information, please see http://www.bis.doc.gov 16 | 17 | See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. 18 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/socket.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "net" 4 | 5 | // SocketID identifies a single socket. 6 | type SocketID struct { 7 | SourcePort uint16 8 | DestinationPort uint16 9 | Source net.IP 10 | Destination net.IP 11 | Interface uint32 12 | Cookie [2]uint32 13 | } 14 | 15 | // Socket represents a netlink socket. 16 | type Socket struct { 17 | Family uint8 18 | State uint8 19 | Timer uint8 20 | Retrans uint8 21 | ID SocketID 22 | Expires uint32 23 | RQueue uint32 24 | WQueue uint32 25 | UID uint32 26 | INode uint32 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /cli/nsenter/nsenter_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | 14 | // AlwaysFalse is here to stay false 15 | // (and be exported so the compiler doesn't optimize out its reference) 16 | var AlwaysFalse bool 17 | 18 | func init() { 19 | if AlwaysFalse { 20 | // by referencing this C init() in a noop test, it will ensure the compiler 21 | // links in the C function. 22 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 23 | C.init() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoGo authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file, which 3 | # lists people. For example, employees are listed in CONTRIBUTORS, 4 | # but not in AUTHORS, because the employer holds the copyright. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | 11 | # Please keep the list sorted. 12 | 13 | Sendgrid, Inc 14 | Vastech SA (PTY) LTD 15 | Walter Schulze 16 | -------------------------------------------------------------------------------- /tests/bats-integration/kill.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | function setup() { 6 | teardown_busybox 7 | setup_busybox 8 | } 9 | 10 | function teardown() { 11 | teardown_busybox 12 | } 13 | 14 | 15 | @test "kill detached busybox" { 16 | # run busybox detached 17 | runv run -d --console-socket $CONSOLE_SOCKET test_busybox 18 | [ "$status" -eq 0 ] 19 | 20 | # check state 21 | testcontainer test_busybox running 22 | 23 | runv kill test_busybox KILL 24 | [ "$status" -eq 0 ] 25 | 26 | retry 10 1 eval "__runv state test_busybox | grep -q 'stopped'" 27 | 28 | runv delete test_busybox 29 | [ "$status" -eq 0 ] 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runtime-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | import "fmt" 4 | 5 | const ( 6 | // VersionMajor is for an API incompatible changes 7 | VersionMajor = 1 8 | // VersionMinor is for functionality in a backwards-compatible manner 9 | VersionMinor = 0 10 | // VersionPatch is for backwards-compatible bug fixes 11 | VersionPatch = 1 12 | 13 | // VersionDev indicates development branch. Releases will be empty string. 14 | VersionDev = "" 15 | ) 16 | 17 | // Version is the specification version that the package types support. 18 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 19 | -------------------------------------------------------------------------------- /hypervisor/network/network_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!darwin 2 | 3 | package network 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | 9 | "github.com/hyperhq/runv/api" 10 | ) 11 | 12 | func InitNetwork(bIface, bIP string, disableIptables bool) error { 13 | return nil 14 | } 15 | 16 | func AllocateAddr(requestedIP string) (*Settings, error) { 17 | return nil, fmt.Errorf("Generial Network driver is unsupported on this os") 18 | } 19 | 20 | func Configure(inf *api.InterfaceDescription) (*Settings, error) { 21 | return nil, fmt.Errorf("Generial Network driver is unsupported on this os") 22 | } 23 | 24 | func ReleaseAddr(releasedIP string) error { 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /tests/bats-integration/start.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | function setup() { 6 | teardown_busybox 7 | setup_busybox 8 | } 9 | 10 | function teardown() { 11 | teardown_busybox 12 | } 13 | 14 | @test "runv start" { 15 | runv create --console-socket $CONSOLE_SOCKET test_busybox 16 | [ "$status" -eq 0 ] 17 | 18 | testcontainer test_busybox created 19 | 20 | # start container test_busybox 21 | runv start test_busybox 22 | [ "$status" -eq 0 ] 23 | 24 | testcontainer test_busybox running 25 | 26 | # delete test_busybox 27 | runv delete --force test_busybox 28 | 29 | runv state test_busybox 30 | [ "$status" -ne 0 ] 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 2 | 3 | package system 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := unix.RawSyscall(unix.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := unix.RawSyscall(unix.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm 2 | 3 | package system 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := unix.RawSyscall(unix.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := unix.RawSyscall(unix.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/rgbkrk/libvirt-go/go_libvirt.h: -------------------------------------------------------------------------------- 1 | #ifndef GO_LIBVIRT_H 2 | #define GO_LIBVIRT_H 3 | void closeCallback_cgo(virConnectPtr conn, int reason, void *opaque); 4 | int virConnectRegisterCloseCallback_cgo(virConnectPtr c, virConnectCloseFunc cb, long goCallbackId); 5 | 6 | typedef struct auth_cb_data { 7 | char* username; 8 | uint username_len; 9 | char* passphrase; 10 | uint passphrase_len; 11 | } auth_cb_data; 12 | 13 | int* authMechs(); 14 | int authCb(virConnectCredentialPtr cred, unsigned int ncred, void *cbdata); 15 | auth_cb_data* authData(char* username, uint username_len, char* passphrase, uint passphrase_len); 16 | 17 | #endif /* GO_LIBVIRT_H */ 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | // These flags are unsupported. 6 | const ( 7 | BIND = 0 8 | DIRSYNC = 0 9 | MANDLOCK = 0 10 | NOATIME = 0 11 | NODEV = 0 12 | NODIRATIME = 0 13 | NOEXEC = 0 14 | NOSUID = 0 15 | UNBINDABLE = 0 16 | RUNBINDABLE = 0 17 | PRIVATE = 0 18 | RPRIVATE = 0 19 | SHARED = 0 20 | RSHARED = 0 21 | SLAVE = 0 22 | RSLAVE = 0 23 | RBIND = 0 24 | RELATIME = 0 25 | RELATIVE = 0 26 | REMOUNT = 0 27 | STRICTATIME = 0 28 | SYNCHRONOUS = 0 29 | RDONLY = 0 30 | ) 31 | -------------------------------------------------------------------------------- /hack/test-cmd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This command checks that the built commands can function together for 4 | # simple scenarios. It does not require Docker so it can run in travis. 5 | 6 | set -o errexit 7 | set -o nounset 8 | set -o pipefail 9 | 10 | # prepare kernel and initrd 11 | export HYPERSTARTPATH="$GOPATH/src/github.com/hyperhq/hyperstart" 12 | export RUNVPATH="$GOPATH/src/github.com/hyperhq/runv" 13 | cd $HYPERSTARTPATH && ./autogen.sh && ./configure && make 14 | cp -v $HYPERSTARTPATH/build/{arch/x86_64/kernel,hyper-initrd.img} $RUNVPATH/tests/go-integration/test_data/ 15 | 16 | # do runv integration-test 17 | cd $RUNVPATH 18 | hack/install-bats.sh 19 | make test-integration 20 | 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Code"; DO NOT EDIT. 2 | 3 | package codes 4 | 5 | import "strconv" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i >= Code(len(_Code_index)-1) { 13 | return "Code(" + strconv.FormatInt(int64(i), 10) + ")" 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package trace 8 | 9 | import "context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // Lstat calls os.Lstat to get a fileinfo interface back. 10 | // This is then copied into our own locally defined structure. 11 | // Note the Linux version uses fromStatT to do the copy back, 12 | // but that not strictly necessary when already in an OS specific module. 13 | func Lstat(path string) (*StatT, error) { 14 | fi, err := os.Lstat(path) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return &StatT{ 20 | name: fi.Name(), 21 | size: fi.Size(), 22 | mode: fi.Mode(), 23 | modTime: fi.ModTime(), 24 | isDir: fi.IsDir()}, nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/order.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "encoding/binary" 5 | 6 | "github.com/vishvananda/netlink/nl" 7 | ) 8 | 9 | var ( 10 | native = nl.NativeEndian() 11 | networkOrder = binary.BigEndian 12 | ) 13 | 14 | func htonl(val uint32) []byte { 15 | bytes := make([]byte, 4) 16 | binary.BigEndian.PutUint32(bytes, val) 17 | return bytes 18 | } 19 | 20 | func htons(val uint16) []byte { 21 | bytes := make([]byte, 2) 22 | binary.BigEndian.PutUint16(bytes, val) 23 | return bytes 24 | } 25 | 26 | func ntohl(buf []byte) uint32 { 27 | return binary.BigEndian.Uint32(buf) 28 | } 29 | 30 | func ntohs(buf []byte) uint16 { 31 | return binary.BigEndian.Uint16(buf) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | var _path *byte 12 | _path, err := syscall.BytePtrFromString(path) 13 | if err != nil { 14 | return err 15 | } 16 | 17 | if _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 linux,amd64 linux,ppc linux,ppc64 linux,ppc64le linux,s390x 2 | 3 | package system 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := unix.RawSyscall(unix.SYS_SETUID, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := unix.RawSyscall(unix.SYS_SETGID, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package trace 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /hack/validate-vet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=( $(find . -path ./vendor -prune -o -name "*.go" -print) ) 4 | 5 | errors=() 6 | for f in "${files[@]}"; do 7 | failedVet=$(go tool vet --printf=false "$f" 2>&1) 8 | if [ "$failedVet" ]; then 9 | errors+=( "$failedVet" ) 10 | fi 11 | done 12 | 13 | if [ ${#errors[@]} -eq 0 ]; then 14 | echo 'Congratulations! All Go source files have been vetted.' 15 | else 16 | { 17 | echo "Errors from go vet:" 18 | for err in "${errors[@]}"; do 19 | echo " - $err" 20 | done 21 | echo 22 | echo 'Please fix the above errors. You can test via "go vet" and commit the result.' 23 | echo 24 | } >&2 25 | false 26 | fi 27 | -------------------------------------------------------------------------------- /lib/utils/mount_linux.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | ) 7 | 8 | func Mount(src, dst string) error { 9 | if _, err := os.Stat(dst); os.IsNotExist(err) { 10 | os.MkdirAll(dst, 0755) 11 | } 12 | 13 | return syscall.Mount(src, dst, "", syscall.MS_BIND|syscall.MS_REC, "") 14 | } 15 | 16 | func SetReadonly(path string) error { 17 | if err := syscall.Mount(path, path, "", syscall.MS_BIND|syscall.MS_REC, ""); err != nil { 18 | if os.IsNotExist(err) { 19 | return nil 20 | } 21 | return err 22 | } 23 | return syscall.Mount(path, path, "", syscall.MS_BIND|syscall.MS_REMOUNT|syscall.MS_RDONLY|syscall.MS_REC, "") 24 | } 25 | 26 | func Umount(root string) { 27 | syscall.Unmount(root, syscall.MNT_DETACH) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2017 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | This product contains software (https://github.com/kr/pty) developed 7 | by Keith Rarick, licensed under the MIT License. 8 | 9 | The following is courtesy of our legal counsel: 10 | 11 | 12 | Use and transfer of Docker may be subject to certain restrictions by the 13 | United States and other governments. 14 | It is your responsibility to ensure that your use and/or transfer does not 15 | violate applicable laws. 16 | 17 | For more information, please see https://www.bis.doc.gov 18 | 19 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // Stat takes a path to a file and returns 18 | // a system.Stat_t type pertaining to that file. 19 | // 20 | // Throws an error if the file does not exist 21 | func Stat(path string) (*StatT, error) { 22 | s := &syscall.Stat_t{} 23 | if err := syscall.Stat(path, s); err != nil { 24 | return nil, err 25 | } 26 | return fromStatT(s) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runtime-spec/specs-go/state.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | // State holds information about the runtime state of the container. 4 | type State struct { 5 | // Version is the version of the specification that is supported. 6 | Version string `json:"ociVersion"` 7 | // ID is the container ID 8 | ID string `json:"id"` 9 | // Status is the runtime status of the container. 10 | Status string `json:"status"` 11 | // Pid is the process ID for the container process. 12 | Pid int `json:"pid,omitempty"` 13 | // Bundle is the path to the container's bundle directory. 14 | Bundle string `json:"bundle"` 15 | // Annotations are key values associated with the container. 16 | Annotations map[string]string `json:"annotations,omitempty"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/file_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "os" 9 | "syscall" 10 | ) 11 | 12 | // FIXME: unexported function from os 13 | // syscallMode returns the syscall-specific mode bits from Go's portable mode bits. 14 | func syscallMode(i os.FileMode) (o uint32) { 15 | o |= uint32(i.Perm()) 16 | if i&os.ModeSetuid != 0 { 17 | o |= syscall.S_ISUID 18 | } 19 | if i&os.ModeSetgid != 0 { 20 | o |= syscall.S_ISGID 21 | } 22 | if i&os.ModeSticky != 0 { 23 | o |= syscall.S_ISVTX 24 | } 25 | // No mapping for Go's ModeTemporary (plan9 only). 26 | return 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /hypervisor/network/network_darwin.go: -------------------------------------------------------------------------------- 1 | package network 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hyperhq/runv/api" 7 | ) 8 | 9 | func InitNetwork(bIface, bIP string, disableIptables bool) error { 10 | return fmt.Errorf("Generial Network driver is unsupported on this os") 11 | } 12 | 13 | func Configure(inf *api.InterfaceDescription) (*Settings, error) { 14 | return nil, fmt.Errorf("Generial Network driver is unsupported on this os") 15 | } 16 | 17 | func AllocateAddr(requestedIP string) (*Settings, error) { 18 | return nil, fmt.Errorf("Generial Network driver is unsupported on this os") 19 | } 20 | 21 | // Release an interface for a select ip 22 | func ReleaseAddr(releasedIP string) error { 23 | return fmt.Errorf("Generial Network driver is unsupported on this os") 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/xfrm_monitor_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "unsafe" 5 | ) 6 | 7 | const ( 8 | SizeofXfrmUserExpire = 0xe8 9 | ) 10 | 11 | // struct xfrm_user_expire { 12 | // struct xfrm_usersa_info state; 13 | // __u8 hard; 14 | // }; 15 | 16 | type XfrmUserExpire struct { 17 | XfrmUsersaInfo XfrmUsersaInfo 18 | Hard uint8 19 | Pad [7]byte 20 | } 21 | 22 | func (msg *XfrmUserExpire) Len() int { 23 | return SizeofXfrmUserExpire 24 | } 25 | 26 | func DeserializeXfrmUserExpire(b []byte) *XfrmUserExpire { 27 | return (*XfrmUserExpire)(unsafe.Pointer(&b[0:SizeofXfrmUserExpire][0])) 28 | } 29 | 30 | func (msg *XfrmUserExpire) Serialize() []byte { 31 | return (*(*[SizeofXfrmUserExpire]byte)(unsafe.Pointer(msg)))[:] 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | 29 | func go18httpNoBody() io.ReadCloser { return nil } // for tests only 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/run.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pty 4 | 5 | import ( 6 | "os" 7 | "os/exec" 8 | "syscall" 9 | ) 10 | 11 | // Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, 12 | // and c.Stderr, calls c.Start, and returns the File of the tty's 13 | // corresponding pty. 14 | func Start(c *exec.Cmd) (pty *os.File, err error) { 15 | pty, tty, err := Open() 16 | if err != nil { 17 | return nil, err 18 | } 19 | defer tty.Close() 20 | c.Stdout = tty 21 | c.Stdin = tty 22 | c.Stderr = tty 23 | if c.SysProcAttr == nil { 24 | c.SysProcAttr = &syscall.SysProcAttr{} 25 | } 26 | c.SysProcAttr.Setctty = true 27 | c.SysProcAttr.Setsid = true 28 | err = c.Start() 29 | if err != nil { 30 | pty.Close() 31 | return nil, err 32 | } 33 | return pty, err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/reexec/command_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package reexec 4 | 5 | import ( 6 | "os/exec" 7 | "syscall" 8 | ) 9 | 10 | // Self returns the path to the current process's binary. 11 | // Returns "/proc/self/exe". 12 | func Self() string { 13 | return "/proc/self/exe" 14 | } 15 | 16 | // Command returns *exec.Cmd which has Path as current binary. Also it setting 17 | // SysProcAttr.Pdeathsig to SIGTERM. 18 | // This will use the in-memory version (/proc/self/exe) of the current binary, 19 | // it is thus safe to delete or replace the on-disk binary (os.Args[0]). 20 | func Command(args ...string) *exec.Cmd { 21 | return &exec.Cmd{ 22 | Path: Self(), 23 | Args: args, 24 | SysProcAttr: &syscall.SysProcAttr{ 25 | Pdeathsig: syscall.SIGTERM, 26 | }, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // } 16 | // 17 | // app.Run(os.Args) 18 | // } 19 | package cli 20 | 21 | //go:generate python ./generate-flag-types cli -i flag-types.json -o flag_generated.go 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 16 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 17 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 18 | if errno == 0 { 19 | return nil 20 | } 21 | return errno 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/util.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pty 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // Getsize returns the number of rows (lines) and cols (positions 12 | // in each line) in terminal t. 13 | func Getsize(t *os.File) (rows, cols int, err error) { 14 | var ws winsize 15 | err = windowrect(&ws, t.Fd()) 16 | return int(ws.ws_row), int(ws.ws_col), err 17 | } 18 | 19 | type winsize struct { 20 | ws_row uint16 21 | ws_col uint16 22 | ws_xpixel uint16 23 | ws_ypixel uint16 24 | } 25 | 26 | func windowrect(ws *winsize, fd uintptr) error { 27 | _, _, errno := syscall.Syscall( 28 | syscall.SYS_IOCTL, 29 | fd, 30 | syscall.TIOCGWINSZ, 31 | uintptr(unsafe.Pointer(ws)), 32 | ) 33 | if errno != 0 { 34 | return syscall.Errno(errno) 35 | } 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /api/status.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import "time" 4 | 5 | type Result interface { 6 | ResultId() string 7 | IsSuccess() bool 8 | Message() string 9 | } 10 | 11 | type ResultBase struct { 12 | Id string 13 | Success bool 14 | ResultMessage string 15 | } 16 | 17 | type ProcessExit struct { 18 | Id string 19 | Code int 20 | FinishedAt time.Time 21 | } 22 | 23 | func NewResultBase(id string, success bool, message string) *ResultBase { 24 | return &ResultBase{ 25 | Id: id, 26 | Success: success, 27 | ResultMessage: message, 28 | } 29 | } 30 | 31 | func (r *ResultBase) ResultId() string { 32 | return r.Id 33 | } 34 | 35 | func (r *ResultBase) IsSuccess() bool { 36 | return r.Success 37 | } 38 | 39 | func (r *ResultBase) Message() string { 40 | return r.ResultMessage 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "io" 13 | "os" 14 | "syscall" 15 | "unsafe" 16 | ) 17 | 18 | // IsTerminal returns true if stderr's file descriptor is a terminal. 19 | func IsTerminal(f io.Writer) bool { 20 | var termios Termios 21 | switch v := f.(type) { 22 | case *os.File: 23 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(v.Fd()), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 24 | return err == 0 25 | default: 26 | return false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | //setCTime will set the create time on a file. On Windows, this requires 11 | //calling SetFileTime and explicitly including the create time. 12 | func setCTime(path string, ctime time.Time) error { 13 | ctimespec := syscall.NsecToTimespec(ctime.UnixNano()) 14 | pathp, e := syscall.UTF16PtrFromString(path) 15 | if e != nil { 16 | return e 17 | } 18 | h, e := syscall.CreateFile(pathp, 19 | syscall.FILE_WRITE_ATTRIBUTES, syscall.FILE_SHARE_WRITE, nil, 20 | syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0) 21 | if e != nil { 22 | return e 23 | } 24 | defer syscall.Close(h) 25 | c := syscall.NsecToFiletime(syscall.TimespecToNsec(ctimespec)) 26 | return syscall.SetFileTime(h, &c, nil, nil) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | Package grpc implements an RPC system called gRPC. 21 | 22 | See grpc.io for more information about gRPC. 23 | */ 24 | package grpc // import "google.golang.org/grpc" 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | // These are not currently available in syscall 12 | atFdCwd := -100 13 | atSymLinkNoFollow := 0x100 14 | 15 | var _path *byte 16 | _path, err := syscall.BytePtrFromString(path) 17 | if err != nil { 18 | return err 19 | } 20 | 21 | if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(atSymLinkNoFollow), 0, 0); err != 0 && err != syscall.ENOSYS { 22 | return err 23 | } 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/mpls_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import "encoding/binary" 4 | 5 | const ( 6 | MPLS_LS_LABEL_SHIFT = 12 7 | MPLS_LS_S_SHIFT = 8 8 | ) 9 | 10 | func EncodeMPLSStack(labels ...int) []byte { 11 | b := make([]byte, 4*len(labels)) 12 | for idx, label := range labels { 13 | l := label << MPLS_LS_LABEL_SHIFT 14 | if idx == len(labels)-1 { 15 | l |= 1 << MPLS_LS_S_SHIFT 16 | } 17 | binary.BigEndian.PutUint32(b[idx*4:], uint32(l)) 18 | } 19 | return b 20 | } 21 | 22 | func DecodeMPLSStack(buf []byte) []int { 23 | if len(buf)%4 != 0 { 24 | return nil 25 | } 26 | stack := make([]int, 0, len(buf)/4) 27 | for len(buf) > 0 { 28 | l := binary.BigEndian.Uint32(buf[:4]) 29 | buf = buf[4:] 30 | stack = append(stack, int(l)>>MPLS_LS_LABEL_SHIFT) 31 | if (l>>MPLS_LS_S_SHIFT)&1 > 0 { 32 | break 33 | } 34 | } 35 | return stack 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/longpath/longpath.go: -------------------------------------------------------------------------------- 1 | // longpath introduces some constants and helper functions for handling long paths 2 | // in Windows, which are expected to be prepended with `\\?\` and followed by either 3 | // a drive letter, a UNC server\share, or a volume identifier. 4 | 5 | package longpath 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // Prefix is the longpath prefix for Windows file paths. 12 | const Prefix = `\\?\` 13 | 14 | // AddPrefix will add the Windows long path prefix to the path provided if 15 | // it does not already have it. 16 | func AddPrefix(path string) string { 17 | if !strings.HasPrefix(path, Prefix) { 18 | if strings.HasPrefix(path, `\\`) { 19 | // This is a UNC path, so we need to add 'UNC' to the path as well. 20 | path = Prefix + `UNC` + path[1:] 21 | } else { 22 | path = Prefix + path 23 | } 24 | } 25 | return path 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "io" 12 | "os" 13 | "syscall" 14 | "unsafe" 15 | ) 16 | 17 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 18 | 19 | var ( 20 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 21 | ) 22 | 23 | // IsTerminal returns true if stderr's file descriptor is a terminal. 24 | func IsTerminal(f io.Writer) bool { 25 | switch v := f.(type) { 26 | case *os.File: 27 | var st uint32 28 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(v.Fd()), uintptr(unsafe.Pointer(&st)), 0) 29 | return r != 0 && e == 0 30 | default: 31 | return false 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_darwin.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // FromStatT loads a system.StatT from a syscall.Stat_t. 18 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 19 | return fromStatT(s) 20 | } 21 | 22 | // Stat takes a path to a file and returns 23 | // a system.StatT type pertaining to that file. 24 | // 25 | // Throws an error if the file does not exist 26 | func Stat(path string) (*StatT, error) { 27 | s := &syscall.Stat_t{} 28 | if err := syscall.Stat(path, s); err != nil { 29 | return nil, err 30 | } 31 | return fromStatT(s) 32 | } 33 | -------------------------------------------------------------------------------- /agent/pipe.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | import "io" 4 | 5 | type inPipe struct { 6 | h SandboxAgent 7 | c, p string 8 | } 9 | 10 | func (p *inPipe) Write(data []byte) (n int, err error) { 11 | return p.h.WriteStdin(p.c, p.p, data) 12 | } 13 | 14 | func (p *inPipe) Close() error { 15 | return p.h.CloseStdin(p.c, p.p) 16 | } 17 | 18 | type outPipe struct { 19 | h SandboxAgent 20 | c, p string 21 | } 22 | 23 | func (p *outPipe) Read(data []byte) (n int, err error) { 24 | return p.h.ReadStdout(p.c, p.p, data) 25 | } 26 | 27 | type errPipe struct { 28 | h SandboxAgent 29 | c, p string 30 | } 31 | 32 | func (p *errPipe) Read(data []byte) (n int, err error) { 33 | return p.h.ReadStderr(p.c, p.p, data) 34 | } 35 | 36 | func StdioPipe(h SandboxAgent, c, p string) (io.WriteCloser, io.Reader, io.Reader) { 37 | return &inPipe{h: h, c: c, p: p}, &outPipe{h: h, c: c, p: p}, &errPipe{h: h, c: c, p: p} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/mknod.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Mknod creates a filesystem node (file, device special file or named pipe) named path 10 | // with attributes specified by mode and dev. 11 | func Mknod(path string, mode uint32, dev int) error { 12 | return syscall.Mknod(path, mode, dev) 13 | } 14 | 15 | // Mkdev is used to build the value of linux devices (in /dev/) which specifies major 16 | // and minor number of the newly created device special file. 17 | // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. 18 | // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, 19 | // then the top 12 bits of the minor. 20 | func Mkdev(major int64, minor int64) uint32 { 21 | return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: s.Mode, 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: s.Rdev, 14 | mtim: s.Mtim}, nil 15 | } 16 | 17 | // FromStatT exists only on linux, and loads a system.StatT from a 18 | // syscal.Stat_t. 19 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 20 | return fromStatT(s) 21 | } 22 | 23 | // Stat takes a path to a file and returns 24 | // a system.StatT type pertaining to that file. 25 | // 26 | // Throws an error if the file does not exist 27 | func Stat(path string) (*StatT, error) { 28 | s := &syscall.Stat_t{} 29 | if err := syscall.Stat(path, s); err != nil { 30 | return nil, err 31 | } 32 | return fromStatT(s) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | import ( 12 | "fmt" 13 | ) 14 | 15 | func parseMountTable() ([]*Info, error) { 16 | mnttab := C.fopen(C.CString(C.MNTTAB), C.CString("r")) 17 | if mnttab == nil { 18 | return nil, fmt.Errorf("Failed to open %s", C.MNTTAB) 19 | } 20 | 21 | var out []*Info 22 | var mp C.struct_mnttab 23 | 24 | ret := C.getmntent(mnttab, &mp) 25 | for ret == 0 { 26 | var mountinfo Info 27 | mountinfo.Mountpoint = C.GoString(mp.mnt_mountp) 28 | mountinfo.Source = C.GoString(mp.mnt_special) 29 | mountinfo.Fstype = C.GoString(mp.mnt_fstype) 30 | mountinfo.Opts = C.GoString(mp.mnt_mntopts) 31 | out = append(out, &mountinfo) 32 | ret = C.getmntent(mnttab, &mp) 33 | } 34 | 35 | C.fclose(mnttab) 36 | return out, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtim}, nil 17 | } 18 | 19 | // FromStatT loads a system.StatT from a syscal.Stat_t. 20 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 21 | return fromStatT(s) 22 | } 23 | 24 | // Stat takes a path to a file and returns 25 | // a system.StatT type pertaining to that file. 26 | // 27 | // Throws an error if the file does not exist 28 | func Stat(path string) (*StatT, error) { 29 | s := &syscall.Stat_t{} 30 | if err := syscall.Stat(path, s); err != nil { 31 | return nil, err 32 | } 33 | return fromStatT(s) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anton Povarov 2 | Brian Goff 3 | Clayton Coleman 4 | Denis Smirnov 5 | DongYun Kang 6 | Dwayne Schultz 7 | Georg Apitz 8 | Gustav Paul 9 | Johan Brandhorst 10 | John Shahid 11 | John Tuley 12 | Laurent 13 | Patrick Lee 14 | Roger Johansson 15 | Sam Nguyen 16 | Sergio Arbeo 17 | Stephen J Day 18 | Tamir Duberstein 19 | Todd Eisenberger 20 | Tormod Erevik Lea 21 | Vyacheslav Kim 22 | Walter Schulze 23 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/size.go: -------------------------------------------------------------------------------- 1 | package msgp 2 | 3 | // The sizes provided 4 | // are the worst-case 5 | // encoded sizes for 6 | // each type. For variable- 7 | // length types ([]byte, string), 8 | // the total encoded size is 9 | // the prefix size plus the 10 | // length of the object. 11 | const ( 12 | Int64Size = 9 13 | IntSize = Int64Size 14 | UintSize = Int64Size 15 | Int8Size = 2 16 | Int16Size = 3 17 | Int32Size = 5 18 | Uint8Size = 2 19 | ByteSize = Uint8Size 20 | Uint16Size = 3 21 | Uint32Size = 5 22 | Uint64Size = Int64Size 23 | Float64Size = 9 24 | Float32Size = 5 25 | Complex64Size = 10 26 | Complex128Size = 18 27 | 28 | TimeSize = 15 29 | BoolSize = 1 30 | NilSize = 1 31 | 32 | MapHeaderSize = 5 33 | ArrayHeaderSize = 5 34 | 35 | BytesPrefixSize = 5 36 | StringPrefixSize = 5 37 | ExtensionPrefixSize = 6 38 | ) 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /hypervisor/log.go: -------------------------------------------------------------------------------- 1 | package hypervisor 2 | 3 | import ( 4 | "github.com/hyperhq/hypercontainer-utils/hlog" 5 | ) 6 | 7 | const ( 8 | ERROR = hlog.ERROR 9 | WARNING = hlog.WARNING 10 | INFO = hlog.INFO 11 | DEBUG = hlog.DEBUG 12 | TRACE = hlog.TRACE 13 | EXTRA = hlog.EXTRA 14 | ) 15 | 16 | func (ctx *VmContext) LogLevel(level hlog.LogLevel) bool { 17 | return hlog.IsLogLevel(level) 18 | } 19 | 20 | func (ctx *VmContext) LogPrefix() string { 21 | if ctx == nil { 22 | return "SB[] " 23 | } 24 | return ctx.logPrefix 25 | } 26 | 27 | func (ctx *VmContext) Log(level hlog.LogLevel, args ...interface{}) { 28 | hlog.HLog(level, ctx, 1, args...) 29 | } 30 | 31 | func (cc *ContainerContext) LogPrefix() string { 32 | if cc == nil { 33 | return "SB[] Con[] " 34 | } 35 | return cc.logPrefix 36 | } 37 | 38 | func (cc *ContainerContext) Log(level hlog.LogLevel, args ...interface{}) { 39 | hlog.HLog(level, cc, 1, args...) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | lookupTXT = net.DefaultResolver.LookupTXT 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/netns_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netns 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | ErrNotImplemented = errors.New("not implemented") 11 | ) 12 | 13 | func Set(ns NsHandle) (err error) { 14 | return ErrNotImplemented 15 | } 16 | 17 | func New() (ns NsHandle, err error) { 18 | return -1, ErrNotImplemented 19 | } 20 | 21 | func Get() (NsHandle, error) { 22 | return -1, ErrNotImplemented 23 | } 24 | 25 | func GetFromPath(path string) (NsHandle, error) { 26 | return -1, ErrNotImplemented 27 | } 28 | 29 | func GetFromName(name string) (NsHandle, error) { 30 | return -1, ErrNotImplemented 31 | } 32 | 33 | func GetFromPid(pid int) (NsHandle, error) { 34 | return -1, ErrNotImplemented 35 | } 36 | 37 | func GetFromThread(pid, tid int) (NsHandle, error) { 38 | return -1, ErrNotImplemented 39 | } 40 | 41 | func GetFromDocker(id string) (NsHandle, error) { 42 | return -1, ErrNotImplemented 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "time" 8 | ) 9 | 10 | // StatT type contains status of a file. It contains metadata 11 | // like name, permission, size, etc about a file. 12 | type StatT struct { 13 | name string 14 | size int64 15 | mode os.FileMode 16 | modTime time.Time 17 | isDir bool 18 | } 19 | 20 | // Name returns file's name. 21 | func (s StatT) Name() string { 22 | return s.name 23 | } 24 | 25 | // Size returns file's size. 26 | func (s StatT) Size() int64 { 27 | return s.size 28 | } 29 | 30 | // Mode returns file's permission mode. 31 | func (s StatT) Mode() os.FileMode { 32 | return s.mode 33 | } 34 | 35 | // ModTime returns file's last modification time. 36 | func (s StatT) ModTime() time.Time { 37 | return s.modTime 38 | } 39 | 40 | // IsDir returns whether file is actually a directory. 41 | func (s StatT) IsDir() bool { 42 | return s.isDir 43 | } 44 | -------------------------------------------------------------------------------- /hypervisor/kvmtool/lkvm_arm64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 2 | 3 | package kvmtool 4 | 5 | import ( 6 | "bufio" 7 | "os" 8 | "strings" 9 | ) 10 | 11 | // On ARM platform, we have different gic interrupt controllers. 12 | // We have to detect the correct gic chip to set parameter for lkvm. 13 | func getGicInfo() (info string) { 14 | gicinfo, err := os.Open("/proc/interrupts") 15 | if err != nil { 16 | return "unknown" 17 | } 18 | 19 | defer gicinfo.Close() 20 | 21 | scanner := bufio.NewScanner(gicinfo) 22 | for scanner.Scan() { 23 | newline := scanner.Text() 24 | list := strings.Fields(newline) 25 | 26 | for _, item := range list { 27 | if strings.EqualFold(item, "GICv2") { 28 | return "gicv2" 29 | } else if strings.EqualFold(item, "GICv3") || 30 | strings.EqualFold(item, "GICv4") { 31 | return "gicv3" 32 | } 33 | } 34 | } 35 | 36 | return "unknown" 37 | } 38 | 39 | func arch_arguments() []string { 40 | return []string{"--irqchip", getGicInfo()} 41 | } 42 | -------------------------------------------------------------------------------- /lib/term/tty.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "io" 7 | "net" 8 | "os" 9 | ) 10 | 11 | func TtySplice(conn net.Conn) (int, error) { 12 | inFd, _ := GetFdInfo(os.Stdin) 13 | oldState, err := SetRawTerminal(inFd) 14 | if err != nil { 15 | return -1, err 16 | } 17 | defer RestoreTerminal(inFd, oldState) 18 | 19 | br := bufio.NewReader(conn) 20 | 21 | receiveStdout := make(chan error, 1) 22 | go func() { 23 | _, err = io.Copy(os.Stdout, br) 24 | receiveStdout <- err 25 | }() 26 | 27 | go func() { 28 | written, err := io.Copy(conn, os.Stdin) 29 | fmt.Printf("copy from stdin to remote %v, err %v\n", written, err) 30 | 31 | if sock, ok := conn.(interface { 32 | CloseWrite() error 33 | }); ok { 34 | if err := sock.CloseWrite(); err != nil { 35 | fmt.Printf("Couldn't send EOF: %s\n", err.Error()) 36 | } 37 | } 38 | }() 39 | 40 | if err := <-receiveStdout; err != nil { 41 | return -1, err 42 | } 43 | 44 | return 0, nil 45 | 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/rule.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Rule represents a netlink rule. 9 | type Rule struct { 10 | Priority int 11 | Table int 12 | Mark int 13 | Mask int 14 | TunID uint 15 | Goto int 16 | Src *net.IPNet 17 | Dst *net.IPNet 18 | Flow int 19 | IifName string 20 | OifName string 21 | SuppressIfgroup int 22 | SuppressPrefixlen int 23 | } 24 | 25 | func (r Rule) String() string { 26 | return fmt.Sprintf("ip rule %d: from %s table %d", r.Priority, r.Src, r.Table) 27 | } 28 | 29 | // NewRule return empty rules. 30 | func NewRule() *Rule { 31 | return &Rule{ 32 | SuppressIfgroup: -1, 33 | SuppressPrefixlen: -1, 34 | Priority: -1, 35 | Mark: -1, 36 | Mask: -1, 37 | Goto: -1, 38 | Flow: -1, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | "unsafe" 8 | ) 9 | 10 | // #include 11 | // #include 12 | // #include 13 | // int Mount(const char *spec, const char *dir, int mflag, 14 | // char *fstype, char *dataptr, int datalen, char *optptr, int optlen) { 15 | // return mount(spec, dir, mflag, fstype, dataptr, datalen, optptr, optlen); 16 | // } 17 | import "C" 18 | 19 | func mount(device, target, mType string, flag uintptr, data string) error { 20 | spec := C.CString(device) 21 | dir := C.CString(target) 22 | fstype := C.CString(mType) 23 | _, err := C.Mount(spec, dir, C.int(flag), fstype, nil, 0, nil, 0) 24 | C.free(unsafe.Pointer(spec)) 25 | C.free(unsafe.Pointer(dir)) 26 | C.free(unsafe.Pointer(fstype)) 27 | return err 28 | } 29 | 30 | func unmount(target string, flag int) error { 31 | err := unix.Unmount(target, flag) 32 | return err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build !go1.8 6 | 7 | package osext 8 | 9 | import ( 10 | "syscall" 11 | "unicode/utf16" 12 | "unsafe" 13 | ) 14 | 15 | var ( 16 | kernel = syscall.MustLoadDLL("kernel32.dll") 17 | getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW") 18 | ) 19 | 20 | // GetModuleFileName() with hModule = NULL 21 | func executable() (exePath string, err error) { 22 | return getModuleFileName() 23 | } 24 | 25 | func getModuleFileName() (string, error) { 26 | var n uint32 27 | b := make([]uint16, syscall.MAX_PATH) 28 | size := uint32(len(b)) 29 | 30 | r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size)) 31 | n = uint32(r0) 32 | if n == 0 { 33 | return "", e1 34 | } 35 | return string(utf16.Decode(b[0:n])), nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/file_port.go: -------------------------------------------------------------------------------- 1 | // +build windows appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "io/ioutil" 7 | "os" 8 | ) 9 | 10 | // MarshalSizer is the combination 11 | // of the Marshaler and Sizer 12 | // interfaces. 13 | type MarshalSizer interface { 14 | Marshaler 15 | Sizer 16 | } 17 | 18 | func ReadFile(dst Unmarshaler, file *os.File) error { 19 | if u, ok := dst.(Decodable); ok { 20 | return u.DecodeMsg(NewReader(file)) 21 | } 22 | 23 | data, err := ioutil.ReadAll(file) 24 | if err != nil { 25 | return err 26 | } 27 | _, err = dst.UnmarshalMsg(data) 28 | return err 29 | } 30 | 31 | func WriteFile(src MarshalSizer, file *os.File) error { 32 | if e, ok := src.(Encodable); ok { 33 | w := NewWriter(file) 34 | err := e.EncodeMsg(w) 35 | if err == nil { 36 | err = w.Flush() 37 | } 38 | return err 39 | } 40 | 41 | raw, err := src.MarshalMsg(nil) 42 | if err != nil { 43 | return err 44 | } 45 | _, err = file.Write(raw) 46 | return err 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/rgbkrk/libvirt-go/constants_1.2.14.go: -------------------------------------------------------------------------------- 1 | // +build libvirt.1.2.14 2 | 3 | package libvirt 4 | 5 | /* 6 | #cgo LDFLAGS: -lvirt 7 | #include 8 | #include 9 | #include 10 | */ 11 | import "C" 12 | 13 | // virStorageVolCreateFlags 14 | const ( 15 | VIR_STORAGE_VOL_CREATE_REFLINK = C.VIR_STORAGE_VOL_CREATE_REFLINK 16 | ) 17 | // virDomainBlockCopyFlags 18 | const ( 19 | VIR_DOMAIN_BLOCK_COPY_SHALLOW = C.VIR_DOMAIN_BLOCK_COPY_SHALLOW 20 | VIR_DOMAIN_BLOCK_COPY_REUSE_EXT = C.VIR_DOMAIN_BLOCK_COPY_REUSE_EXT 21 | ) 22 | // virDomainBlockCopyParameterObjects 23 | const ( 24 | VIR_DOMAIN_BLOCK_COPY_GRANULARITY = C.VIR_DOMAIN_BLOCK_COPY_GRANULARITY 25 | VIR_DOMAIN_BLOCK_COPY_BANDWIDTH = C.VIR_DOMAIN_BLOCK_COPY_BANDWIDTH 26 | VIR_DOMAIN_BLOCK_COPY_BUF_SIZE = C.VIR_DOMAIN_BLOCK_COPY_BUF_SIZE 27 | ) 28 | 29 | // virDomainBlockJobInfoFlags 30 | const ( 31 | VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES = C.VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES 32 | ) 33 | -------------------------------------------------------------------------------- /factory/direct/direct.go: -------------------------------------------------------------------------------- 1 | package direct 2 | 3 | import ( 4 | "github.com/golang/glog" 5 | "github.com/hyperhq/runv/factory/base" 6 | "github.com/hyperhq/runv/hypervisor" 7 | ) 8 | 9 | type directFactory struct { 10 | config hypervisor.BootConfig 11 | } 12 | 13 | func New(b hypervisor.BootConfig) base.Factory { 14 | return &directFactory{config: b} 15 | } 16 | 17 | func (d *directFactory) Config() *hypervisor.BootConfig { 18 | config := d.config 19 | return &config 20 | } 21 | 22 | func (d *directFactory) GetBaseVm() (*hypervisor.Vm, error) { 23 | glog.V(3).Infof("direct factory start create vm") 24 | vm, err := hypervisor.GetVm("", d.Config(), true) 25 | if err == nil { 26 | err = vm.Pause(true) 27 | if err != nil { 28 | vm.Kill() 29 | vm = nil 30 | } 31 | } 32 | if err == nil { 33 | glog.V(3).Infof("direct factory created vm: %s", vm.Id) 34 | } else { 35 | glog.Errorf("direct factory failed to create vm") 36 | } 37 | return vm, err 38 | } 39 | 40 | func (d *directFactory) CloseFactory() {} 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Patch 7 | *.diff 8 | *.patch 9 | *.orig 10 | *.rej 11 | 12 | # Folders 13 | _obj 14 | _test 15 | 16 | # Autoconf/Automake generated files 17 | aclocal.m4 18 | .deps 19 | autom4te.cache 20 | Makefile 21 | Makefile.in 22 | ar-lib 23 | compile 24 | config.log 25 | config.status 26 | configure 27 | depcomp 28 | install-sh 29 | missing 30 | hypervisor/xen/config.h 31 | hypervisor/xen/config.h.in 32 | hypervisor/xen/stamp-h1 33 | config.guess 34 | config.sub 35 | 36 | # Architecture specific extensions/prefixes 37 | *.[568vq] 38 | [568vq].out 39 | 40 | *.cgo1.go 41 | *.cgo2.c 42 | _cgo_defun.c 43 | _cgo_gotypes.go 44 | _cgo_export.* 45 | 46 | _testmain.go 47 | 48 | *.exe 49 | *.test 50 | *.prof 51 | 52 | # intellij idea configure 53 | .idea 54 | /runv 55 | /runv-containerd 56 | *.out 57 | 58 | # ignore test_data 59 | test_data 60 | !test_data/Makefile 61 | /tests/go-integration/config.json 62 | /tests/recvtty/recvtty 63 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/circular.go: -------------------------------------------------------------------------------- 1 | package msgp 2 | 3 | type timer interface { 4 | StartTimer() 5 | StopTimer() 6 | } 7 | 8 | // EndlessReader is an io.Reader 9 | // that loops over the same data 10 | // endlessly. It is used for benchmarking. 11 | type EndlessReader struct { 12 | tb timer 13 | data []byte 14 | offset int 15 | } 16 | 17 | // NewEndlessReader returns a new endless reader 18 | func NewEndlessReader(b []byte, tb timer) *EndlessReader { 19 | return &EndlessReader{tb: tb, data: b, offset: 0} 20 | } 21 | 22 | // Read implements io.Reader. In practice, it 23 | // always returns (len(p), nil), although it 24 | // fills the supplied slice while the benchmark 25 | // timer is stopped. 26 | func (c *EndlessReader) Read(p []byte) (int, error) { 27 | c.tb.StopTimer() 28 | var n int 29 | l := len(p) 30 | m := len(c.data) 31 | for n < l { 32 | nn := copy(p[n:], c.data[c.offset:]) 33 | n += nn 34 | c.offset += nn 35 | c.offset %= m 36 | } 37 | c.tb.StartTimer() 38 | return n, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/collate/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package collate 6 | 7 | import "golang.org/x/text/internal/colltab" 8 | 9 | const blockSize = 64 10 | 11 | func getTable(t tableIndex) *colltab.Table { 12 | return &colltab.Table{ 13 | Index: colltab.Trie{ 14 | Index0: mainLookup[:][blockSize*t.lookupOffset:], 15 | Values0: mainValues[:][blockSize*t.valuesOffset:], 16 | Index: mainLookup[:], 17 | Values: mainValues[:], 18 | }, 19 | ExpandElem: mainExpandElem[:], 20 | ContractTries: colltab.ContractTrieSet(mainCTEntries[:]), 21 | ContractElem: mainContractElem[:], 22 | MaxContractLen: 18, 23 | VariableTop: varTop, 24 | } 25 | } 26 | 27 | // tableIndex holds information for constructing a table 28 | // for a certain locale based on the main table. 29 | type tableIndex struct { 30 | lookupOffset uint32 31 | valuesOffset uint32 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Extensions to the standard "os" package. 6 | package osext // import "github.com/kardianos/osext" 7 | 8 | import "path/filepath" 9 | 10 | var cx, ce = executableClean() 11 | 12 | func executableClean() (string, error) { 13 | p, err := executable() 14 | return filepath.Clean(p), err 15 | } 16 | 17 | // Executable returns an absolute path that can be used to 18 | // re-invoke the current program. 19 | // It may not be valid after the current program exits. 20 | func Executable() (string, error) { 21 | return cx, ce 22 | } 23 | 24 | // Returns same path as Executable, returns just the folder 25 | // path. Excludes the executable name and any trailing slash. 26 | func ExecutableFolder() (string, error) { 27 | p, err := Executable() 28 | if err != nil { 29 | return "", err 30 | } 31 | 32 | return filepath.Dir(p), nil 33 | } 34 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | srcdir=`dirname $0` 4 | test -z "$srcdir" && srcidr=. 5 | 6 | cd $srcdir 7 | 8 | die() 9 | { 10 | echo 11 | echo "$1" 12 | echo 13 | exit 1 14 | } 15 | 16 | test -f hypervisor/xen/libxl_wrapper.go || die "You must run this script in the top-level hyper directory." 17 | 18 | aclocal --version < /dev/null > /dev/null 2>&1 || die "You must have aclocal installed to generate the hyper." 19 | autoconf --version < /dev/null > /dev/null 2>&1 || die "You must have autoconf installed to generate the hyper." 20 | automake --version < /dev/null > /dev/null 2>&1 || die "You must have automake installed to generate the hyper." 21 | 22 | echo 23 | echo "Generating build-system with:" 24 | echo " aclocal: $(aclocal --version | head -1)" 25 | echo " autoconf: $(autoconf --version | head -1)" 26 | echo " automake: $(automake --version | head -1)" 27 | echo 28 | 29 | rm -rf autom4te.cache 30 | 31 | aclocal 32 | autoconf 33 | automake --add-missing 34 | 35 | echo 36 | echo "type '$srcdir/configure' and 'make' to compile hyper." 37 | echo 38 | -------------------------------------------------------------------------------- /lib/utils/buffer.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | // copied from moby 4 | 5 | import ( 6 | "errors" 7 | "io" 8 | ) 9 | 10 | var errBufferFull = errors.New("buffer is full") 11 | 12 | type fixedBuffer struct { 13 | buf []byte 14 | pos int 15 | lastRead int 16 | } 17 | 18 | func (b *fixedBuffer) Write(p []byte) (int, error) { 19 | n := copy(b.buf[b.pos:cap(b.buf)], p) 20 | b.pos += n 21 | 22 | if n < len(p) { 23 | if b.pos == cap(b.buf) { 24 | return n, errBufferFull 25 | } 26 | return n, io.ErrShortWrite 27 | } 28 | return n, nil 29 | } 30 | 31 | func (b *fixedBuffer) Read(p []byte) (int, error) { 32 | n := copy(p, b.buf[b.lastRead:b.pos]) 33 | b.lastRead += n 34 | return n, nil 35 | } 36 | 37 | func (b *fixedBuffer) Len() int { 38 | return b.pos - b.lastRead 39 | } 40 | 41 | func (b *fixedBuffer) Cap() int { 42 | return cap(b.buf) 43 | } 44 | 45 | func (b *fixedBuffer) Reset() { 46 | b.pos = 0 47 | b.lastRead = 0 48 | b.buf = b.buf[:0] 49 | } 50 | 51 | func (b *fixedBuffer) String() string { 52 | return string(b.buf[b.lastRead:b.pos]) 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/exitcode.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "fmt" 5 | "os/exec" 6 | "syscall" 7 | ) 8 | 9 | // GetExitCode returns the ExitStatus of the specified error if its type is 10 | // exec.ExitError, returns 0 and an error otherwise. 11 | func GetExitCode(err error) (int, error) { 12 | exitCode := 0 13 | if exiterr, ok := err.(*exec.ExitError); ok { 14 | if procExit, ok := exiterr.Sys().(syscall.WaitStatus); ok { 15 | return procExit.ExitStatus(), nil 16 | } 17 | } 18 | return exitCode, fmt.Errorf("failed to get exit code") 19 | } 20 | 21 | // ProcessExitCode process the specified error and returns the exit status code 22 | // if the error was of type exec.ExitError, returns nothing otherwise. 23 | func ProcessExitCode(err error) (exitCode int) { 24 | if err != nil { 25 | var exiterr error 26 | if exitCode, exiterr = GetExitCode(err); exiterr != nil { 27 | // TODO: Fix this so we check the error's text. 28 | // we've failed to retrieve exit code, so we set it to 127 29 | exitCode = 127 30 | } 31 | } 32 | return 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/philhofer/fwd/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2015, Philip Hofer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_pledge.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build openbsd 6 | // +build 386 amd64 arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | const ( 16 | SYS_PLEDGE = 108 17 | ) 18 | 19 | // Pledge implements the pledge syscall. For more information see pledge(2). 20 | func Pledge(promises string, paths []string) error { 21 | promisesPtr, err := syscall.BytePtrFromString(promises) 22 | if err != nil { 23 | return err 24 | } 25 | promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil) 26 | if paths != nil { 27 | var pathsPtr []*byte 28 | if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil { 29 | return err 30 | } 31 | pathsUnsafe = unsafe.Pointer(&pathsPtr[0]) 32 | } 33 | _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0) 34 | if e != 0 { 35 | return e 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/pty_linux.go: -------------------------------------------------------------------------------- 1 | package pty 2 | 3 | import ( 4 | "os" 5 | "strconv" 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func open() (pty, tty *os.File, err error) { 11 | p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0) 12 | if err != nil { 13 | return nil, nil, err 14 | } 15 | 16 | sname, err := ptsname(p) 17 | if err != nil { 18 | return nil, nil, err 19 | } 20 | 21 | err = unlockpt(p) 22 | if err != nil { 23 | return nil, nil, err 24 | } 25 | 26 | t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0) 27 | if err != nil { 28 | return nil, nil, err 29 | } 30 | return p, t, nil 31 | } 32 | 33 | func ptsname(f *os.File) (string, error) { 34 | var n _C_uint 35 | err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))) 36 | if err != nil { 37 | return "", err 38 | } 39 | return "/dev/pts/" + strconv.Itoa(int(n)), nil 40 | } 41 | 42 | func unlockpt(f *os.File) error { 43 | var u _C_int 44 | // use TIOCSPTLCK with a zero valued arg to clear the slave pty lock 45 | return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/xattrs_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "golang.org/x/sys/unix" 4 | 5 | // Returns a []byte slice if the xattr is set and nil otherwise 6 | // Requires path and its attribute as arguments 7 | func Lgetxattr(path string, attr string) ([]byte, error) { 8 | var sz int 9 | // Start with a 128 length byte array 10 | dest := make([]byte, 128) 11 | sz, errno := unix.Lgetxattr(path, attr, dest) 12 | 13 | switch { 14 | case errno == unix.ENODATA: 15 | return nil, errno 16 | case errno == unix.ENOTSUP: 17 | return nil, errno 18 | case errno == unix.ERANGE: 19 | // 128 byte array might just not be good enough, 20 | // A dummy buffer is used to get the real size 21 | // of the xattrs on disk 22 | sz, errno = unix.Lgetxattr(path, attr, []byte{}) 23 | if errno != nil { 24 | return nil, errno 25 | } 26 | dest = make([]byte, sz) 27 | sz, errno = unix.Lgetxattr(path, attr, dest) 28 | if errno != nil { 29 | return nil, errno 30 | } 31 | case errno != nil: 32 | return nil, errno 33 | } 34 | return dest[:sz], nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_procfs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8,linux !go1.8,netbsd !go1.8,solaris !go1.8,dragonfly 6 | 7 | package osext 8 | 9 | import ( 10 | "errors" 11 | "fmt" 12 | "os" 13 | "runtime" 14 | "strings" 15 | ) 16 | 17 | func executable() (string, error) { 18 | switch runtime.GOOS { 19 | case "linux": 20 | const deletedTag = " (deleted)" 21 | execpath, err := os.Readlink("/proc/self/exe") 22 | if err != nil { 23 | return execpath, err 24 | } 25 | execpath = strings.TrimSuffix(execpath, deletedTag) 26 | execpath = strings.TrimPrefix(execpath, deletedTag) 27 | return execpath, nil 28 | case "netbsd": 29 | return os.Readlink("/proc/curproc/exe") 30 | case "dragonfly": 31 | return os.Readlink("/proc/curproc/file") 32 | case "solaris": 33 | return os.Readlink(fmt.Sprintf("/proc/%d/path/a.out", os.Getpid())) 34 | } 35 | return "", errors.New("ExecPath not implemented for " + runtime.GOOS) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/vdemeester/shakers/bool.go: -------------------------------------------------------------------------------- 1 | package shakers 2 | 3 | import ( 4 | "github.com/go-check/check" 5 | ) 6 | 7 | // True checker verifies the obtained value is true 8 | // 9 | // c.Assert(myBool, True) 10 | // 11 | var True check.Checker = &boolChecker{ 12 | &check.CheckerInfo{ 13 | Name: "True", 14 | Params: []string{"obtained"}, 15 | }, 16 | true, 17 | } 18 | 19 | // False checker verifies the obtained value is false 20 | // 21 | // c.Assert(myBool, False) 22 | // 23 | var False check.Checker = &boolChecker{ 24 | &check.CheckerInfo{ 25 | Name: "False", 26 | Params: []string{"obtained"}, 27 | }, 28 | false, 29 | } 30 | 31 | type boolChecker struct { 32 | *check.CheckerInfo 33 | expected bool 34 | } 35 | 36 | func (checker *boolChecker) Check(params []interface{}, names []string) (bool, string) { 37 | return is(checker.expected, params[0]) 38 | } 39 | 40 | func is(expected bool, obtained interface{}) (bool, string) { 41 | obtainedBool, ok := obtained.(bool) 42 | if !ok { 43 | return false, "obtained value must be a bool." 44 | } 45 | return obtainedBool == expected, "" 46 | } 47 | -------------------------------------------------------------------------------- /agent/api/hyperstart/constants.go: -------------------------------------------------------------------------------- 1 | package json 2 | 3 | // when APIVERSION < 1000000, the version MUST be exactly matched on both sides 4 | const VERSION = 4244 5 | 6 | const ( 7 | INIT_VERSION = iota // 0 8 | INIT_STARTPOD 9 | INIT_GETPOD_DEPRECATED 10 | INIT_STOPPOD_DEPRECATED 11 | INIT_DESTROYPOD 12 | INIT_RESTARTCONTAINER_DEPRECATED // 5 13 | INIT_EXECCMD 14 | INIT_FINISHCMD_DEPRECATED 15 | INIT_READY 16 | INIT_ACK 17 | INIT_ERROR // 10 18 | INIT_WINSIZE 19 | INIT_PING 20 | INIT_FINISHPOD_DEPRECATED 21 | INIT_NEXT 22 | INIT_WRITEFILE // 15 23 | INIT_READFILE 24 | INIT_NEWCONTAINER 25 | INIT_KILLCONTAINER 26 | INIT_ONLINECPUMEM 27 | INIT_SETUPINTERFACE // 20 28 | INIT_SETUPROUTE 29 | INIT_REMOVECONTAINER 30 | INIT_PROCESSASYNCEVENT 31 | INIT_SIGNALPROCESS 32 | INIT_DELETEINTERFACE // 25 33 | ) 34 | 35 | // "hyperstart" is the special container ID for adding processes. 36 | const HYPERSTART_EXEC_CONTAINER = "hyperstart" 37 | 38 | const HYPER_VSOCK_CTL_PORT = 2718 39 | const HYPER_VSOCK_MSG_PORT = 2719 40 | 41 | const HYPER_USE_SERIAL = "hyper_use_serial" 42 | const HYPER_P9_USE_XEN = "hyper_p9_xen" 43 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | export GO15VENDOREXPERIMENT=1 2 | if WITH_XEN 3 | XEN_BUILD_TAG=with_xen 4 | else 5 | XEN_BUILD_TAG= 6 | endif 7 | 8 | if WITH_XEN490 9 | XEN490_BUILD_TAG=with_xen490 10 | else 11 | XEN490_BUILD_TAG= 12 | endif 13 | 14 | if WITH_LIBVIRT 15 | LIBVIRT_BUILD_TAG=with_libvirt 16 | else 17 | LIBVIRT_BUILD_TAG= 18 | endif 19 | 20 | COMMIT=`git describe --dirty --always --tags 2> /dev/null || true` 21 | GOLDFLAGS="-X main.gitCommit=${COMMIT} -X main.version=${VERSION}" 22 | HYPER_BULD_TAGS=$(XEN_BUILD_TAG) $(XEN490_BUILD_TAG) $(LIBVIRT_BUILD_TAG) 23 | 24 | all-local: build-runv 25 | clean-local: 26 | -rm -f runv 27 | install-exec-local: 28 | $(INSTALL_PROGRAM) runv $(bindir) 29 | 30 | build-runv: 31 | go build -tags "static_build $(HYPER_BULD_TAGS)" -ldflags ${GOLDFLAGS} -o runv ./cli/ 32 | go-integration: 33 | cd tests/go-integration/test_data && make 34 | cd tests/go-integration && go test -check.v -test.timeout=120m ${TESTFLAGS} . 35 | bats: 36 | go build -tags "static_build $(HYPER_BULD_TAGS)" -ldflags ${GOLDFLAGS} -o ./tests/recvtty/recvtty ./tests/recvtty/ 37 | bats tests/bats-integration/ 38 | test-integration: go-integration bats 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | /* 4 | #include 5 | #include 6 | #include 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | "reflect" 13 | "unsafe" 14 | ) 15 | 16 | // Parse /proc/self/mountinfo because comparing Dev and ino does not work from 17 | // bind mounts. 18 | func parseMountTable() ([]*Info, error) { 19 | var rawEntries *C.struct_statfs 20 | 21 | count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) 22 | if count == 0 { 23 | return nil, fmt.Errorf("Failed to call getmntinfo") 24 | } 25 | 26 | var entries []C.struct_statfs 27 | header := (*reflect.SliceHeader)(unsafe.Pointer(&entries)) 28 | header.Cap = count 29 | header.Len = count 30 | header.Data = uintptr(unsafe.Pointer(rawEntries)) 31 | 32 | var out []*Info 33 | for _, entry := range entries { 34 | var mountinfo Info 35 | mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) 36 | mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) 37 | mountinfo.Fstype = C.GoString(&entry.f_fstypename[0]) 38 | out = append(out, &mountinfo) 39 | } 40 | return out, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | 4 | language: go 5 | go_import_path: github.com/hyperhq/runv 6 | 7 | matrix: 8 | include: 9 | - go: 1.7 10 | 11 | before_install: 12 | - sudo apt-get update -qq 13 | - sudo apt-get install -y -qq autoconf automake pkg-config libdevmapper-dev libvirt-dev libvirt-bin wget libaio1 libpixman-1-0 jq 14 | - wget https://s3-us-west-1.amazonaws.com/hypercontainer-download/qemu-hyper/qemu-hyper_2.4.1-1_amd64.deb && sudo dpkg -i --force-all qemu-hyper_2.4.1-1_amd64.deb 15 | - git clone https://github.com/hyperhq/hyperstart.git ${GOPATH}/src/github.com/hyperhq/hyperstart 16 | 17 | # override the default `install`, otherwise default `install` will export ${TRAVIS_BUILD_DIR}/Godeps/_workspace as GOPATH 18 | # see https://docs.travis-ci.com/user/languages/go#Dependency-Management 19 | 20 | install: 21 | - cd ${TRAVIS_BUILD_DIR} 22 | - hack/verify-gofmt.sh 23 | - hack/validate-vet.sh 24 | - ./autogen.sh && ./configure && make && sudo GOPATH=${GOPATH} PATH=${PATH} GOROOT=${GOROOT} make install 25 | 26 | script: 27 | - cd ${TRAVIS_BUILD_DIR} && sudo GOPATH=${GOPATH} PATH=${PATH} GOROOT=${GOROOT} hack/test-cmd.sh 28 | -------------------------------------------------------------------------------- /vendor/github.com/kr/pty/License: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Keith Rarick 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, 8 | sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall 13 | be included in all copies or substantial portions of the 14 | Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 17 | KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 18 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 19 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 20 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 21 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 22 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /factory/multi/multi.go: -------------------------------------------------------------------------------- 1 | package multi 2 | 3 | import ( 4 | "sort" 5 | 6 | "github.com/hyperhq/runv/factory/base" 7 | "github.com/hyperhq/runv/factory/single" 8 | "github.com/hyperhq/runv/hypervisor" 9 | ) 10 | 11 | type Factory []base.Factory 12 | 13 | func (f Factory) GetVm(cpu, mem int) (*hypervisor.Vm, error) { 14 | for _, b := range f { 15 | config := b.Config() 16 | if config.CPU <= cpu && config.Memory <= mem { 17 | return single.New(b).GetVm(cpu, mem) 18 | } 19 | } 20 | boot := *f[0].Config() 21 | return single.Dummy(boot).GetVm(cpu, mem) 22 | } 23 | 24 | func (f Factory) CloseFactory() { 25 | for _, b := range f { 26 | b.CloseFactory() 27 | } 28 | } 29 | 30 | type sortingFactory []base.Factory 31 | 32 | func (f sortingFactory) Len() int { return len(f) } 33 | func (f sortingFactory) Swap(i, j int) { f[i], f[j] = f[j], f[i] } 34 | func (f sortingFactory) Less(i, j int) bool { 35 | ci, cj := f[i].Config(), f[j].Config() 36 | return ci.CPU < cj.CPU || (ci.CPU == cj.CPU && ci.Memory < cj.Memory) 37 | } 38 | 39 | func New(bases []base.Factory) Factory { 40 | sort.Sort(sort.Reverse(sortingFactory(bases))) 41 | return Factory(bases) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Philip Hofer 2 | Portions Copyright (c) 2009 The Go Authors (license at http://golang.org) where indicated 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/mohae/deepcopy/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Joel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/rgbkrk/libvirt-go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2013 Alex Zorin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/protinfo.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // Protinfo represents bridge flags from netlink. 8 | type Protinfo struct { 9 | Hairpin bool 10 | Guard bool 11 | FastLeave bool 12 | RootBlock bool 13 | Learning bool 14 | Flood bool 15 | } 16 | 17 | // String returns a list of enabled flags 18 | func (prot *Protinfo) String() string { 19 | var boolStrings []string 20 | if prot.Hairpin { 21 | boolStrings = append(boolStrings, "Hairpin") 22 | } 23 | if prot.Guard { 24 | boolStrings = append(boolStrings, "Guard") 25 | } 26 | if prot.FastLeave { 27 | boolStrings = append(boolStrings, "FastLeave") 28 | } 29 | if prot.RootBlock { 30 | boolStrings = append(boolStrings, "RootBlock") 31 | } 32 | if prot.Learning { 33 | boolStrings = append(boolStrings, "Learning") 34 | } 35 | if prot.Flood { 36 | boolStrings = append(boolStrings, "Flood") 37 | } 38 | return strings.Join(boolStrings, " ") 39 | } 40 | 41 | func boolToByte(x bool) []byte { 42 | if x { 43 | return []byte{1} 44 | } 45 | return []byte{0} 46 | } 47 | 48 | func byteToBool(x byte) bool { 49 | return uint8(x) != 0 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jeremy Saenz & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/addr_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | type IfAddrmsg struct { 9 | syscall.IfAddrmsg 10 | } 11 | 12 | func NewIfAddrmsg(family int) *IfAddrmsg { 13 | return &IfAddrmsg{ 14 | IfAddrmsg: syscall.IfAddrmsg{ 15 | Family: uint8(family), 16 | }, 17 | } 18 | } 19 | 20 | // struct ifaddrmsg { 21 | // __u8 ifa_family; 22 | // __u8 ifa_prefixlen; /* The prefix length */ 23 | // __u8 ifa_flags; /* Flags */ 24 | // __u8 ifa_scope; /* Address scope */ 25 | // __u32 ifa_index; /* Link index */ 26 | // }; 27 | 28 | // type IfAddrmsg struct { 29 | // Family uint8 30 | // Prefixlen uint8 31 | // Flags uint8 32 | // Scope uint8 33 | // Index uint32 34 | // } 35 | // SizeofIfAddrmsg = 0x8 36 | 37 | func DeserializeIfAddrmsg(b []byte) *IfAddrmsg { 38 | return (*IfAddrmsg)(unsafe.Pointer(&b[0:syscall.SizeofIfAddrmsg][0])) 39 | } 40 | 41 | func (msg *IfAddrmsg) Serialize() []byte { 42 | return (*(*[syscall.SizeofIfAddrmsg]byte)(unsafe.Pointer(msg)))[:] 43 | } 44 | 45 | func (msg *IfAddrmsg) Len() int { 46 | return syscall.SizeofIfAddrmsg 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | // Package internal contains gRPC-internal code for testing, to avoid polluting 19 | // the godoc of the top-level grpc package. 20 | package internal 21 | 22 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. 23 | // It must be called before Serve and requires TLS credentials. 24 | // 25 | // The provided grpcServer must be of type *grpc.Server. It is untyped 26 | // for circular dependency reasons. 27 | var TestingUseHandlerImpl func(grpcServer interface{}) 28 | -------------------------------------------------------------------------------- /vendor/github.com/glycerine/go-unsnap-stream/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 the go-unsnap-stream authors. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 12 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 13 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 14 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 15 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 16 | 17 | Permission is explicitly granted to relicense this material under new terms of 18 | your choice when integrating this library with another library or project. 19 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | // NOTE: 11 | // all of the definition in this file 12 | // should be repeated in appengine.go, 13 | // but without using unsafe 14 | 15 | const ( 16 | // spec says int and uint are always 17 | // the same size, but that int/uint 18 | // size may not be machine word size 19 | smallint = unsafe.Sizeof(int(0)) == 4 20 | ) 21 | 22 | // UnsafeString returns the byte slice as a volatile string 23 | // THIS SHOULD ONLY BE USED BY THE CODE GENERATOR. 24 | // THIS IS EVIL CODE. 25 | // YOU HAVE BEEN WARNED. 26 | func UnsafeString(b []byte) string { 27 | return *(*string)(unsafe.Pointer(&reflect.StringHeader{Data: uintptr(unsafe.Pointer(&b[0])), Len: len(b)})) 28 | } 29 | 30 | // UnsafeBytes returns the string as a byte slice 31 | // THIS SHOULD ONLY BE USED BY THE CODE GENERATOR. 32 | // THIS IS EVIL CODE. 33 | // YOU HAVE BEEN WARNED. 34 | func UnsafeBytes(s string) []byte { 35 | return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 36 | Len: len(s), 37 | Cap: len(s), 38 | Data: (*(*reflect.StringHeader)(unsafe.Pointer(&s))).Data, 39 | })) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/flags_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd,cgo 2 | 3 | package mount 4 | 5 | /* 6 | #include 7 | */ 8 | import "C" 9 | 10 | const ( 11 | // RDONLY will mount the filesystem as read-only. 12 | RDONLY = C.MNT_RDONLY 13 | 14 | // NOSUID will not allow set-user-identifier or set-group-identifier bits to 15 | // take effect. 16 | NOSUID = C.MNT_NOSUID 17 | 18 | // NOEXEC will not allow execution of any binaries on the mounted file system. 19 | NOEXEC = C.MNT_NOEXEC 20 | 21 | // SYNCHRONOUS will allow any I/O to the file system to be done synchronously. 22 | SYNCHRONOUS = C.MNT_SYNCHRONOUS 23 | 24 | // NOATIME will not update the file access time when reading from a file. 25 | NOATIME = C.MNT_NOATIME 26 | ) 27 | 28 | // These flags are unsupported. 29 | const ( 30 | BIND = 0 31 | DIRSYNC = 0 32 | MANDLOCK = 0 33 | NODEV = 0 34 | NODIRATIME = 0 35 | UNBINDABLE = 0 36 | RUNBINDABLE = 0 37 | PRIVATE = 0 38 | RPRIVATE = 0 39 | SHARED = 0 40 | RSHARED = 0 41 | SLAVE = 0 42 | RSLAVE = 0 43 | RBIND = 0 44 | RELATIVE = 0 45 | RELATIME = 0 46 | REMOUNT = 0 47 | STRICTATIME = 0 48 | ) 49 | -------------------------------------------------------------------------------- /hypervisor/network/network_test.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package network 4 | 5 | import ( 6 | "testing" 7 | ) 8 | 9 | func TestInitNetwork(t *testing.T) { 10 | if err := InitNetwork("hyper-test", "192.168.138.1/24", false); err != nil { 11 | t.Error("create hyper-test bridge failed") 12 | } 13 | 14 | if err := DeleteBridge("hyper-test"); err != nil { 15 | t.Error("delete hyper-test bridge failed") 16 | } 17 | 18 | t.Log("bridge check finished.") 19 | } 20 | 21 | func TestAllocate(t *testing.T) { 22 | if err := InitNetwork("hyper-test", "192.168.138.1/24", false); err != nil { 23 | t.Error("create hyper-test bridge failed") 24 | } 25 | 26 | if setting, err := AllocateAddr("192.168.138.2"); err != nil { 27 | t.Error("allocate tap device and ip failed") 28 | } else { 29 | t.Logf("alocate tap device finished. bridge %s, device %s, ip %s, gateway %s", 30 | setting.Bridge, setting.Device, setting.IPAddress, setting.Gateway) 31 | if err := ReleaseAddr("192.168.138.2"); err != nil { 32 | t.Error("release ip failed") 33 | } 34 | } 35 | 36 | if err := DeleteBridge("hyper-test"); err != nil { 37 | t.Error("delete hyper-test bridge failed") 38 | } 39 | 40 | t.Log("allocate finished") 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | 22 | 23 | [[constraint]] 24 | branch = "v1" 25 | name = "github.com/go-check/check" 26 | 27 | [[constraint]] 28 | branch = "master" 29 | name = "github.com/golang/glog" 30 | 31 | [[constraint]] 32 | name = "github.com/kata-containers/agent" 33 | revision = "827351a55b2886aa4ca4e663fab8e27a3bbb3a0b" 34 | 35 | [[constraint]] 36 | name = "github.com/opencontainers/runtime-spec" 37 | version = "1.0.0" 38 | 39 | [[constraint]] 40 | branch = "master" 41 | name = "github.com/rgbkrk/libvirt-go" 42 | 43 | [prune] 44 | non-go = true 45 | go-tests = true 46 | unused-packages = true 47 | -------------------------------------------------------------------------------- /cli/filesystem_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package main 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | 9 | "github.com/hyperhq/runv/lib/utils" 10 | specs "github.com/opencontainers/runtime-spec/specs-go" 11 | ) 12 | 13 | func platformSetupFs(root string, spec *specs.Spec) (err error) { 14 | if spec.Linux == nil { 15 | return nil 16 | } 17 | 18 | for _, path := range spec.Linux.MaskedPaths { 19 | if err = maskPath(root + "/" + path); err != nil { 20 | return err 21 | } 22 | } 23 | 24 | for _, path := range spec.Linux.ReadonlyPaths { 25 | if err = readonlyPath(root + "/" + path); err != nil { 26 | return err 27 | } 28 | } 29 | 30 | return nil 31 | } 32 | 33 | // For files, bind mount them to /dev/null 34 | // For dirs, mount readonly tmpfs over them 35 | // TODO: move this to hyperstart 36 | func maskPath(path string) error { 37 | if err := syscall.Mount("/dev/null", path, "", syscall.MS_BIND, ""); err != nil && !os.IsNotExist(err) { 38 | if err == syscall.ENOTDIR { 39 | return syscall.Mount("tmpfs", path, "tmpfs", syscall.MS_RDONLY, "") 40 | } 41 | return err 42 | } 43 | return nil 44 | } 45 | 46 | func readonlyPath(path string) error { 47 | return utils.SetReadonly(path) 48 | } 49 | -------------------------------------------------------------------------------- /lib/term/tc_linux_cgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,cgo 2 | 3 | package term 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // #include 11 | import "C" 12 | 13 | type Termios syscall.Termios 14 | 15 | // MakeRaw put the terminal connected to the given file descriptor into raw 16 | // mode and returns the previous state of the terminal so that it can be 17 | // restored. 18 | func MakeRaw(fd uintptr) (*State, error) { 19 | var oldState State 20 | if err := tcget(fd, &oldState.termios); err != 0 { 21 | return nil, err 22 | } 23 | 24 | newState := oldState.termios 25 | 26 | C.cfmakeraw((*C.struct_termios)(unsafe.Pointer(&newState))) 27 | if err := tcset(fd, &newState); err != 0 { 28 | return nil, err 29 | } 30 | return &oldState, nil 31 | } 32 | 33 | func tcget(fd uintptr, p *Termios) syscall.Errno { 34 | ret, err := C.tcgetattr(C.int(fd), (*C.struct_termios)(unsafe.Pointer(p))) 35 | if ret != 0 { 36 | return err.(syscall.Errno) 37 | } 38 | return 0 39 | } 40 | 41 | func tcset(fd uintptr, p *Termios) syscall.Errno { 42 | ret, err := C.tcsetattr(C.int(fd), C.TCSANOW, (*C.struct_termios)(unsafe.Pointer(p))) 43 | if ret != 0 { 44 | return err.(syscall.Errno) 45 | } 46 | return 0 47 | } 48 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/credentials/credentials_util_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "crypto/tls" 25 | ) 26 | 27 | // cloneTLSConfig returns a shallow clone of the exported 28 | // fields of cfg, ignoring the unexported sync.Once, which 29 | // contains a mutex and must not be copied. 30 | // 31 | // If cfg is nil, a new zero tls.Config is returned. 32 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 33 | if cfg == nil { 34 | return &tls.Config{} 35 | } 36 | 37 | return cfg.Clone() 38 | } 39 | -------------------------------------------------------------------------------- /cli/nsenter/nsexec.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | /* Get all of the CLONE_NEW* flags. */ 11 | #include "namespace.h" 12 | 13 | #define bail(fmt, ...) \ 14 | do { \ 15 | int ret = __COUNTER__ + 1; \ 16 | fprintf(stderr, "nsenter: " fmt ": %m\n", ##__VA_ARGS__); \ 17 | exit(ret); \ 18 | } while(0) 19 | 20 | static int get_RUNVNETNSPID(void) 21 | { 22 | int pid; 23 | char *nspidStr, *endptr; 24 | 25 | nspidStr = getenv("_RUNVNETNSPID"); 26 | if (nspidStr== NULL || *nspidStr == '\0') 27 | return -1; 28 | 29 | pid = strtol(nspidStr, &endptr, 10); 30 | if (*endptr != '\0') 31 | bail("unable to parse _RUNVNETNSPID"); 32 | 33 | return pid; 34 | } 35 | 36 | void nsexec(void) 37 | { 38 | int nsPid, nsFd; 39 | char *path; 40 | 41 | nsPid = get_RUNVNETNSPID(); 42 | if (nsPid <= 0) { 43 | return; 44 | } 45 | 46 | path = malloc(sizeof(char)*64); 47 | sprintf(path, "/proc/%d/ns/net", nsPid); 48 | nsFd = open(path, O_RDONLY); 49 | setns(nsFd, CLONE_NEWNET); 50 | 51 | free(path); 52 | close(nsFd); 53 | return; 54 | } 55 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } 35 | ) 36 | -------------------------------------------------------------------------------- /hypervisor/network/network.go: -------------------------------------------------------------------------------- 1 | package network 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | 7 | "github.com/hyperhq/runv/hypervisor/network/ipallocator" 8 | ) 9 | 10 | type Settings struct { 11 | Mac string 12 | IPAddress string 13 | Gateway string 14 | Bridge string 15 | Device string 16 | Mtu uint64 17 | Automatic bool 18 | } 19 | 20 | const ( 21 | DefaultBridgeIface = "hyper0" 22 | DefaultBridgeIP = "192.168.123.0/24" 23 | ) 24 | 25 | var ( 26 | IpAllocator = ipallocator.New() 27 | BridgeIPv4Net *net.IPNet 28 | BridgeIface string 29 | BridgeIP string 30 | ) 31 | 32 | func NicName(id string, index int) string { 33 | // make sure nic name has less than 15 chars 34 | // hold 3 chars for index. 35 | // TODO: index could be larger than 3 chars, make it more robust 36 | if len(id) > 12 { 37 | id = string([]rune(id)[:12]) 38 | } 39 | 40 | return fmt.Sprintf("%s%d", id, index) 41 | } 42 | 43 | func IpParser(ipstr string) (net.IP, net.IPMask, error) { 44 | ip, ipnet, err := net.ParseCIDR(ipstr) 45 | if err == nil { 46 | return ip, ipnet.Mask, nil 47 | } 48 | 49 | ip = net.ParseIP(ipstr) 50 | if ip != nil { 51 | return ip, ip.DefaultMask(), nil 52 | } 53 | 54 | return nil, nil, err 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // StatT type contains status of a file. It contains metadata 10 | // like permission, owner, group, size, etc about a file. 11 | type StatT struct { 12 | mode uint32 13 | uid uint32 14 | gid uint32 15 | rdev uint64 16 | size int64 17 | mtim syscall.Timespec 18 | } 19 | 20 | // Mode returns file's permission mode. 21 | func (s StatT) Mode() uint32 { 22 | return s.mode 23 | } 24 | 25 | // UID returns file's user id of owner. 26 | func (s StatT) UID() uint32 { 27 | return s.uid 28 | } 29 | 30 | // GID returns file's group id of owner. 31 | func (s StatT) GID() uint32 { 32 | return s.gid 33 | } 34 | 35 | // Rdev returns file's device ID (if it's special file). 36 | func (s StatT) Rdev() uint64 { 37 | return s.rdev 38 | } 39 | 40 | // Size returns file's size. 41 | func (s StatT) Size() int64 { 42 | return s.size 43 | } 44 | 45 | // Mtim returns file's last modification time. 46 | func (s StatT) Mtim() syscall.Timespec { 47 | return s.mtim 48 | } 49 | 50 | // GetLastModification returns file's last modification time. 51 | func (s StatT) GetLastModification() syscall.Timespec { 52 | return s.Mtim() 53 | } 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/duration.go: -------------------------------------------------------------------------------- 1 | // Package units provides helper function to parse and print size and time units 2 | // in human-readable format. 3 | package units 4 | 5 | import ( 6 | "fmt" 7 | "time" 8 | ) 9 | 10 | // HumanDuration returns a human-readable approximation of a duration 11 | // (eg. "About a minute", "4 hours ago", etc.). 12 | func HumanDuration(d time.Duration) string { 13 | if seconds := int(d.Seconds()); seconds < 1 { 14 | return "Less than a second" 15 | } else if seconds == 1 { 16 | return "1 second" 17 | } else if seconds < 60 { 18 | return fmt.Sprintf("%d seconds", seconds) 19 | } else if minutes := int(d.Minutes()); minutes == 1 { 20 | return "About a minute" 21 | } else if minutes < 46 { 22 | return fmt.Sprintf("%d minutes", minutes) 23 | } else if hours := int(d.Hours() + 0.5); hours == 1 { 24 | return "About an hour" 25 | } else if hours < 48 { 26 | return fmt.Sprintf("%d hours", hours) 27 | } else if hours < 24*7*2 { 28 | return fmt.Sprintf("%d days", hours/24) 29 | } else if hours < 24*30*2 { 30 | return fmt.Sprintf("%d weeks", hours/24/7) 31 | } else if hours < 24*365*2 { 32 | return fmt.Sprintf("%d months", hours/24/30) 33 | } 34 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | // Info reveals information about a particular mounted filesystem. This 4 | // struct is populated from the content in the /proc//mountinfo file. 5 | type Info struct { 6 | // ID is a unique identifier of the mount (may be reused after umount). 7 | ID int 8 | 9 | // Parent indicates the ID of the mount parent (or of self for the top of the 10 | // mount tree). 11 | Parent int 12 | 13 | // Major indicates one half of the device ID which identifies the device class. 14 | Major int 15 | 16 | // Minor indicates one half of the device ID which identifies a specific 17 | // instance of device. 18 | Minor int 19 | 20 | // Root of the mount within the filesystem. 21 | Root string 22 | 23 | // Mountpoint indicates the mount point relative to the process's root. 24 | Mountpoint string 25 | 26 | // Opts represents mount-specific options. 27 | Opts string 28 | 29 | // Optional represents optional fields. 30 | Optional string 31 | 32 | // Fstype indicates the type of filesystem, such as EXT3. 33 | Fstype string 34 | 35 | // Source indicates filesystem specific information or "none". 36 | Source string 37 | 38 | // VfsOpts represents per super block options. 39 | VfsOpts string 40 | } 41 | -------------------------------------------------------------------------------- /tests/bats-integration/delete.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | function setup() { 6 | teardown_busybox 7 | setup_busybox 8 | } 9 | 10 | function teardown() { 11 | teardown_busybox 12 | } 13 | 14 | @test "runv delete" { 15 | # run busybox detached 16 | runv run -d --console-socket $CONSOLE_SOCKET test_busybox 17 | [ "$status" -eq 0 ] 18 | 19 | # check state 20 | testcontainer test_busybox running 21 | 22 | runv kill test_busybox KILL 23 | [ "$status" -eq 0 ] 24 | # wait for busybox to be in the destroyed state 25 | retry 10 1 eval "__runv state test_busybox | grep -q 'stopped'" 26 | 27 | # delete test_busybox 28 | runv delete test_busybox 29 | [ "$status" -eq 0 ] 30 | 31 | runv state test_busybox 32 | [ "$status" -ne 0 ] 33 | } 34 | 35 | @test "runv delete --force" { 36 | # run busybox detached 37 | runv run -d --console-socket $CONSOLE_SOCKET test_busybox 38 | [ "$status" -eq 0 ] 39 | 40 | # check state 41 | testcontainer test_busybox running 42 | 43 | # force delete test_busybox 44 | runv delete --force test_busybox 45 | 46 | runv state test_busybox 47 | [ "$status" -ne 0 ] 48 | } 49 | 50 | @test "runv delete --force ignore not exist" { 51 | runv delete --force notexists 52 | [ "$status" -eq 0 ] 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/willf/bitset/popcnt.go: -------------------------------------------------------------------------------- 1 | package bitset 2 | 3 | // bit population count, take from 4 | // https://code.google.com/p/go/issues/detail?id=4988#c11 5 | // credit: https://code.google.com/u/arnehormann/ 6 | func popcount(x uint64) (n uint64) { 7 | x -= (x >> 1) & 0x5555555555555555 8 | x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 9 | x += x >> 4 10 | x &= 0x0f0f0f0f0f0f0f0f 11 | x *= 0x0101010101010101 12 | return x >> 56 13 | } 14 | 15 | func popcntSliceGo(s []uint64) uint64 { 16 | cnt := uint64(0) 17 | for _, x := range s { 18 | cnt += popcount(x) 19 | } 20 | return cnt 21 | } 22 | 23 | func popcntMaskSliceGo(s, m []uint64) uint64 { 24 | cnt := uint64(0) 25 | for i := range s { 26 | cnt += popcount(s[i] &^ m[i]) 27 | } 28 | return cnt 29 | } 30 | 31 | func popcntAndSliceGo(s, m []uint64) uint64 { 32 | cnt := uint64(0) 33 | for i := range s { 34 | cnt += popcount(s[i] & m[i]) 35 | } 36 | return cnt 37 | } 38 | 39 | func popcntOrSliceGo(s, m []uint64) uint64 { 40 | cnt := uint64(0) 41 | for i := range s { 42 | cnt += popcount(s[i] | m[i]) 43 | } 44 | return cnt 45 | } 46 | 47 | func popcntXorSliceGo(s, m []uint64) uint64 { 48 | cnt := uint64(0) 49 | for i := range s { 50 | cnt += popcount(s[i] ^ m[i]) 51 | } 52 | return cnt 53 | } 54 | --------------------------------------------------------------------------------