
Daniel Veillard wrote:
On Fri, Mar 31, 2006 at 04:47:38PM -0500, Daniel Veillard wrote:
I just added the following:
/** * virDomainReboot: * @domain: a domain object * @flags: extra flags for the reboot operation, not used yet * * Reboot a domain, the domain object is still usable there after but * the domain OS is being stopped for a restart. * Note that the guest OS may ignore the request. * * Returns 0 in case of success and -1 in case of failure. */ int virDomainReboot(virDomainPtr domain, unsigned int flags)
there is also a new "virsh reboot" command to test it. However there when trying it I saw that the guest OS shutdown in reboot mode:
------------------------ Turning off quotas: Unmounting pipe file systems: Please stand by while rebooting the system... md: stopping all md devices. md: md0 switched to read-only mode. Restarting system. . ------------------------
but the domain was not relaunched by default. I guess this also requires to set up specific xenstore attributes so that the domain is actually restarted. So not completely done yet.
You are probably aware of this but FYI... I used virDomainReboot() with success when the domain was created with "xm create" and "on_reboot = 'restart'" in domain config file. 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 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> Same goes turning sxp to XML in xend_parse_sexp_desc() in xend_internal.c. Regards, Jim