[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xl: main_blockdetach don't call destroy if remove succeeds
# HG changeset patch # User Roger Pau Monne <roger.pau@xxxxxxxxxx> # Date 1343295333 -3600 # Node ID c93f602084ccb26cdf9ff60056c5ffa88d45729d # Parent 4de762a22f54870da9fe7afd3850b89ca76014fb xl: main_blockdetach don't call destroy if remove succeeds xl was calling libxl_device_disk_destroy after a successful call to libxl_device_disk_remove, which leads to an error. Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- diff -r 4de762a22f54 -r c93f602084cc tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Thu Jul 26 10:35:32 2012 +0100 +++ b/tools/libxl/xl_cmdimpl.c Thu Jul 26 10:35:33 2012 +0100 @@ -5398,7 +5398,7 @@ int main_blocklist(int argc, char **argv int main_blockdetach(int argc, char **argv) { - int opt; + int opt, rc = 0; libxl_device_disk disk; if ((opt = def_getopt(argc, argv, "", "block-detach", 2)) != -1) @@ -5412,11 +5412,12 @@ int main_blockdetach(int argc, char **ar fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]); return 1; } - if (libxl_device_disk_remove(ctx, domid, &disk, 0)) { + rc = libxl_device_disk_remove(ctx, domid, &disk, 0); + if (rc) { fprintf(stderr, "libxl_device_disk_remove failed.\n"); - } else - libxl_device_disk_destroy(ctx, domid, &disk, 0); - return 0; + } + libxl_device_disk_dispose(&disk); + return rc; } static char *uptime_to_string(unsigned long time, int short_mode) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |