aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxen
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2007-03-08 23:47:24 +0000
committerEwan Mellor <ewan@xensource.com>2007-03-08 23:47:24 +0000
commit9e92a72fb5e29900dd1bc57cf0592d916a03a109 (patch)
tree14ffcbb484f3d0bb188d6f5afaffeba0d1255a76 /tools/libxen
parent5579ba52ec6f1db9497e03edd80d440460c3c55d (diff)
downloadxen-9e92a72fb5e29900dd1bc57cf0592d916a03a109.tar.gz
xen-9e92a72fb5e29900dd1bc57cf0592d916a03a109.tar.bz2
xen-9e92a72fb5e29900dd1bc57cf0592d916a03a109.zip
Added {VIF,VBD}.{plug,unplug} methods. Docs and C bindings -- Xend to follow.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen')
-rw-r--r--tools/libxen/include/xen_vbd.h16
-rw-r--r--tools/libxen/include/xen_vif.h16
-rw-r--r--tools/libxen/src/xen_vbd.c28
-rw-r--r--tools/libxen/src/xen_vif.c28
4 files changed, 88 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_vbd.h b/tools/libxen/include/xen_vbd.h
index 86ad38f207..7b36266a04 100644
--- a/tools/libxen/include/xen_vbd.h
+++ b/tools/libxen/include/xen_vbd.h
@@ -358,6 +358,22 @@ xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi);
/**
+ * Hotplug the specified VBD, dynamically attaching it to the running
+ * VM
+ */
+extern bool
+xen_vbd_plug(xen_session *session, xen_vbd self);
+
+
+/**
+ * Hot-unplug the specified VBD, dynamically unattaching it from the
+ * running VM
+ */
+extern bool
+xen_vbd_unplug(xen_session *session, xen_vbd self);
+
+
+/**
* Return a list of all the VBDs known to the system.
*/
extern bool
diff --git a/tools/libxen/include/xen_vif.h b/tools/libxen/include/xen_vif.h
index 05a070aff4..8a1cffb7bd 100644
--- a/tools/libxen/include/xen_vif.h
+++ b/tools/libxen/include/xen_vif.h
@@ -332,6 +332,22 @@ xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char
/**
+ * Hotplug the specified VIF, dynamically attaching it to the running
+ * VM
+ */
+extern bool
+xen_vif_plug(xen_session *session, xen_vif self);
+
+
+/**
+ * Hot-unplug the specified VIF, dynamically unattaching it from the
+ * running VM
+ */
+extern bool
+xen_vif_unplug(xen_session *session, xen_vif self);
+
+
+/**
* Return a list of all the VIFs known to the system.
*/
extern bool
diff --git a/tools/libxen/src/xen_vbd.c b/tools/libxen/src/xen_vbd.c
index def7403ef9..300f1d857d 100644
--- a/tools/libxen/src/xen_vbd.c
+++ b/tools/libxen/src/xen_vbd.c
@@ -552,6 +552,34 @@ xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi)
bool
+xen_vbd_plug(xen_session *session, xen_vbd self)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = self }
+ };
+
+ xen_call_(session, "VBD.plug", param_values, 1, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_vbd_unplug(xen_session *session, xen_vbd self)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = self }
+ };
+
+ xen_call_(session, "VBD.unplug", param_values, 1, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result)
{
diff --git a/tools/libxen/src/xen_vif.c b/tools/libxen/src/xen_vif.c
index 11cba1dcbd..a139a83bc3 100644
--- a/tools/libxen/src/xen_vif.c
+++ b/tools/libxen/src/xen_vif.c
@@ -500,6 +500,34 @@ xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char
bool
+xen_vif_plug(xen_session *session, xen_vif self)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = self }
+ };
+
+ xen_call_(session, "VIF.plug", param_values, 1, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_vif_unplug(xen_session *session, xen_vif self)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = self }
+ };
+
+ xen_call_(session, "VIF.unplug", param_values, 1, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
xen_vif_get_all(xen_session *session, struct xen_vif_set **result)
{