
Daniel Veillard wrote:
Looking at virDomainParseXMLDesc() in xml.c I see we are not accounting for a <on_reboot> element (or on_crash, on_poweroff) in the XML. Are
I wasn't sure how much this was needed, clearly it is now.
you working on this Daniel or should I take a stab at it? I'm guessing you just want elements like
<on_reboot>restart</on_reboot> <on_poweroff>destroy</on_poweroff> <on_crash>restart</on_crash>
Yes. Please go ahead, I didn't yet applied your previous patch but it looks sensible, just some bogus logic was left from the old code.
Same goes turning sxp to XML in xend_parse_sexp_desc() in xend_internal.c.
Yup. just provide information about the new elements added and their values so I can extend the documentation page about the XML format (at some point I will also provide a Relax-NG or XSD schemas to validate them).
Ok, here is a patch that accounts for various lifecycle events, e.g. on_reboot, on_poweroff, on_crash. The new elements (children of domain element) are <on_reboot>action</on_reboot> <on_poweroff>action</on_poweroff> <on_crash>action</on_crash> on_reboot: Action to be taken when domain is rebooted. on_poweroff: Action to be taken when a power off or shutdown operation is performed inside the domain. on_crash: Action to be taken when domain crashes. action values can be one of destroy: The domain is cleaned up as normal. restart: A new domain is started in place of the old one. preserve: The domain will remain in memory until it is destroyed manually. rename-restart: The domain will remain in memory until it is destroyed manually, and a new, renamed domain is started. Regards, Jim