Jim Fehlig | 5 Apr 2006 01:45
Picon
Favicon

Re: Request for additional entry points

Daniel Veillard wrote:

>On Fri, Mar 31, 2006 at 04:47:38PM -0500, Daniel Veillard wrote:
>  
>
>I just added the following:
>
>/**
> * virDomainReboot:
> *  <at> domain: a domain object
> *  <at> 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.
(Continue reading)

Daniel Veillard | 5 Apr 2006 10:14
Picon
Favicon
Gravatar

Re: Request for additional entry points

On Tue, Apr 04, 2006 at 05:45:56PM -0600, Jim Fehlig wrote:
> > 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.

  Yup, that's what's missing, it's one of the XenStore attributes

> 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.
(Continue reading)

Jim Fehlig | 7 Apr 2006 23:40
Picon
Favicon

Re: Request for additional entry points

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.
>>    
>>
>
(Continue reading)

Daniel Veillard | 10 Apr 2006 09:34
Picon
Favicon
Gravatar

Re: Request for additional entry points

On Fri, Apr 07, 2006 at 03:40:10PM -0600, Jim Fehlig wrote:
> 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>

  Looks fine, applied and commited, thanks ! I also added the description
of the new elements to the documentation.

  Thanks !

Daniel

--

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard <at> redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


Gmane