Raw block device passthrough support

This commit is contained in:
AlexSSD7 2023-08-29 15:31:17 +01:00
commit 003b562e48
7 changed files with 133 additions and 26 deletions

View file

@ -51,10 +51,10 @@ func doUSBRootCheck() {
}
func runVM(passthroughArg string, fn func(context.Context, *vm.VM, *vm.FileManager) int, forwardPortsRules []vm.PortForwardingRule, unrestrictedNetworking bool) int {
var passthroughConfig []vm.USBDevicePassthroughConfig
var passthroughConfig vm.PassthroughConfig
if passthroughArg != "" {
passthroughConfig = []vm.USBDevicePassthroughConfig{getDevicePassthroughConfig(passthroughArg)}
passthroughConfig = getDevicePassthroughConfig(passthroughArg)
doUSBRootCheck()
}
@ -66,7 +66,7 @@ func runVM(passthroughArg string, fn func(context.Context, *vm.VM, *vm.FileManag
MemoryAlloc: vmMemAllocFlag,
USBDevices: passthroughConfig,
PassthroughConfig: passthroughConfig,
ExtraPortForwardingRules: forwardPortsRules,
OSUpTimeout: time.Duration(vmOSUpTimeoutFlag) * time.Second,