Move disableVFIOVideo into its own file
This commit is contained in:
parent
9d131fa566
commit
5f38467e23
2 changed files with 12 additions and 10 deletions
11
internal/configs/config_vfio_video.go
Normal file
11
internal/configs/config_vfio_video.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package configs
|
||||
|
||||
import "github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
|
||||
func DisableVFIOVideo() {
|
||||
// Get the config
|
||||
config := GetConfig()
|
||||
|
||||
// Add to the kernel arguments that we want to disable VFIO video output on the host
|
||||
fileio.AppendContent(" vfio_pci.disable_vga=1", config.Path.CMDLINE)
|
||||
}
|
|
@ -4,7 +4,6 @@ import (
|
|||
"regexp"
|
||||
|
||||
"github.com/HikariKnight/quickpassthrough/internal/configs"
|
||||
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||
)
|
||||
|
||||
// This function processes the enter event
|
||||
|
@ -69,7 +68,7 @@ func (m *model) processSelection() bool {
|
|||
// If user selected yes then
|
||||
if selectedItem.(item).title == "YES" {
|
||||
// Add disable VFIO video to the config
|
||||
m.disableVFIOVideo()
|
||||
configs.DisableVFIOVideo()
|
||||
}
|
||||
|
||||
// Get the device ids for the selected gpu using ls-iommu
|
||||
|
@ -97,11 +96,3 @@ func (m *model) processSelection() bool {
|
|||
// Return false as we are not done
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *model) disableVFIOVideo() {
|
||||
// Get the config
|
||||
config := configs.GetConfig()
|
||||
|
||||
// Add to the kernel arguments that we want to disable VFIO video output on the host
|
||||
fileio.AppendContent(" vfio_pci.disable_vga=1", config.Path.CMDLINE)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue