From: Ian Campbell Subject: Re: [PATCH v10 19/19] xl: main_blockdetach don't call destroy if remove succeeds Date: Fri, 20 Jul 2012 15:55:55 +0100 Message-ID: <1342796155.26734.119.camel@zakaz.uk.xensource.com> References: <1342793548-10239-1-git-send-email-roger.pau@citrix.com> <1342793548-10239-20-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1342793548-10239-20-git-send-email-roger.pau@citrix.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: Roger Pau Monne Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Fri, 2012-07-20 at 15:12 +0100, Roger Pau Monne wrote: > xl was calling libxl_device_disk_destroy after a successful call to > libxl_device_disk_remove, which leads to an error. > > Cc: Ian Jackson > Signed-off-by: Roger Pau Monne > --- > tools/libxl/xl_cmdimpl.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > index 1371458..d68bac3 100644 > --- a/tools/libxl/xl_cmdimpl.c > +++ b/tools/libxl/xl_cmdimpl.c > @@ -5416,8 +5416,7 @@ int main_blockdetach(int argc, char **argv) > } > if (libxl_device_disk_remove(ctx, domid, &disk, 0)) { > fprintf(stderr, "libxl_device_disk_remove failed.\n"); > - } else > - libxl_device_disk_destroy(ctx, domid, &disk, 0); > + } Somebody should probably be calling dispose on the disk here, unconditionally. dispose used to be called destroy so that might be where the confusion arose? Ian.