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

Re: [Xen-devel] [PATCH 24/24] libxl: aborting bootloader invocation when domain dioes



> diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
> index 991f16e..e43aedc 100644
> --- a/tools/libxl/libxl_event.c
> +++ b/tools/libxl/libxl_event.c
> @@ -585,6 +585,37 @@ int libxl__ev_devstate_wait(libxl__gc *gc, 
> libxl__ev_devstate *ds,
>  }
>  
>  /*
> + * domain death/destruction
> + */
> +
> +static void domaindeathcheck_callback(libxl__egc *egc, libxl__ev_xswatch *w,
> +                            const char *watch_path, const char *event_path)
> +{
> +    libxl__domaindeathcheck *dc = CONTAINER_OF(w, *dc, watch);
> +    EGC_GC;
> +    const char *p = libxl__xs_read(gc, XBT_NULL, watch_path);
> +    if (p) return;
> +
> +    if (errno!=ENOENT) {
> +        LIBXL__EVENT_DISASTER(egc,"failed to read xenstore"
> +                              " for domain deatch check", errno, 0);

                                              detach

> +        return;
> +    }
> +
> +    LOG(ERROR,"%s: domain %"PRIu32" removed (%s no longer in xenstore)",
> +        dc->what, dc->domid, watch_path);
> +    dc->callback(egc, dc);
> +}
> +
> +int libxl__domaindeathcheck_start(libxl__gc *gc,
> +                                  libxl__domaindeathcheck *dc)
> +{
> +    const char *path = GCSPRINTF("/local/domain/%"PRIu32, dc->domid);
> +    return libxl__ev_xswatch_register(gc, &dc->watch,
> +                                      domaindeathcheck_callback, path);

So we are watching for the toolstack (possibly the same one as we are
running in) to destroy the domain and therefore nuke the xs directory --
does that actually work?

Specifically in the case of xl running the bootloader -- is xl in any
position to handle a domain death during domain build? Isn't it doing
the create synchronously?

(note, I'm not actually 100% sure what might be wrong with this, it just
strikes me as odd...)

Wouldn't using the @releaseDomain watch be more reliable?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.