[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 0 of 3] xl and hotplug: Introduce and use shutdown and reboot xm compatibility options
On Wed, 2012-10-03 at 10:03 +0100, Sander Eikelenboom wrote: > Tuesday, October 2, 2012, 4:02:18 PM, you wrote: > > > On Thu, 2012-09-27 at 21:11 +0100, Sander Eikelenboom wrote: > >> Tuesday, September 25, 2012, 5:29:09 PM, you wrote: > >> > >> > On Tue, 2012-09-25 at 16:11 +0100, Sander Eikelenboom wrote: > >> > >> >> The only relative simple implementation i thought of was direct > >> >> shutting down all, and when the -w parameter was set, just loop and > >> >> wait on events until the only running domain is domain-0. > >> >> Although this exactly does what has to be done, it somehow sounds a > >> >> bit dirty. > >> > >> > I think you can allocate an array of libxl_evenable_domain_death*, of > >> > nr_doms in size and then as you shutdown each domain call > >> > libxl_evenable_domain_death for it too. > >> > >> > Then you loop waiting for destroy events, calling > >> > libxl_evdisable_domain_death as each domain dies, while counting back > >> > from nr_doms until 0. When it reaches 0 everything you asked for has > >> > been shutdown. > >> > >> > Or something like that, I've not actually implemented it ;-) > >> > >> > Ian. > >> > >> It's time to call defeat, without proper C skills it seems a bit too > >> hard to figure it out. > > > That's ok, I'll add it to my TODO to pickup where you left off (unless > > someone beats me to it). > > Thx ! > Would be nice for 4.2.1 since the xendomains stop script doesn't > function properly with xl as toolstack, and not shutting down the > domains but just pulls the plug. Agreed. > Would it be helpful to you, to send the doc patches as well ? Absolutely! > > > > Thanks for taking it this far! FWIW you seemed to be pretty close. > > >> Can't seem to get the hang of how to keep a reference to > >> libxl_evgen_domain_death and use it to check if the domid of the event > >> is the same as that from a domain we are waiting to shutdown. > >> The rest of the code doesn't give me much pointers since all commands > >> seem to operate on a single domid at once. > >> > >> The concoction below leads to: > >> xl_cmdimpl.c: In function Ãshutdown_domainÃ: > >> xl_cmdimpl.c:2766: error: dereferencing pointer to incomplete type > > > In case you are interested this is because the libxl_evgen_domain_death > > type is opaque to users of libxl so constructs like > > domains_wait_shutdown[i]->domid are not possible. > > > The answer is to use the 3rd argument to libxl_evenable_domain_death > > (the one of type libxl_ev_user) to pass a "closure", this value is > > returned in the event's "for_user" field. The application can use this > > to store data specific to this particular event -- in this case it would > > probably be sufficient to just pass the domid here but in principal one > > could pass a pointer to any datastructure. > > Thanks for the explanation, although i still don't see how to actually change > the code the right way. > > > > Thanks again, > > Ian. > > > > > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |