ia64/xen-unstable
changeset 14792:e8caf7802f3f
Added docs and bindings for VM.{send_trigger,send_sysrq}.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author | Ewan Mellor <ewan@xensource.com> |
---|---|
date | Tue Apr 10 17:29:16 2007 +0100 (2007-04-10) |
parents | dbeabe1d225c |
children | 4dc14c591e6c |
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 Tue Apr 10 17:26:45 2007 +0100 1.2 +++ b/docs/xen-api/xenapi-datamodel.tex Tue Apr 10 17:29:16 2007 +0100 1.3 @@ -1558,6 +1558,81 @@ void 1.4 \vspace{0.3cm} 1.5 \vspace{0.3cm} 1.6 \vspace{0.3cm} 1.7 +\subsubsection{RPC name:~send\_sysrq} 1.8 + 1.9 +{\bf Overview:} 1.10 +Send the given key as a sysrq to this VM. The key is specified as a single 1.11 +character (a String of length 1). This can only be called when the 1.12 +specified VM is in the Running state. 1.13 + 1.14 + \noindent {\bf Signature:} 1.15 +\begin{verbatim} void send_sysrq (session_id s, VM ref vm, string key)\end{verbatim} 1.16 + 1.17 + 1.18 +\noindent{\bf Arguments:} 1.19 + 1.20 + 1.21 +\vspace{0.3cm} 1.22 +\begin{tabular}{|c|c|p{7cm}|} 1.23 + \hline 1.24 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.25 +{\tt VM ref } & vm & The VM \\ \hline 1.26 + 1.27 +{\tt string } & key & The key to send \\ \hline 1.28 + 1.29 +\end{tabular} 1.30 + 1.31 +\vspace{0.3cm} 1.32 + 1.33 + \noindent {\bf Return Type:} 1.34 +{\tt 1.35 +void 1.36 +} 1.37 + 1.38 + 1.39 + 1.40 +\vspace{0.3cm} 1.41 + 1.42 +\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE} 1.43 + 1.44 +\vspace{0.6cm} 1.45 +\subsubsection{RPC name:~send\_trigger} 1.46 + 1.47 +{\bf Overview:} 1.48 +Send the named trigger to this VM. This can only be called when the 1.49 +specified VM is in the Running state. 1.50 + 1.51 + \noindent {\bf Signature:} 1.52 +\begin{verbatim} void send_trigger (session_id s, VM ref vm, string trigger)\end{verbatim} 1.53 + 1.54 + 1.55 +\noindent{\bf Arguments:} 1.56 + 1.57 + 1.58 +\vspace{0.3cm} 1.59 +\begin{tabular}{|c|c|p{7cm}|} 1.60 + \hline 1.61 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.62 +{\tt VM ref } & vm & The VM \\ \hline 1.63 + 1.64 +{\tt string } & trigger & The trigger to send \\ \hline 1.65 + 1.66 +\end{tabular} 1.67 + 1.68 +\vspace{0.3cm} 1.69 + 1.70 + \noindent {\bf Return Type:} 1.71 +{\tt 1.72 +void 1.73 +} 1.74 + 1.75 + 1.76 + 1.77 +\vspace{0.3cm} 1.78 + 1.79 +\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE} 1.80 + 1.81 +\vspace{0.6cm} 1.82 \subsubsection{RPC name:~get\_all} 1.83 1.84 {\bf Overview:}
2.1 --- a/tools/libxen/include/xen_vm.h Tue Apr 10 17:26:45 2007 +0100 2.2 +++ b/tools/libxen/include/xen_vm.h Tue Apr 10 17:29:16 2007 +0100 2.3 @@ -838,6 +838,23 @@ xen_vm_set_vcpus_number_live(xen_session 2.4 2.5 2.6 /** 2.7 + * Send the given key as a sysrq to this VM. The key is specified as a 2.8 + * single character (a String of length 1). This can only be called when the 2.9 + * specified VM is in the Running state. 2.10 + */ 2.11 +extern bool 2.12 +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key); 2.13 + 2.14 + 2.15 +/** 2.16 + * Send the named trigger to this VM. This can only be called when the 2.17 + * specified VM is in the Running state. 2.18 + */ 2.19 +extern bool 2.20 +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger); 2.21 + 2.22 + 2.23 +/** 2.24 * Return a list of all the VMs known to the system. 2.25 */ 2.26 extern bool
3.1 --- a/tools/libxen/src/xen_vm.c Tue Apr 10 17:26:45 2007 +0100 3.2 +++ b/tools/libxen/src/xen_vm.c Tue Apr 10 17:29:16 2007 +0100 3.3 @@ -1610,6 +1610,38 @@ xen_vm_set_vcpus_number_live(xen_session 3.4 3.5 3.6 bool 3.7 +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key) 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 = key } 3.15 + }; 3.16 + 3.17 + xen_call_(session, "VM.send_sysrq", param_values, 2, NULL, NULL); 3.18 + return session->ok; 3.19 +} 3.20 + 3.21 + 3.22 +bool 3.23 +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger) 3.24 +{ 3.25 + abstract_value param_values[] = 3.26 + { 3.27 + { .type = &abstract_type_string, 3.28 + .u.string_val = vm }, 3.29 + { .type = &abstract_type_string, 3.30 + .u.string_val = trigger } 3.31 + }; 3.32 + 3.33 + xen_call_(session, "VM.send_trigger", param_values, 2, NULL, NULL); 3.34 + return session->ok; 3.35 +} 3.36 + 3.37 + 3.38 +bool 3.39 xen_vm_get_all(xen_session *session, struct xen_vm_set **result) 3.40 { 3.41