Pausing guest VM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am trying to synchronize processing of certain network event with
guest VM. For the event, I want to pause a running VM; process event
in thread X and resume VM. I want to do this from KVM kernel module
code (not qemu). I tried couple of approaches (mentioned below) but it
allows me to pause VM after guest yields cpu voluntarily - which is
not immediate. I could not find a way to force guest VM to pause. Any
signals that it would respond to pause ?

I understand vcpu_enter_guest() called from __vcpu_run() is the
function where its actually executing guest VM. I am working with the
same functions. Guest VM being just another process for kernel,
following is the approach I tried

A. When the event occurs, make thread X sleep on waitqueue1 and set
some atomic flag F. In __vcpu_run(), before it checks if
need_resched() is true; check if above atomic flag F is true. If true,
make VM thread sleep on waitqueue2 and wake-up waitqueue1. Process the
event and wake-up waitqueue2

B. Also tried setting need_resched of VM process using
set_tsk_need_resched() and if flag F is true, mark state as
TASK_INTERRUPTIBLE  a common approach used for scheduling out process.
But both these waits till VM co-operates.

Is there any way to pause guest VM forcibly ?

--
Sunil
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux