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] Domains not being destroyed properly

On Fri, 2011-06-24 at 13:54 +0100, Anthony Wright wrote:
> The problem is that I don't think there's enough information available
> from watching @releaseDomain to implement a reaper well. The
> xenstore-watch on @releaseDomain only tells you that a domain has died
> (to make things more complicated I actually get two notifications when a
> domain get's shutdown), it doesn't tell you which domain has died.

This has proven to be sufficient for all toolstacks I know of.

>  A
> reaper would have to maintain a list of domains as they were before the
> notification to compare against the list after the notification to be
> able to issue a notification for the domain that has died. If that list
> got out of sync it would start issuing incorrect domain death notifications.

You don't need to maintain a list, simply call libxl_list_domain() and
for each returned domain examine the flags and shutdown reason to
determine if it is dead (and why), dying or still running.

Since you are explicitly arranging that nothing else will destroy
domains once they die so they will always be in that list when you get
to them.

> Looking at the watch code while the code in xenstored_domain has the
> domain id & name available, there doesn't seem to be the ability to be
> able to add arguments to @releaseDomain to let it tell the watchers
> which domain has been released to avoid having to maintain this list.

It shouldn't matter due to the above but it is possible to add extra
data to the vector included in the watch other than XS_WATCH_PATH and
XS_WATCH_TOKEN). IOW you can add more stuff to the "data" vector in
add_event. Linux's drivers/xen/xenfs/xenbus.c:watch_fired() even
supports exporting the extra to userspace.

> Therefore the simplest change would seem to be to modify
> xenstored_domain.c so that if a script existed (e.g.
> /etc/xen/scripts/domain-destroyed) at domain destruction this script was
> called with the domain id & name as arguments. Would it be acceptable?
> 
> Anthony.



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