From: Roger Pau Monne Subject: Re: [PATCH 5/5] libxl: clean xenstore console directories recursively on destroy Date: Mon, 16 Apr 2012 18:05:10 +0100 Message-ID: <86B21C60-CA21-4BE1-AD9F-C01EB7762282@citrix.com> References: <1334588804-7755-1-git-send-email-roger.pau@citrix.com> <1334588804-7755-6-git-send-email-roger.pau@citrix.com> <1334595019.14560.246.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <1334595019.14560.246.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org El 16/04/2012, a las 17:50, Ian Campbell escribi=F3: > On Mon, 2012-04-16 at 16:06 +0100, Roger Pau Monne wrote: >> Clean xenstore, to prevent leaving empty directories in the tree, like: >> = >> /local/domain/0/backend/console =3D "" (n0) >> /local/domain/0/backend/console/3 =3D "" (n0) >> = >> That was left after a guest was destroyed. >> = >> Signed-off-by: Roger Pau Monne >> --- >> tools/libxl/libxl_device.c | 5 ++--- >> 1 files changed, 2 insertions(+), 3 deletions(-) >> = >> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c >> index d773d71..4161d1bd 100644 >> --- a/tools/libxl/libxl_device.c >> +++ b/tools/libxl/libxl_device.c >> @@ -609,12 +609,11 @@ out_ok: >> = >> int libxl__device_destroy(libxl__gc *gc, libxl__device *dev) >> { >> - libxl_ctx *ctx =3D libxl__gc_owner(gc); >> char *be_path =3D libxl__device_backend_path(gc, dev); >> char *fe_path =3D libxl__device_frontend_path(gc, dev); >> = >> - xs_rm(ctx->xsh, XBT_NULL, be_path); >> - xs_rm(ctx->xsh, XBT_NULL, fe_path); >> + libxl__xs_path_cleanup(gc, fe_path); >> + libxl__xs_path_cleanup(gc, be_path); > = > is xs_rm not recursive? At least from the CLI it seems to be > = > quartz:~# xenstore-write /foo/bar/baz 123 > quartz:~# xenstore-ls -f | grep foo > /foo =3D "" > /foo/bar =3D "" > /foo/bar/baz =3D "123" > quartz:~# xenstore-rm /foo > quartz:~# xenstore-ls -f | grep foo > quartz:~# = > = > looking at xenstore_client.c it seems to only call xs_rm() and not do > any traversal itself? Sure! I had an error probably somewhere else in the code, and changing libx= l__xs_path_cleanup to xs_rm didn't make it happen again, so forget about th= is. I will send an updated version of the series without this stuff (and th= e appropriate changes). > = >> = >> libxl__device_destroy_tapdisk(gc, be_path); >> = > = > =