On Mon, Sep 20, 2021 at 11:22:15AM +0200, Juergen Gross wrote:
> On 17.09.21 17:46, Roger Pau Monne wrote:
> > Exploiting the talloc clean up routines to close the Xen interfaces
> > is cumbersome, specially when atexit can be used to the same effect.
> > 
> > Convert xc and gnttab to use atexit which allows to drop one
> > indirection from the storing variables.
> > 
> > No functional change intended.
> > 
> > Signed-off-by: Roger Pau Monné <[email protected]>
> > ---
> >   tools/xenstore/xenstored_core.h   |  2 +-
> >   tools/xenstore/xenstored_domain.c | 57 +++++++++++++------------------
> >   2 files changed, 25 insertions(+), 34 deletions(-)
> > 
> > diff --git a/tools/xenstore/xenstored_domain.c 
> > b/tools/xenstore/xenstored_domain.c
> > index 47e9107c14..8930303773 100644
> > --- a/tools/xenstore/xenstored_domain.c
> > +++ b/tools/xenstore/xenstored_domain.c
> > @@ -737,35 +725,38 @@ void dom0_init(void)
> >     xenevtchn_notify(xce_handle, dom0->port);
> >   }
> > +void interface_cleanup(void)
> > +{
> > +   if (xc_handle) {
> > +           xc_interface_close(xc_handle);
> > +           xc_handle = NULL;
> > +   }
> > +   if (xgt_handle) {
> > +           xengnttab_close(xgt_handle);
> > +           xgt_handle = NULL;
> > +   }
> 
> Could you please add closing of xce_handle(), too?

Sure, I somehow assumed there was a reason for not closing it related
to live update, but I see that's not the case as you use exec to
launch the new image and atexit handlers are not called in that case.

Thanks, Roger.

Reply via email to