Disable vfio video if requested to
This commit is contained in:
parent
8a2ddeb261
commit
15e475749d
1 changed files with 13 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/HikariKnight/quickpassthrough/internal/configs"
|
"github.com/HikariKnight/quickpassthrough/internal/configs"
|
||||||
|
"github.com/HikariKnight/quickpassthrough/pkg/fileio"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This function processes the enter event
|
// This function processes the enter event
|
||||||
|
@ -61,6 +62,12 @@ func (m *model) processSelection() {
|
||||||
|
|
||||||
case VIDEO:
|
case VIDEO:
|
||||||
// This is a YESNO Dialog
|
// This is a YESNO Dialog
|
||||||
|
// Gets the selected item
|
||||||
|
selectedItem := m.lists[m.focused].SelectedItem()
|
||||||
|
|
||||||
|
if selectedItem.(item).title == "YES" {
|
||||||
|
m.disableVFIOVideo()
|
||||||
|
}
|
||||||
m.focused++
|
m.focused++
|
||||||
|
|
||||||
case INTRO:
|
case INTRO:
|
||||||
|
@ -73,3 +80,9 @@ func (m *model) processSelection() {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *model) disableVFIOVideo() {
|
||||||
|
// Get the config
|
||||||
|
config := configs.GetConfig()
|
||||||
|
fileio.AppendContent(" vfio_pci.disable_vga=1", config.Path.CMDLINE)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue