Manager: Pass certain command-line params to VMs

This commit is contained in:
Alexander Babikov
2025-08-27 23:54:39 +05:00
parent 9133e5bd2f
commit 6f99d565e1
3 changed files with 17 additions and 0 deletions

View File

@@ -230,6 +230,7 @@ int other_scsi_present = 0; /* SCSI contro
int is_pcjr = 0; /* The current machine is PCjr. */
int portable_mode = 0; /* We are running in portable mode
(global dirs = exe path) */
int global_cfg_overridden = 0; /* Global config file was overriden on command line */
int monitor_edid = 0; /* (C) Which EDID to use. 0=default, 1=custom. */
char monitor_edid_path[1024] = { 0 }; /* (C) Path to custom EDID */
@@ -852,6 +853,7 @@ usage:
if ((c + 1) == argc || plat_dir_check(argv[c + 1]))
goto usage;
global_cfg_overridden = 1;
global = argv[++c];
} else if (!strcasecmp(argv[c], "--image") || !strcasecmp(argv[c], "-I")) {
if ((c + 1) == argc)

View File

@@ -202,6 +202,7 @@ extern char vmm_path[1024]; /* VM Manager path to scan */
extern int start_vmm; /* the current execution will start the manager */
extern int portable_mode; /* we are running in portable mode
(global dirs = exe path) */
extern int global_cfg_overridden; /* global config file was overriden on command line */
extern int monitor_edid; /* (C) Which EDID to use. 0=default, 1=custom. */
extern char monitor_edid_path[1024]; /* (C) Path to custom EDID */

View File

@@ -425,6 +425,16 @@ VMManagerSystem::launchMainProcess() {
QStringList args;
args << "--vmpath" << config_dir;
args << "--vmname" << displayName;
if (rom_path[0] != '\0')
args << "--rompath" << QString(rom_path);
if (global_cfg_overridden)
args << "--global" << QString(global_cfg_path);
if (!hook_enabled)
args << "--nohook";
if (start_in_fullscreen)
args << "--fullscreen";
if (!confirm_exit_cmdl)
args << "--noconfirm";
process->setProgram(program);
process->setArguments(args);
qDebug() << Q_FUNC_INFO << " Full Command:" << process->program() << " " << process->arguments();
@@ -481,6 +491,10 @@ VMManagerSystem::launchSettings() {
QStringList open_command_args;
QStringList args;
args << "--vmpath" << config_dir << "--settings";
if (rom_path[0] != '\0')
args << "--rompath" << QString(rom_path);
if (global_cfg_overridden)
args << "--global" << QString(global_cfg_path);
process->setProgram(program);
process->setArguments(args);
qDebug() << Q_FUNC_INFO << " Full Command:" << process->program() << " " << process->arguments();