mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 23:51:23 +00:00 
			
		
		
		
	vendor: Update hyperkit to latest version
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
This commit is contained in:
		
							
								
								
									
										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 | ||||
|     $ opam init | ||||
|     $ 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: | ||||
|  | ||||
|   | ||||
							
								
								
									
										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 | ||||
| 	defaultMemory = 1024 // 1G | ||||
|  | ||||
| 	defaultVSockGuestCID = 3 | ||||
|  | ||||
| 	jsonFile = "hyperkit.json" | ||||
| 	pidFile  = "hyperkit.pid" | ||||
| ) | ||||
| @@ -79,6 +81,10 @@ type HyperKit struct { | ||||
| 	ISOImage string `json:"iso"` | ||||
| 	// VSock enables the virtio-socket device and exposes it on the host | ||||
| 	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 string `json:"kernel"` | ||||
| @@ -133,6 +139,8 @@ func New(hyperkit, vpnkitsock, statedir string) (*HyperKit, error) { | ||||
| 	h.CPUs = defaultCPUs | ||||
| 	h.Memory = defaultMemory | ||||
|  | ||||
| 	h.VSockGuestCID = defaultVSockGuestCID | ||||
|  | ||||
| 	h.Console = ConsoleStdio | ||||
|  | ||||
| 	return &h, nil | ||||
| @@ -203,6 +211,9 @@ func (h *HyperKit) execute(cmdline string) error { | ||||
| 	if h.VSock && h.StateDir == "" { | ||||
| 		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) { | ||||
| 		return fmt.Errorf("Kernel %s does not exist", h.Kernel) | ||||
| 	} | ||||
| @@ -335,6 +346,17 @@ func CreateDiskImage(location string, sizeMB int) error { | ||||
| 	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) { | ||||
| 	a := []string{"-A", "-u"} | ||||
| 	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)) | ||||
| 	} | ||||
| 	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 != "" { | ||||
| 		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 <stdbool.h> | ||||
|  | ||||
| void bootrom_init(const char *bootrom_path); | ||||
| int bootrom_init(const char *bootrom_path); | ||||
| uint64_t bootrom_load(void); | ||||
| 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); | ||||
| }; | ||||
|  | ||||
| void fbsd_init(char *userboot_path, char *bootvolume_path, char *kernelenv, | ||||
| int fbsd_init(char *userboot_path, char *bootvolume_path, char *kernelenv, | ||||
| 	char *cons); | ||||
| 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]; | ||||
| } __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); | ||||
|   | ||||
							
								
								
									
										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]); | ||||
| 		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", | ||||
| 		init_reply.magic[0], init_reply.magic[1], | ||||
|   | ||||
		Reference in New Issue
	
	Block a user