network.go
func (v *VM) nextNetworkAdapterID(vmx map[string]string) int {
	var nextID int
	prefix := "ethernet"

	for key := range vmx {
		if strings.HasPrefix(key, prefix) {
			ethN := strings.Split(key, ".")[0]
			number, _ := strconv.Atoi(strings.Split(ethN, prefix)[1])

			// If ethN is not present, its id is recycled
			if vmx[ethN+".present"] == "FALSE" {
				return number
			}

			if number > nextID {
				nextID = number
			}
		}
	}

	nextID++

	return nextID
}
func (v *VM) nextNetworkAdapterID(vmx map[string]string) int {
	var nextID int
	prefix := "ethernet"

	for key := range vmx {
		if strings.HasPrefix(key, prefix) {
			ethN := strings.Split(key, ".")[0]
			number, _ := strconv.Atoi(strings.Split(ethN, prefix)[1])

			// If ethN is not present, its id is recycled
			if vmx[ethN+".present"] == "FALSE" {
				return number
			}

			if number > nextID {
				nextID = number
			}
		}
	}

	nextID++

	return nextID
}
// nextNetworkAdapterID returns the next available ethernet ID, reusing ids if
// the ethernet adapter has "present" equal to "FALSE"