WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 02/14]: libxenlight, disk and nic destroy calls

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 02/14]: libxenlight, disk and nic destroy calls
From: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
Date: Mon, 30 Nov 2009 14:10:21 -0500
Cc:
Delivery-date: Mon, 30 Nov 2009 11:11:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Expose disk and nic device destroy calls, to allow
hot unplugging of devices from domains.

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

# HG changeset patch
# User Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
# Date 1259038343 18000
# Node ID 4c8563c26642159a6bd7bbb356826c0e7e96534f
# Parent  67d997a4d4c87d739b4d29b301a4ba727563ca9e
Expose disk and nic device destroy calls, to allow
hot unplugging of devices from domains. 

Signed-off-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>

diff -r 67d997a4d4c8 -r 4c8563c26642 libxl.c
--- a/libxl.c
+++ b/libxl.c
@@ -934,6 +934,23 @@ int libxl_device_disk_add(struct libxl_c
     return 0;
 }
 
+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);
+}
+
 int libxl_device_disk_clean_shutdown(struct libxl_ctx *ctx, uint32_t domid)
 {
     return ERROR_NI;
@@ -1007,6 +1024,21 @@ int libxl_device_nic_add(struct libxl_ct
     return 0;
 }
 
+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);
+}
+
 int libxl_device_nic_clean_shutdown(struct libxl_ctx *ctx, uint32_t domid)
 {
     return ERROR_NI;
diff -r 67d997a4d4c8 -r 4c8563c26642 libxl.h
--- a/libxl.h
+++ b/libxl.h
@@ -288,10 +288,12 @@ 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_del(struct libxl_ctx *ctx, libxl_device_disk *disk, int 
wait);
 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_nic_add(struct libxl_ctx *ctx, uint32_t domid, 
libxl_device_nic *nic);
+int libxl_device_nic_del(struct libxl_ctx *ctx, libxl_device_nic *nic, int 
wait);
 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);
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 02/14]: libxenlight, disk and nic destroy calls, Andres Lagar-Cavilla <=