All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andres Lagar-Cavilla <andres@lagarcavilla.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Vincent Hanquez <vincent.hanquez@eu.citrix.com>,
	xen-devel@lists.xensource.com
Subject: [PATCH 2/7] libxenlight resend: disc and nic destroy calls
Date: Wed, 02 Dec 2009 12:59:40 -0500	[thread overview]
Message-ID: <4B16AB0C.6080601@lagarcavilla.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

Expose disk and nic device destroy calls, to allow
hot unplugging of devices from domains.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>


[-- Attachment #2: 02_nic_disk_destroy.patch --]
[-- Type: text/plain, Size: 2697 bytes --]

# HG changeset patch
# User Andres Lagar-Cavilla <andres@lagarcavilla.com>
# Date 1259038343 18000
# Node ID 70f6966c89bf7f2c1db78a814452e1de79044962
# Parent  68b17d151db6c9a31ca55c359742f0d3515a0a5a
Expose disk and nic device destroy calls, to allow
hot unplugging of devices from domains.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>

diff -r 68b17d151db6 -r 70f6966c89bf libxl.c
--- a/libxl.c
+++ b/libxl.c
@@ -1111,6 +1111,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;
@@ -1184,6 +1201,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 68b17d151db6 -r 70f6966c89bf libxl.h
--- a/libxl.h
+++ b/libxl.h
@@ -295,10 +295,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);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2009-12-02 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 17:59 Andres Lagar-Cavilla [this message]
2009-12-03 12:29 ` [PATCH 2/7] libxenlight resend: disc and nic destroy calls Stefano Stabellini
2009-12-03 17:04 ` [PATCH 2/7] libxenlight meta-resend: disk " Andres Lagar-Cavilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B16AB0C.6080601@lagarcavilla.com \
    --to=andres@lagarcavilla.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=vincent.hanquez@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.