Manager: Fix machine status showing as "Running"...
instead of "Paused/Waiting" when opening settings for a stopped machine by establishing a minimal manager socket connection
This commit is contained in:
@@ -418,6 +418,14 @@ VMManagerSystem::launchMainProcess() {
|
||||
qDebug() << Q_FUNC_INFO << " Full Command:" << process->program() << " " << process->arguments();
|
||||
process->start();
|
||||
updateTimestamp();
|
||||
|
||||
connect(process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
[=](const int exitCode, const QProcess::ExitStatus exitStatus){
|
||||
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
||||
qInfo().nospace().noquote() << "Abnormal program termination while launching main process: exit code " << exitCode << ", exit status " << exitStatus;
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
@@ -432,6 +440,15 @@ VMManagerSystem::launchSettings() {
|
||||
return;
|
||||
}
|
||||
|
||||
// start the server first to get the socket name
|
||||
if (!serverIsRunning) {
|
||||
if(!startServer()) {
|
||||
// FIXME: Better error handling
|
||||
qInfo("Failed to start VM Manager server");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If the system is already running, instruct it to show settings
|
||||
if (process->processId() != 0) {
|
||||
#ifdef Q_OS_WINDOWS
|
||||
@@ -454,6 +471,14 @@ VMManagerSystem::launchSettings() {
|
||||
process->setArguments(args);
|
||||
qDebug() << Q_FUNC_INFO << " Full Command:" << process->program() << " " << process->arguments();
|
||||
process->start();
|
||||
|
||||
connect(process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
[=](const int exitCode, const QProcess::ExitStatus exitStatus){
|
||||
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
||||
qInfo().nospace().noquote() << "Abnormal program termination while launching settings: exit code " << exitCode << ", exit status " << exitStatus;
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user