aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/xen-api/xenapi-datamodel.tex41
-rw-r--r--tools/libxen/include/xen_vm.h8
-rw-r--r--tools/libxen/src/xen_vm.c20
3 files changed, 69 insertions, 0 deletions
diff --git a/docs/xen-api/xenapi-datamodel.tex b/docs/xen-api/xenapi-datamodel.tex
index 39055b8d89..78cc917a6e 100644
--- a/docs/xen-api/xenapi-datamodel.tex
+++ b/docs/xen-api/xenapi-datamodel.tex
@@ -1738,6 +1738,47 @@ void
\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
\vspace{0.6cm}
+\subsubsection{RPC name:~migrate}
+
+{\bf Overview:}
+Migrate the VM to another host. This can only be called when the specified
+VM is in the Running state.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void migrate (session_id s, VM ref vm, string dest, bool live, (string -> string) Map options)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & vm & The VM \\ \hline
+
+{\tt string } & dest & The destination host \\ \hline
+
+{\tt bool } & live & Live migration \\ \hline
+
+{\tt (string $\rightarrow$ string) Map } & options & Other parameters \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+
+\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
+
+\vspace{0.6cm}
\subsubsection{RPC name:~get\_all}
{\bf Overview:}
diff --git a/tools/libxen/include/xen_vm.h b/tools/libxen/include/xen_vm.h
index 54abe1ba82..d33f31b860 100644
--- a/tools/libxen/include/xen_vm.h
+++ b/tools/libxen/include/xen_vm.h
@@ -877,6 +877,14 @@ xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
/**
+ * Migrate the VM to another host. This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
+
+
+/**
* Return a list of all the VMs known to the system.
*/
extern bool
diff --git a/tools/libxen/src/xen_vm.c b/tools/libxen/src/xen_vm.c
index 6f88a9239a..d2a4309a0d 100644
--- a/tools/libxen/src/xen_vm.c
+++ b/tools/libxen/src/xen_vm.c
@@ -1692,6 +1692,26 @@ xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger)
bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_string,
+ .u.string_val = dest },
+ { .type = &abstract_type_bool,
+ .u.bool_val = live },
+ { .type = &abstract_type_string_string_map,
+ .u.set_val = (arbitrary_set *)options }
+ };
+
+ xen_call_(session, "VM.migrate", param_values, 4, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
xen_vm_get_all(xen_session *session, struct xen_vm_set **result)
{