From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Marek Marczykowski <marmarek@mimuw.edu.pl>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 01 of 10] libxl: Remove frontend and backend devices from xenstore after destroy
Date: Sat, 4 Jun 2011 07:46:35 +0100 [thread overview]
Message-ID: <1307169995.20673.2.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <4DE96E90.2020007@mimuw.edu.pl>
On Sat, 2011-06-04 at 00:30 +0100, Marek Marczykowski wrote:
> On 03.06.2011 10:03, Ian Campbell wrote:
> > Hi Marek,
> >
> > Please can you add:
> > [diff]
> > showfunc = True
> > to your ~/.hgrc. It makes patches much easier to read.
> >
> > On Thu, 2011-06-02 at 23:35 +0100, Marek Marczykowski wrote:
> >> # HG changeset patch
> >> # User Marek Marczykowski <marmarek@mimuw.edu.pl>
> >> # Date 1306962865 -7200
> >> # Node ID e3a3f5cc95349e92b7cb8b1448e999ffc16bd060
> >> # Parent 43acc031eb24945973dffda2b7caf976993bbd5f
> >> libxl: Remove frontend and backend devices from xenstore after destroy
> >>
> >> Cleanup frontend and backend devices from xenstore for all dev types - not only
> >> disks.
> >>
> >> Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
> >
> > Thanks!
> >
> > The whole device destroy/teardown path is a bit of a twisty maze of
> > confusingly named functions and parameters (e.g. force == !wait, destroy
> > vs delete vs remove etc). Any attempt to try and untangle things is most
> > welcome and I think this is a step in the right direction.
> >
> >>
> >> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> >> --- a/tools/libxl/libxl.c
> >> +++ b/tools/libxl/libxl.c
> >> @@ -1065,8 +1065,6 @@
> >> device.devid = devid;
> >> device.kind = DEVICE_VBD;
> >> rc = libxl__device_del(ctx, &device, wait);
> >> - xs_rm(ctx->xsh, XBT_NULL, libxl__device_backend_path(&gc, &device));
> >> - xs_rm(ctx->xsh, XBT_NULL, libxl__device_frontend_path(&gc, &device));
> >> libxl__free_all(&gc);
> >> return rc;
> >> }
> >> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> >> --- a/tools/libxl/libxl_device.c
> >> +++ b/tools/libxl/libxl_device.c
> >> @@ -401,6 +401,8 @@
> >> (void)wait_for_dev_destroy(ctx, &tv);
> >> }
> >>
> >> + xs_rm(ctx->xsh, XBT_NULL, libxl__device_backend_path(&gc, dev));
> >> + xs_rm(ctx->xsh, XBT_NULL, libxl__device_frontend_path(&gc, dev));
> >
> > In the case where wait == true libxl__device_destroy will add a watch on
> > the be path and wait_for_dev_destroy will subsequently remove the path.
>
> Only backend one...
>
> > I think it would be better to add the xs_rm for be path to
> > libxl__device_destroy as the else clause to the !force which adds the
> > watch?
>
> Also - only backend one (libxl__device_destroy gets only backend path as
> parameter).
>
> > I think this allow the other caller (libxl__devices_destroy) to
> > be simplified too since all that mucking around with the toremove
> > flexarray could be dropped.
>
> What about frontend device in xenstore? In most cases only backend is
> removed. In wait_for_dev_destroy we don't know frontend patch (wheel,
> not exactly true, but not always easy). Perhaps there should be two
> watches - on backend AND on frontend (with writing "5" to frontend state
> also?)? Or backend should be removed as you suggested, but frontend as
> in my patch (after wait_for_dev_destroy if was called)?
My comments were only about the location of the rm of the backend path.
I think your original patch moved the rm of the frontend path to the
right place.
an.
next prev parent reply other threads:[~2011-06-04 6:46 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 22:35 [PATCH 00 of 10] A bunch of fixes (and one feature) for libxl Marek Marczykowski
2011-06-02 22:35 ` [PATCH 01 of 10] libxl: Remove frontend and backend devices from xenstore after destroy Marek Marczykowski
2011-06-03 8:03 ` Ian Campbell
2011-06-03 23:30 ` Marek Marczykowski
2011-06-04 6:46 ` Ian Campbell [this message]
2011-06-02 22:35 ` [PATCH 02 of 10] libxl: Do not start stubdom when not needed Marek Marczykowski
2011-06-03 8:03 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 03 of 10] libxl: Accept disk name in libxl_devid_to_device_disk Marek Marczykowski
2011-06-03 8:08 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 04 of 10] libxl: Allocate memory for strings in libxl_device_disk Marek Marczykowski
2011-06-03 8:10 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 05 of 10] libxl: Set libxl_device_nic->domid when looking up by devid Marek Marczykowski
2011-06-03 8:11 ` Ian Campbell
2011-06-03 23:24 ` Marek Marczykowski
2011-06-04 6:47 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 06 of 10] xl: Allocate memory for libxl_device_nic string members Marek Marczykowski
2011-06-03 8:13 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 07 of 10] xl: Fix 'script' param parsing in network-attach Marek Marczykowski
2011-06-03 8:16 ` Ian Campbell
2011-06-03 23:49 ` Marek Marczykowski
2011-06-04 8:25 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 08 of 10] xen.lowlevel.xl: Return None on empty domain name Marek Marczykowski
2011-06-03 8:22 ` Ian Campbell
2011-06-02 22:35 ` [PATCH 09 of 10] libxl: Do not SEGV when no 'removable' disk parameter in xenstore Marek Marczykowski
2011-06-02 22:35 ` [PATCH 10 of 10] libxl: "script:" prefix in block device description to setup vbd by hotplug scripts Marek Marczykowski
2011-06-03 8:24 ` Ian Campbell
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=1307169995.20673.2.camel@dagon.hellion.org.uk \
--to=ian.campbell@eu.citrix.com \
--cc=marmarek@mimuw.edu.pl \
--cc=xen-devel@lists.xensource.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).