From: Christopher Head <chead@cs.ubc.ca>
To: xen-devel@lists.xensource.com
Subject: Re: Trigger code in domU from dom0
Date: Thu, 21 Aug 2008 20:01:34 -0700 [thread overview]
Message-ID: <48AE2C0E.8060204@cs.ubc.ca> (raw)
In-Reply-To: <7ef321c10808211607j2d561064rfdcbd56aee589b66@mail.gmail.com>
-----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-----
next prev parent reply other threads:[~2008-08-22 3:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 23:07 Trigger code in domU from dom0 Asim
2008-08-22 3:01 ` Christopher Head [this message]
[not found] ` <48AE2AA4.9000104@cs.ubc.ca>
[not found] ` <7ef321c10808212014n1db69d6ej124a13431ab13bfb@mail.gmail.com>
2008-08-22 4:13 ` Christopher Head
2008-08-22 22:02 ` Asim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48AE2C0E.8060204@cs.ubc.ca \
--to=chead@cs.ubc.ca \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.