Re: [libvirt] [PATCH 09/13] Add support for an explicit guest reboot event

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

 



On Fri, Mar 19, 2010 at 03:38:57PM +0000, Daniel P. Berrange wrote:
> The reboot event is not a normal lifecycle event, since the
> virtual machine on the host does not change state. Rather the
> guest OS is resetting the virtual CPUs. ie, the QEMU process
> does not restart. Thus, this does not belong in the current
> lifecycle events callback.
> 
> This introduces a new event type
> 
>     VIR_DOMAIN_EVENT_ID_REBOOT
> 
> It takes no parameters, besides the virDomainPtr, so it can
> use the generic callback signature.
> 
[...]
> --- a/include/libvirt/libvirt.h.in
> +++ b/include/libvirt/libvirt.h.in
> @@ -1850,6 +1850,7 @@ typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn,
>  
>  typedef enum {
>      VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0,       /* virConnectDomainEventCallback */
> +    VIR_DOMAIN_EVENT_ID_REBOOT = 1,          /* virConnectDomainEventGenericCallback */

  that answer my question on a previous review, yes we initialized to 0

[...]
> +
> +static int
> +qemuHandleDomainReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
> +                      virDomainObjPtr vm)
> +{
> +    struct qemud_driver *driver = qemu_driver;
> +    virDomainEventPtr event;
> +
> +    virDomainObjLock(vm);
> +    event = virDomainEventRebootNewFromObj(vm);
> +    virDomainObjUnlock(vm);
> +
> +    if (event) {
> +        qemuDriverLock(driver);
> +        qemuDomainEventQueue(driver, event);
> +        qemuDriverUnlock(driver);
> +    }
> +
> +    return 0;
> +}
> +
> +
>  static qemuMonitorCallbacks monitorCallbacks = {
>      .eofNotify = qemuHandleMonitorEOF,
>      .diskSecretLookup = findVolumeQcowPassphrase,
> +    .domainReset = qemuHandleDomainReset,
>  };
  Okay, we already had qemuMonitorEmitReset() emit the event if the hook
was in place, which explain why there is no detection code in that
patch,


  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]