0

Is there any signal or something that could allow me (guest OS) to recognize that my virtual machine is being paused in KVM/Qemu before it gets paused? It's important for me to not depend on option to enable communication between host<->guest in qemu.

Thanks

  • Do you need to discover the paused state after the VM is unblocked, or during the paused state? – shodanshok Jul 27 '22 at 22:27
  • I need to know before it gets paused. After reasume I can detect it by clock I guess. – Damian Kęska Jul 28 '22 at 07:23
  • I strongly doubt you can be alerted *before* the machine is paused. Pausing it simple means the hypervisor put to sleeps its process and threads, with the vm not knowing anything about that by design. – shodanshok Jul 28 '22 at 08:38

1 Answers1

0

No that's not possible.

Once the pause is triggered, there is no delay and no process to undo the pause before it is actually paused.

Not like the shutdown -h in which you get a message that the system will shutdown soon.

Once your VM is paused, you can detect it because you can't use it anymore. It's as simple as that.

Samuel PE
  • 48
  • 5
  • In qemu there is actually such thing: https://wiki.qemu.org/Features/GuestAgent – Damian Kęska Jul 28 '22 at 10:18
  • but I was wondering if I can use something like that, when the provider didnt enable the communication bridge between host and guest – Damian Kęska Jul 28 '22 at 10:19
  • You actually found the answer in that doc: `2) there is no way for a client to detect whether or not qemu-ga has [re-]connected or disconnected to the backend` – Samuel PE Jul 28 '22 at 10:38
  • But the qemu-ga is returning a response, then shoiuld be aware? Anyway I was curious if there is any other signal or device behavior that could help detect this. And that "client" is the hypervisor, so I guess it is unrelated? – Damian Kęska Aug 03 '22 at 06:18