WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Trigger code in domU from dom0

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] Trigger code in domU from dom0
From: Christopher Head <chead@xxxxxxxxx>
Date: Thu, 21 Aug 2008 20:01:34 -0700
Delivery-date: Thu, 21 Aug 2008 20:01:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <7ef321c10808211607j2d561064rfdcbd56aee589b66@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7ef321c10808211607j2d561064rfdcbd56aee589b66@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.16 (X11/20080818)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I'm doing something very similar for a research project. Assuming your
domU is PV, look in linux/drivers/xen/core/reboot.c and
linux/drivers/xen/core/machine_reboot.c. You'll discover that the dom0
tools don't actually suspend the domU for migration: instead, they send
an event channel event to domU which then suspends itself via a
hypercall. All you have to do is pick a place sufficiently close to the
hypercall to run your own code.

Note that this is SMP safe as well: one of the first things the kernel
does when the suspend message is received is shut down all CPUs except
for #0, so only #0 will be alive around the hypercall. Combining that
with the lack of preemption in the Xen kernel, you have a situation
where your code is guaranteed to run before anything else.

Chris

Asim wrote:
| Hi,
|
| I want to trigger some code in my domU as soon as migration happens. I
| can only know when to trigger in my destination dom0 but the code
| should trigger in domU.
| How do I go about doing this? Is there any script that completes or is
| running that executes when a migration finishes or is about to finish?
|
| Regards,
| Asim
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiuLA0ACgkQiD2svb/jCb7h/gCeNrT5yZXcX8T8oRlcFOtkSTQI
gFwAn00RJmlo6xuQpxLOZg4Yo9fM/gpE
=7q20
-----END PGP SIGNATURE-----

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>