mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-11-04 09:25:58 +00:00 
			
		
		
		
	vendor: Update hyperkit to latest version
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
This commit is contained in:
		@@ -9,7 +9,7 @@ github.com/docker/infrakit cb420e3e50ea60afe58538b1d3cab1cb14059433
 | 
				
			|||||||
github.com/golang/protobuf c9c7427a2a70d2eb3bafa0ab2dc163e45f143317
 | 
					github.com/golang/protobuf c9c7427a2a70d2eb3bafa0ab2dc163e45f143317
 | 
				
			||||||
github.com/googleapis/gax-go 8c5154c0fe5bf18cf649634d4c6df50897a32751
 | 
					github.com/googleapis/gax-go 8c5154c0fe5bf18cf649634d4c6df50897a32751
 | 
				
			||||||
github.com/mitchellh/go-ps 4fdf99ab29366514c69ccccddab5dc58b8d84062
 | 
					github.com/mitchellh/go-ps 4fdf99ab29366514c69ccccddab5dc58b8d84062
 | 
				
			||||||
github.com/moby/hyperkit 9b5f5fd848f0f5aedccb67a5a8cfa6787b8654f9
 | 
					github.com/moby/hyperkit fa78d9472a7d98e393233fd61ad5e95adc8c6912
 | 
				
			||||||
github.com/opencontainers/runtime-spec d094a5c9c1997ab086197b57e9378fabed394d92
 | 
					github.com/opencontainers/runtime-spec d094a5c9c1997ab086197b57e9378fabed394d92
 | 
				
			||||||
github.com/pkg/errors ff09b135c25aae272398c51a07235b90a75aa4f0
 | 
					github.com/pkg/errors ff09b135c25aae272398c51a07235b90a75aa4f0
 | 
				
			||||||
