Disable vfio video if requested to

This commit is contained in:
HikariKnight 2023-04-09 17:59:40 +02:00
parent 8a2ddeb261
commit 15e475749d

View file

@ -5,6 +5,7 @@ import (
"regexp"
"github.com/HikariKnight/quickpassthrough/internal/configs"
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
)
// This function processes the enter event
@ -61,6 +62,12 @@ func (m *model) processSelection() {
case VIDEO:
// This is a YESNO Dialog
// Gets the selected item
selectedItem := m.lists[m.focused].SelectedItem()
if selectedItem.(item).title == "YES" {
m.disableVFIOVideo()
}
m.focused++
case INTRO:
@ -73,3 +80,9 @@ func (m *model) processSelection() {
os.Exit(0)
}
}
func (m *model) disableVFIOVideo() {
// Get the config
config := configs.GetConfig()
fileio.AppendContent(" vfio_pci.disable_vga=1", config.Path.CMDLINE)
}