All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 2/2] libxl: clean up qemu-save and qemu-resume files
Date: Wed, 3 Jun 2015 11:22:27 +0100	[thread overview]
Message-ID: <20150603102226.GA12468@zion.uk.xensource.com> (raw)
In-Reply-To: <1433325531.7108.47.camel@citrix.com>

On Wed, Jun 03, 2015 at 10:58:51AM +0100, Ian Campbell wrote:
> On Mon, 2015-06-01 at 18:24 +0100, Wei Liu wrote:
> > These files are leaked when using qemu-trad stubdom.  They are
> > intermediate files created by libxc. Unfortunately they don't fit well
> > in our userdata scheme. Clean them up after we destroy guest, we're
> > sure they are not useful anymore at that point.
> 
> Could this be done in the parent process at some point following
> domain_destroy_domid_cb or domain_destroy_cb perhaps?
> 

I just had a look. The deletion of qemu-* files can be moved a few lines
up, just after we destroy all userdata files and before forking. No need
to defer it in a callback.

Wei.

> I think we don't want to do things in sub processes which don't need to
> be, just to keep things simpler, and I think the logging is more
> reliable too.
> 
> 
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> >  tools/libxl/libxl.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > index 9117b01..ad2290d 100644
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -1686,6 +1686,15 @@ static void devices_destroy_cb(libxl__egc *egc,
> >  
> >          rc = xc_domain_destroy(ctx->xch, domid);
> >          if (rc < 0) goto badchild;
> > +        /* Clean up qemu-save and qemu-resume files. They are
> > +         * intermediate files created by libxc. Unfortunately they
> > +         * don't fit in existing userdata scheme very well.
> > +         */
> > +        rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
> > +        if (rc < 0) goto badchild;
> > +        rc = libxl__remove_file(gc,
> > +                 GCSPRINTF(XC_DEVICE_MODEL_RESTORE_FILE".%u", domid));
> > +        if (rc < 0) goto badchild;
> >          _exit(0);
> >  
> >      badchild:
> 

      parent reply	other threads:[~2015-06-03 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 17:24 [PATCH 0/2] Two stubdom patches Wei Liu
2015-06-01 17:24 ` [PATCH 1/2] libxl: remove code in stubdom creation failure path and callback Wei Liu
2015-06-03 10:35   ` Ian Campbell
2015-06-01 17:24 ` [PATCH 2/2] libxl: clean up qemu-save and qemu-resume files Wei Liu
2015-06-03  9:58   ` Ian Campbell
2015-06-03 10:11     ` Wei Liu
2015-06-03 10:22     ` Wei Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150603102226.GA12468@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.