watch event for die domain ?
Hi,
I am writing a small application to watch for xenstore events. I want to know when a specific domain shutdown or reboot. It is best to watch it via xenbus interface, but how? Is there any event or node can give me such an event?
If not, I must periodically scan the domains (using libxc interface) to detect if a domain dies, but that is not as good as xenbus approach.
Many thanks.
Hieu
Quoted 4 lines · NAHieu
I am writing a small application to watch for xenstore events. I want to know when a specific domain shutdown or reboot. It is best to watch it via xenbus interface, but how? Is there any event or node can give me such an event?
You can have a watch on @releaseDomain, the watch will fire whenever xenstored unmaps the store page it has mapped from the domain. There's also @introduceDomain for when xenstored maps the page after the domain was created.
Quoted 3 lines
If not, I must periodically scan the domains (using libxc interface) to detect if a domain dies, but that is not as good as xenbus approach.
Yeah, polling is definitely not the way to go ;-)
christian
Quoted 10 lines · Christian Limpach
Quoted 4 lines · NAHieu
I am writing a small application to watch for xenstore events. I want to know when a specific domain shutdown or reboot. It is best to watch it via xenbus interface, but how? Is there any event or node can give me such an event?
You can have a watch on @releaseDomain, the watch will fire whenever xenstored unmaps the store page it has mapped from the domain. There's also @introduceDomain for when xenstored maps the page after the domain was created.
Speaking of which, I have a patch which changes over introduce/release to a write/rm in /tool/xenstored/domain/<id>, so this will combine nicely, too. (Part of the patch series to make xenstored restartable).
This is probably more generically useful, and avoids turning xenstored into an event mechanism 8)
Cheers,
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman