Previous commit didn't work, let's try it again.

This commit is contained in:
MDMCK10
2023-02-11 20:52:25 +01:00
parent 25776c257f
commit 5f603a88d9
2 changed files with 15 additions and 14 deletions

View File

@@ -68,10 +68,16 @@ export default class QMPClient extends EventEmitter {
else if(msg.event !== undefined) {
switch(msg.event) {
case "STOP":
{
console.log("[INFO] Resetting QEMU...");
this.reboot();
break;
}
case "RESET":
{
this.emit("qmpshutdown");
break
console.log("[INFO] QEMU reset event occurred");
this.resume();
break;
};
default: {
this.emit("qmpreturn", '');
@@ -104,6 +110,13 @@ export default class QMPClient extends EventEmitter {
await this.execute({"execute": "system_reset"});
}
async resume() {
if (!this.connected)
return;
await this.execute({"execute": "cont"});
}
async ExitQEMU() {
if (!this.connected)
return;