# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259910407 0
# Node ID 6b6b4a2cc98ef2fdba13329faa4319dcb9b58cb4
# Parent d23501e8efa2979d0deb903253b5534dfe81b669
libxenlight: disk and nic destroy calls
Expose disk and nic device destroy calls
Also removes the obsolete device shutdown calls.
Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
---
tools/libxl/libxl.c | 44 ++++++++++++++++++++++++++++----------------
tools/libxl/libxl.h | 6 ++----
2 files changed, 30 insertions(+), 20 deletions(-)
diff -r d23501e8efa2 -r 6b6b4a2cc98e tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Fri Dec 04 07:03:45 2009 +0000
+++ b/tools/libxl/libxl.c Fri Dec 04 07:06:47 2009 +0000
@@ -1123,14 +1123,21 @@ int libxl_device_disk_add(struct libxl_c
return 0;
}
-int libxl_device_disk_clean_shutdown(struct libxl_ctx *ctx, uint32_t domid)
-{
- return ERROR_NI;
-}
-
-int libxl_device_disk_hard_shutdown(struct libxl_ctx *ctx, uint32_t domid)
-{
- return ERROR_NI;
+int libxl_device_disk_del(struct libxl_ctx *ctx,
+ libxl_device_disk *disk, int wait)
+{
+ libxl_device device;
+ int devid;
+
+ devid = device_disk_dev_number(disk->virtpath);
+ device.backend_domid = disk->backend_domid;
+ device.backend_devid = devid;
+ device.backend_kind =
+ (disk->phystype == PHYSTYPE_PHY) ? DEVICE_VBD : DEVICE_TAP;
+ device.domid = disk->domid;
+ device.devid = devid;
+ device.kind = DEVICE_VBD;
+ return libxl_device_del(ctx, &device, wait);
}
/******************************************************************************/
@@ -1196,14 +1203,19 @@ int libxl_device_nic_add(struct libxl_ct
return 0;
}
-int libxl_device_nic_clean_shutdown(struct libxl_ctx *ctx, uint32_t domid)
-{
- return ERROR_NI;
-}
-
-int libxl_device_nic_hard_shutdown(struct libxl_ctx *ctx, uint32_t domid)
-{
- return ERROR_NI;
+int libxl_device_nic_del(struct libxl_ctx *ctx,
+ libxl_device_nic *nic, int wait)
+{
+ libxl_device device;
+
+ device.backend_devid = nic->devid;
+ device.backend_domid = nic->backend_domid;
+ device.backend_kind = DEVICE_VIF;
+ device.devid = nic->devid;
+ device.domid = nic->domid;
+ device.kind = DEVICE_VIF;
+
+ return libxl_device_del(ctx, &device, wait);
}
/******************************************************************************/
diff -r d23501e8efa2 -r 6b6b4a2cc98e tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Fri Dec 04 07:03:45 2009 +0000
+++ b/tools/libxl/libxl.h Fri Dec 04 07:06:47 2009 +0000
@@ -295,12 +295,10 @@ int libxl_detach_device_model(struct lib
/* DM is detached even if error is returned */
int libxl_device_disk_add(struct libxl_ctx *ctx, uint32_t domid,
libxl_device_disk *disk);
-int libxl_device_disk_clean_shutdown(struct libxl_ctx *ctx, uint32_t domid);
-int libxl_device_disk_hard_shutdown(struct libxl_ctx *ctx, uint32_t domid);
+int libxl_device_disk_del(struct libxl_ctx *ctx, libxl_device_disk *disk, int
wait);
int libxl_device_nic_add(struct libxl_ctx *ctx, uint32_t domid,
libxl_device_nic *nic);
-int libxl_device_nic_clean_shutdown(struct libxl_ctx *ctx, uint32_t domid);
-int libxl_device_nic_hard_shutdown(struct libxl_ctx *ctx, uint32_t domid);
+int libxl_device_nic_del(struct libxl_ctx *ctx, libxl_device_nic *nic, int
wait);
int libxl_device_console_add(struct libxl_ctx *ctx, uint32_t domid,
libxl_device_console *console);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|