From 9fbdb84822469f66adc74177b630b0271e271773 Mon Sep 17 00:00:00 2001 From: modeco80 Date: Sat, 2 Nov 2024 07:54:26 -0400 Subject: [PATCH] ok fiiiiine i'll do it the non hacky way --- cvmts/src/vm/qemu.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cvmts/src/vm/qemu.ts b/cvmts/src/vm/qemu.ts index 3e2c4f7..7857e5f 100644 --- a/cvmts/src/vm/qemu.ts +++ b/cvmts/src/vm/qemu.ts @@ -31,6 +31,12 @@ export class QemuVMShim implements VM { } else { this.vm = new QemuVM(def); } + + this.vm.on('statechange', async (newState) => { + if(newState == VMState.Started) { + await this.PlaceVCPUThreadsIntoCGroup(); + } + }); } Start(): Promise { @@ -70,10 +76,6 @@ export class QemuVMShim implements VM { } StartDisplay(): void { - // HACK: We should probably use another subscribed eventemitter for this. For now, - // this "works". I guess. - this.PlaceVCPUThreadsIntoCGroup(); - // boot it up let info = this.vm.GetDisplayInfo();