github.com/packethost/packngo 91d54000aa56874149d348a884ba083c41d38091
 | 
					github.com/packethost/packngo 91d54000aa56874149d348a884ba083c41d38091
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								vendor/github.com/moby/hyperkit/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/moby/hyperkit/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -38,7 +38,7 @@ via `brew` and using `opam` to install the appropriate libraries:
 | 
				
			|||||||
    $ brew install opam libev
 | 
					    $ brew install opam libev
 | 
				
			||||||
    $ opam init
 | 
					    $ opam init
 | 
				
			||||||
    $ eval `opam config env`
 | 
					    $ eval `opam config env`
 | 
				
			||||||
    $ opam install uri qcow.0.8.1 mirage-block-unix.2.6.0 conf-libev logs fmt mirage-unix
 | 
					    $ opam install uri qcow.0.9.5 mirage-block-unix.2.7.0 conf-libev logs fmt mirage-unix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Notes:
 | 
					Notes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										28
									
								
								vendor/github.com/moby/hyperkit/go/hyperkit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								vendor/github.com/moby/hyperkit/go/hyperkit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -51,6 +51,8 @@ const (
 | 
				
			|||||||
	defaultCPUs   = 1
 | 
						defaultCPUs   = 1
 | 
				
			||||||
	defaultMemory = 1024 // 1G
 | 
						defaultMemory = 1024 // 1G
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						defaultVSockGuestCID = 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	jsonFile = "hyperkit.json"
 | 
						jsonFile = "hyperkit.json"
 | 
				
			||||||
	pidFile  = "hyperkit.pid"
 | 
						pidFile  = "hyperkit.pid"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -79,6 +81,10 @@ type HyperKit struct {
 | 
				
			|||||||
	ISOImage string `json:"iso"`
 | 
						ISOImage string `json:"iso"`
 | 
				
			||||||
	// VSock enables the virtio-socket device and exposes it on the host
 | 
						// VSock enables the virtio-socket device and exposes it on the host
 | 
				
			||||||
	VSock bool `json:"vsock"`
 | 
						VSock bool `json:"vsock"`
 | 
				
			||||||
 | 
						// VSockPorts is a list of guest VSock ports that should be exposed as sockets on the host
 | 
				
			||||||
 | 
						VSockPorts []int `json:"vsock_ports"`
 | 
				
			||||||
 | 
						// VSock guest CID
 | 
				
			||||||
 | 
						VSockGuestCID int `json:"vsock_guest_cid"`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Kernel is the path to the kernel image to boot
 | 
						// Kernel is the path to the kernel image to boot
 | 
				
			||||||
	Kernel string `json:"kernel"`
 | 
						Kernel string `json:"kernel"`
 | 
				
			||||||
@@ -133,6 +139,8 @@ func New(hyperkit, vpnkitsock, statedir string) (*HyperKit, error) {
 | 
				
			|||||||
	h.CPUs = defaultCPUs
 | 
						h.CPUs = defaultCPUs
 | 
				
			||||||
	h.Memory = defaultMemory
 | 
						h.Memory = defaultMemory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						h.VSockGuestCID = defaultVSockGuestCID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	h.Console = ConsoleStdio
 | 
						h.Console = ConsoleStdio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return &h, nil
 | 
						return &h, nil
 | 
				
			||||||
@@ -203,6 +211,9 @@ func (h *HyperKit) execute(cmdline string) error {
 | 
				
			|||||||
	if h.VSock && h.StateDir == "" {
 | 
						if h.VSock && h.StateDir == "" {
 | 
				
			||||||
		return fmt.Errorf("If virtio-sockets are enabled, StateDir must be specified")
 | 
							return fmt.Errorf("If virtio-sockets are enabled, StateDir must be specified")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if !h.VSock && len(h.VSockPorts) > 0 {
 | 
				
			||||||
 | 
							return fmt.Errorf("To forward vsock ports vsock must be enabled")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if _, err = os.Stat(h.Kernel); os.IsNotExist(err) {
 | 
						if _, err = os.Stat(h.Kernel); os.IsNotExist(err) {
 | 
				
			||||||
		return fmt.Errorf("Kernel %s does not exist", h.Kernel)
 | 
							return fmt.Errorf("Kernel %s does not exist", h.Kernel)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -335,6 +346,17 @@ func CreateDiskImage(location string, sizeMB int) error {
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func intArrayToString(i []int, sep string) string {
 | 
				
			||||||
 | 
						if len(i) == 0 {
 | 
				
			||||||
 | 
							return ""
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						s := make([]string, len(i))
 | 
				
			||||||
 | 
						for idx := range i {
 | 
				
			||||||
 | 
							s[idx] = strconv.Itoa(i[idx])
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return strings.Join(s, sep)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (h *HyperKit) buildArgs(cmdline string) {
 | 
					func (h *HyperKit) buildArgs(cmdline string) {
 | 
				
			||||||
	a := []string{"-A", "-u"}
 | 
						a := []string{"-A", "-u"}
 | 
				
			||||||
	if h.StateDir != "" {
 | 
						if h.StateDir != "" {
 | 
				
			||||||
@@ -359,7 +381,11 @@ func (h *HyperKit) buildArgs(cmdline string) {
 | 
				
			|||||||
		a = append(a, "-s", fmt.Sprintf("2:0,virtio-blk,%s", h.DiskImage))
 | 
							a = append(a, "-s", fmt.Sprintf("2:0,virtio-blk,%s", h.DiskImage))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if h.VSock {
 | 
						if h.VSock {
 | 
				
			||||||
		a = append(a, "-s", fmt.Sprintf("3,virtio-sock,guest_cid=3,path=%s", h.StateDir))
 | 
							l := fmt.Sprintf("3,virtio-sock,guest_cid=%d,path=%s", h.VSockGuestCID, h.StateDir)
 | 
				
			||||||
 | 
							if len(h.VSockPorts) > 0 {
 | 
				
			||||||
 | 
								l = fmt.Sprintf("%s,guest_forwards=%s", l, intArrayToString(h.VSockPorts, ";"))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							a = append(a, "-s", l)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if h.ISOImage != "" {
 | 
						if h.ISOImage != "" {
 | 
				
			||||||
		a = append(a, "-s", fmt.Sprintf("4,ahci-cd,%s", h.ISOImage))
 | 
							a = append(a, "-s", fmt.Sprintf("4,ahci-cd,%s", h.ISOImage))
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/bootrom.h
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/bootrom.h
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -3,6 +3,6 @@
 | 
				
			|||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
#include <stdbool.h>
 | 
					#include <stdbool.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void bootrom_init(const char *bootrom_path);
 | 
					int bootrom_init(const char *bootrom_path);
 | 
				
			||||||
uint64_t bootrom_load(void);
 | 
					uint64_t bootrom_load(void);
 | 
				
			||||||
bool bootrom_contains_gpa(uint64_t gpa);
 | 
					bool bootrom_contains_gpa(uint64_t gpa);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/fbsd.h
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/fbsd.h
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -97,6 +97,6 @@ struct loader_callbacks {
 | 
				
			|||||||
	const char * (*getenv)(void *arg, int num);
 | 
						const char * (*getenv)(void *arg, int num);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void fbsd_init(char *userboot_path, char *bootvolume_path, char *kernelenv,
 | 
					int fbsd_init(char *userboot_path, char *bootvolume_path, char *kernelenv,
 | 
				
			||||||
	char *cons);
 | 
						char *cons);
 | 
				
			||||||
uint64_t fbsd_load(void);
 | 
					uint64_t fbsd_load(void);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/kexec.h
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/kexec.h
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -82,5 +82,5 @@ struct zero_page {
 | 
				
			|||||||
	uint8_t _7[276];
 | 
						uint8_t _7[276];
 | 
				
			||||||
} __attribute__((packed));
 | 
					} __attribute__((packed));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void kexec_init(char *kernel_path, char *initrd_path, char *cmdline);
 | 
					int kexec_init(char *kernel_path, char *initrd_path, char *cmdline);
 | 
				
			||||||
uint64_t kexec(void);
 | 
					uint64_t kexec(void);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/multiboot.h
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/moby/hyperkit/src/include/xhyve/firmware/multiboot.h
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int multiboot_init(char *kernel_path, char *module_spec, char *cmdline);
 | 
				
			||||||
 | 
					uint64_t multiboot(void);
 | 
				
			||||||
							
								
								
									
										5
									
								
								vendor/github.com/moby/hyperkit/src/lib/pci_virtio_net_vpnkit.c
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/github.com/moby/hyperkit/src/lib/pci_virtio_net_vpnkit.c
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -317,11 +317,6 @@ static int vpnkit_connect(int fd, const char uuid[36], struct vif_info *vif)
 | 
				
			|||||||
			init_reply.magic[4]);
 | 
								init_reply.magic[4]);
 | 
				
			||||||
		return -1;
 | 
							return -1;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (init_reply.version != 1) {
 | 
					 | 
				
			||||||
		fprintf(stderr, "virtio-net-vpnkit: bad init version %d\n",
 | 
					 | 
				
			||||||
			init_reply.version);
 | 
					 | 
				
			||||||
		return -1;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fprintf(stderr, "virtio-net-vpnkit: magic=%c%c%c%c%c version=%d commit=%*s\n",
 | 
						fprintf(stderr, "virtio-net-vpnkit: magic=%c%c%c%c%c version=%d commit=%*s\n",
 | 
				
			||||||
		init_reply.magic[0], init_reply.magic[1],
 | 
							init_reply.magic[0], init_reply.magic[1],
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user