]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
xl: destroy the disk on successful removal during block-detach
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 29 May 2012 15:36:53 +0000 (16:36 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 29 May 2012 15:36:53 +0000 (16:36 +0100)
main_blockdetach needs to call libxl_device_disk_destroy so that all the
disk related entries are properly removed from xenstore.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/xl_cmdimpl.c

index 259b06548798fca78831eba31f0147701e2c5217..040cefcc35d15dcf3b94ef7a537c9925612e8065 100644 (file)
@@ -5405,7 +5405,8 @@ 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);
     return 0;
 }