ia64/xen-unstable

changeset 14868:765ac13f425b

Added documentation and C bindings for VM.migrate call.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author ewan@localhost.localdomain
date Mon Apr 16 16:12:33 2007 -0400 (2007-04-16)
parents ed29a1d721f8
children 66242baf79b1
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_vm.h tools/libxen/src/xen_vm.c
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Mon Apr 16 16:10:39 2007 -0400
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Mon Apr 16 16:12:33 2007 -0400
     1.3 @@ -1738,6 +1738,47 @@ void
     1.4  \noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
     1.5  
     1.6  \vspace{0.6cm}
     1.7 +\subsubsection{RPC name:~migrate}
     1.8 +
     1.9 +{\bf Overview:} 
    1.10 +Migrate the VM to another host.  This can only be called when the specified
    1.11 +VM is in the Running state.
    1.12 +
    1.13 + \noindent {\bf Signature:} 
    1.14 +\begin{verbatim} void migrate (session_id s, VM ref vm, string dest, bool live, (string -> string) Map options)\end{verbatim}
    1.15 +
    1.16 +
    1.17 +\noindent{\bf Arguments:}
    1.18 +
    1.19 + 
    1.20 +\vspace{0.3cm}
    1.21 +\begin{tabular}{|c|c|p{7cm}|}
    1.22 + \hline
    1.23 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.24 +{\tt VM ref } & vm & The VM \\ \hline 
    1.25 +
    1.26 +{\tt string } & dest & The destination host \\ \hline 
    1.27 +
    1.28 +{\tt bool } & live & Live migration \\ \hline 
    1.29 +
    1.30 +{\tt (string $\rightarrow$ string) Map } & options & Other parameters \\ \hline 
    1.31 +
    1.32 +\end{tabular}
    1.33 +
    1.34 +\vspace{0.3cm}
    1.35 +
    1.36 + \noindent {\bf Return Type:} 
    1.37 +{\tt 
    1.38 +void
    1.39 +}
    1.40 +
    1.41 +
    1.42 +
    1.43 +\vspace{0.3cm}
    1.44 +
    1.45 +\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
    1.46 +
    1.47 +\vspace{0.6cm}
    1.48  \subsubsection{RPC name:~get\_all}
    1.49  
    1.50  {\bf Overview:} 
     2.1 --- a/tools/libxen/include/xen_vm.h	Mon Apr 16 16:10:39 2007 -0400
     2.2 +++ b/tools/libxen/include/xen_vm.h	Mon Apr 16 16:12:33 2007 -0400
     2.3 @@ -877,6 +877,14 @@ xen_vm_send_trigger(xen_session *session
     2.4  
     2.5  
     2.6  /**
     2.7 + * Migrate the VM to another host.  This can only be called when the
     2.8 + * specified VM is in the Running state.
     2.9 + */
    2.10 +extern bool
    2.11 +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
    2.12 +
    2.13 +
    2.14 +/**
    2.15   * Return a list of all the VMs known to the system.
    2.16   */
    2.17  extern bool
     3.1 --- a/tools/libxen/src/xen_vm.c	Mon Apr 16 16:10:39 2007 -0400
     3.2 +++ b/tools/libxen/src/xen_vm.c	Mon Apr 16 16:12:33 2007 -0400
     3.3 @@ -1692,6 +1692,26 @@ xen_vm_send_trigger(xen_session *session
     3.4  
     3.5  
     3.6  bool
     3.7 +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options)
     3.8 +{
     3.9 +    abstract_value param_values[] =
    3.10 +        {
    3.11 +            { .type = &abstract_type_string,
    3.12 +              .u.string_val = vm },
    3.13 +            { .type = &abstract_type_string,
    3.14 +              .u.string_val = dest },
    3.15 +            { .type = &abstract_type_bool,
    3.16 +              .u.bool_val = live },
    3.17 +            { .type = &abstract_type_string_string_map,
    3.18 +              .u.set_val = (arbitrary_set *)options }
    3.19 +        };
    3.20 +
    3.21 +    xen_call_(session, "VM.migrate", param_values, 4, NULL, NULL);
    3.22 +    return session->ok;
    3.23 +}
    3.24 +
    3.25 +
    3.26 +bool
    3.27  xen_vm_get_all(xen_session *session, struct xen_vm_set **result)
    3.28  {
    3.29