[libvirt] [PATCH v2 2/3] libxl: implement virDomainPM* functions
Marek Marczykowski-Górecki
marmarek at invisiblethingslab.com
Fri Sep 7 17:22:44 UTC 2018
On Fri, Sep 07, 2018 at 11:10:14AM -0600, Jim Fehlig wrote:
> On 09/06/2018 03:06 PM, Marek Marczykowski-Górecki wrote:
>
> A few additional comments came to mind while looking at this patch again...
Perfect timing, I was just going to hit "send" on v3...
> > > > + /* Unlock virDomainObjPtr to not deadlock with even handler, which will try
> > > > + * to send lifecycle event
> > > > + */
> > > > + virObjectUnlock(vm);
> > > > + ret = libxl_domain_suspend_only(cfg->ctx, vm->def->id, NULL);
> > > > + virObjectLock(vm);
> > > > +
> > > > + if (ret < 0) {
> > > > + virReportError(VIR_ERR_INTERNAL_ERROR,
> > > > + _("Failed to suspend domain '%d'"), vm->def->id);
> > > > + goto endjob;
> > > > + }
> > > > +
>
> Should we create a lifecycle event and/or call virDomainObjSetState on
> successful suspend? Seems neither are done in the qemu driver, but might be
> an oversight there too.
Not sure about qemu, but here it is done by libxl domain death
event handler (libxlDomainShutdownThread in libxl_domain.c). See patch
1/3.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180907/4239168f/attachment-0001.sig>
More information about the libvir-list
mailing list