Move disableVFIOVideo into its own file

This commit is contained in:
HikariKnight 2023-04-09 19:11:30 +02:00
parent 9d131fa566
commit 5f38467e23
2 changed files with 12 additions and 10 deletions

View 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)
}

View file

@ -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)
}