Fix freezing on VM shutdown

This commit is contained in:
MDMCK10
2023-02-11 18:52:45 +01:00
parent e7b56d18e6
commit 87cefdaaba
2 changed files with 18 additions and 1 deletions

View File

@@ -55,6 +55,10 @@ export default class QEMUVM extends EventEmitter {
this.processRestartErrorLevel = 0;
this.expectedExit = false;
this.qmpClient = new QMPClient(this.qmpSock, this.qmpType);
this.qmpClient.on('qmpshutdown', () => {
console.log("[INFO] QEMU requested shutdown, restarting...");
this.Restore();
});
this.qmpClient.on('connected', () => this.qmpConnected());
this.qmpClient.on('close', () => this.qmpClosed());
}