diff options
-rw-r--r-- | docs/xen-api/xenapi-datamodel.tex | 75 | ||||
-rw-r--r-- | tools/libxen/include/xen_vm.h | 17 | ||||
-rw-r--r-- | tools/libxen/src/xen_vm.c | 32 |
3 files changed, 124 insertions, 0 deletions
diff --git a/docs/xen-api/xenapi-datamodel.tex b/docs/xen-api/xenapi-datamodel.tex index b2784e234c..d152bcc469 100644 --- a/docs/xen-api/xenapi-datamodel.tex +++ b/docs/xen-api/xenapi-datamodel.tex @@ -1558,6 +1558,81 @@ void \vspace{0.3cm} \vspace{0.3cm} \vspace{0.3cm} +\subsubsection{RPC name:~send\_sysrq} + +{\bf Overview:} +Send the given key as a sysrq to this VM. The key is specified as a single +character (a String of length 1). This can only be called when the +specified VM is in the Running state. + + \noindent {\bf Signature:} +\begin{verbatim} void send_sysrq (session_id s, VM ref vm, string key)\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 } & key & The key to send \\ \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:~send\_trigger} + +{\bf Overview:} +Send the named trigger to this VM. This can only be called when the +specified VM is in the Running state. + + \noindent {\bf Signature:} +\begin{verbatim} void send_trigger (session_id s, VM ref vm, string trigger)\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 } & trigger & The trigger to send \\ \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 4b338088df..0f5c440c16 100644 --- a/tools/libxen/include/xen_vm.h +++ b/tools/libxen/include/xen_vm.h @@ -838,6 +838,23 @@ xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu); /** + * Send the given key as a sysrq to this VM. The key is specified as a + * single character (a String of length 1). This can only be called when the + * specified VM is in the Running state. + */ +extern bool +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key); + + +/** + * Send the named trigger to this VM. This can only be called when the + * specified VM is in the Running state. + */ +extern bool +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger); + + +/** * 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 c0ac17c9d5..5f5aa72b9a 100644 --- a/tools/libxen/src/xen_vm.c +++ b/tools/libxen/src/xen_vm.c @@ -1610,6 +1610,38 @@ xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu) bool +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vm }, + { .type = &abstract_type_string, + .u.string_val = key } + }; + + xen_call_(session, "VM.send_sysrq", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger) +{ + abstract_value param_values[] = + { + { .type = &abstract_type_string, + .u.string_val = vm }, + { .type = &abstract_type_string, + .u.string_val = trigger } + }; + + xen_call_(session, "VM.send_trigger", param_values, 2, NULL, NULL); + return session->ok; +} + + +bool xen_vm_get_all(xen_session *session, struct xen_vm_set **result) { |