mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 09:59:14 +00:00 
			
		
		
		
	vendor: Update hyperkit go bindings
The updated bindings primarily allow compilation on non-darwin operating systems. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
		
							
								
								
									
										14
									
								
								vendor/github.com/docker/hyperkit/go/hyperkit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								vendor/github.com/docker/hyperkit/go/hyperkit.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,5 +1,3 @@ | ||||
| // +build darwin | ||||
|  | ||||
| // Package hyperkit provides a Go wrapper around the hyperkit | ||||
| // command. It currently shells out to start hyperkit with the | ||||
| // provided configuration. | ||||
| @@ -75,6 +73,8 @@ type HyperKit struct { | ||||
| 	DiskImage string `json:"disk"` | ||||
| 	// ISOImage is the (optional) path to a ISO image to attach | ||||
| 	ISOImage string `json:"iso"` | ||||
| 	// VSock enables the virtio-socket device and exposes it on the host | ||||
| 	VSock bool `json:"vsock"` | ||||
|  | ||||
| 	// Kernel is the path to the kernel image to boot | ||||
| 	Kernel string `json:"kernel"` | ||||
| @@ -195,7 +195,7 @@ func (h *HyperKit) execute(cmdline string) error { | ||||
| 	var err error | ||||
| 	// Sanity checks on configuration | ||||
| 	if h.Console == ConsoleFile && h.StateDir == "" { | ||||
| 		return fmt.Errorf("If ConsoleFile is set, StateDir was be specified") | ||||
| 		return fmt.Errorf("If ConsoleFile is set, StateDir must be specified") | ||||
| 	} | ||||
| 	if h.UserData != "" && h.ISOImage != "" { | ||||
| 		return fmt.Errorf("If UserData is supplied, ISOImage must not be set") | ||||
| @@ -205,8 +205,11 @@ func (h *HyperKit) execute(cmdline string) error { | ||||
| 			return fmt.Errorf("ISO %s does not exist", h.ISOImage) | ||||
| 		} | ||||
| 	} | ||||
| 	if h.VSock && h.StateDir == "" { | ||||
| 		return fmt.Errorf("If virtio-sockets are enabled, StateDir must be specified") | ||||
| 	} | ||||
| 	if h.UserData != "" && h.StateDir == "" { | ||||
| 		return fmt.Errorf("If UserData is supplied, StateDir was be specified") | ||||
| 		return fmt.Errorf("If UserData is supplied, StateDir must be specified") | ||||
| 	} | ||||
| 	if _, err = os.Stat(h.Kernel); os.IsNotExist(err) { | ||||
| 		return fmt.Errorf("Kernel %s does not exist", h.Kernel) | ||||
| @@ -355,6 +358,9 @@ func (h *HyperKit) buildArgs(cmdline string) { | ||||
| 	if h.DiskImage != "" { | ||||
| 		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)) | ||||
| 	} | ||||
| 	if h.ISOImage != "" { | ||||
| 		a = append(a, "-s", fmt.Sprintf("4,ahci-cd,%s", h.ISOImage)) | ||||
| 	} | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/docker/hyperkit/src/include/xhyve/xhyve.h
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/docker/hyperkit/src/include/xhyve/xhyve.h
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -41,7 +41,6 @@ | ||||
| #define	VMEXIT_ABORT (-1) | ||||
|  | ||||
| extern int guest_ncpus; | ||||
| extern int print_mac; | ||||
| extern char *guest_uuid_str; | ||||
| extern char *vmname; | ||||
|  | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/docker/hyperkit/src/lib/acpitbl.c
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/docker/hyperkit/src/lib/acpitbl.c
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -737,7 +737,7 @@ void dsdt_fixup(int bus, uint16_t iobase, uint16_t iolimit, uint32_t membase32, | ||||
| { | ||||
| 	if (bus != 0) { | ||||
| 		fprintf(stderr, "DSDT, unsupported PCI bus (%d)\n", bus); | ||||
| 		exit(-1); | ||||
| 		exit(1); | ||||
| 	} | ||||
|  | ||||
| 	acpitbl_write16(dsdt, 0xb6, iobase); | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/docker/hyperkit/src/lib/mevent.c
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/docker/hyperkit/src/lib/mevent.c
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -408,7 +408,7 @@ mevent_dispatch(void) | ||||
| 	ret = pipe(mevent_pipefd); | ||||
| 	if (ret < 0) { | ||||
| 		perror("pipe"); | ||||
| 		exit(0); | ||||
| 		exit(1); | ||||
| 	} | ||||
|  | ||||
| 	/* | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/docker/hyperkit/src/lib/pci_virtio_net_vmnet.c
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/docker/hyperkit/src/lib/pci_virtio_net_vmnet.c
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -728,14 +728,6 @@ pci_vtnet_init(struct pci_devinst *pi, UNUSED char *opts) | ||||
| 		return (-1); | ||||
| 	} | ||||
|  | ||||
|     if (print_mac == 1) | ||||
|     { | ||||
| 		printf("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", | ||||
| 			sc->vms->mac[0], sc->vms->mac[1], sc->vms->mac[2], | ||||
| 			sc->vms->mac[3], sc->vms->mac[4], sc->vms->mac[5]); | ||||
| 		exit(0); | ||||
|     } | ||||
|  | ||||
| 	sc->vsc_config.mac[0] = sc->vms->mac[0]; | ||||
| 	sc->vsc_config.mac[1] = sc->vms->mac[1]; | ||||
| 	sc->vsc_config.mac[2] = sc->vms->mac[2]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user