|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: make libxl_device_disk_local_attach/detach internal functions
# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1338305805 -3600
# Node ID a3d2d22c5f5548c12cf76f0105c760d609cc605e
# Parent 52ffce7a036e88a09207cf0e372f8c95f0331b53
libxl: make libxl_device_disk_local_attach/detach internal functions
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
diff -r 52ffce7a036e -r a3d2d22c5f55 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Tue May 29 11:36:36 2012 +0100
+++ b/tools/libxl/libxl.c Tue May 29 16:36:45 2012 +0100
@@ -1735,9 +1735,9 @@ out:
return ret;
}
-char * libxl_device_disk_local_attach(libxl_ctx *ctx, libxl_device_disk *disk)
+char * libxl__device_disk_local_attach(libxl__gc *gc, libxl_device_disk *disk)
{
- GC_INIT(ctx);
+ libxl_ctx *ctx = gc->owner;
char *dev = NULL;
char *ret = NULL;
int rc;
@@ -1792,11 +1792,10 @@ char * libxl_device_disk_local_attach(li
out:
if (dev != NULL)
ret = strdup(dev);
- GC_FREE;
return ret;
}
-int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk)
+int libxl__device_disk_local_detach(libxl__gc *gc, libxl_device_disk *disk)
{
/* Nothing to do for PHYSTYPE_PHY. */
@@ -1804,10 +1803,6 @@ int libxl_device_disk_local_detach(libxl
* For other device types assume that the blktap2 process is
* needed by the soon to be started domain and do nothing.
*/
- /*
- * FIXME
- * This appears to leak the disk in failure paths
- */
return 0;
}
diff -r 52ffce7a036e -r a3d2d22c5f55 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Tue May 29 11:36:36 2012 +0100
+++ b/tools/libxl/libxl.h Tue May 29 16:36:45 2012 +0100
@@ -654,13 +654,6 @@ int libxl_device_disk_getinfo(libxl_ctx
*/
int libxl_cdrom_insert(libxl_ctx *ctx, uint32_t domid, libxl_device_disk
*disk);
-/*
- * Make a disk available in this (the control) domain. Returns path to
- * a device.
- */
-char * libxl_device_disk_local_attach(libxl_ctx *ctx, libxl_device_disk *disk);
-int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
-
/* Network Interfaces */
int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic
*nic);
int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
diff -r 52ffce7a036e -r a3d2d22c5f55 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c Tue May 29 11:36:36 2012 +0100
+++ b/tools/libxl/libxl_bootloader.c Tue May 29 16:36:45 2012 +0100
@@ -225,7 +225,7 @@ static void bootloader_cleanup(libxl__eg
if (bl->outputdir) libxl__remove_directory(gc, bl->outputdir);
if (bl->diskpath) {
- libxl_device_disk_local_detach(CTX, bl->disk);
+ libxl__device_disk_local_detach(gc, bl->disk);
free(bl->diskpath);
bl->diskpath = 0;
}
@@ -344,7 +344,7 @@ void libxl__bootloader_run(libxl__egc *e
goto out;
}
- bl->diskpath = libxl_device_disk_local_attach(CTX, bl->disk);
+ bl->diskpath = libxl__device_disk_local_attach(gc, bl->disk);
if (!bl->diskpath) {
rc = ERROR_FAIL;
goto out;
diff -r 52ffce7a036e -r a3d2d22c5f55 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Tue May 29 11:36:36 2012 +0100
+++ b/tools/libxl/libxl_internal.h Tue May 29 16:36:45 2012 +0100
@@ -1278,6 +1278,15 @@ _hidden char *libxl__blktap_devpath(libx
*/
_hidden void libxl__device_destroy_tapdisk(libxl__gc *gc, char *be_path);
+/*
+ * Make a disk available in this (the control) domain. Returns path to
+ * a device.
+ */
+_hidden char * libxl__device_disk_local_attach(libxl__gc *gc,
+ libxl_device_disk *disk);
+_hidden int libxl__device_disk_local_detach(libxl__gc *gc,
+ libxl_device_disk *disk);
+
_hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
struct libxl__xen_console_reader {
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |