{\tt VDI} & A virtual disk image \\
{\tt VBD} & A virtual block device \\
{\tt PBD} & The physical block devices through which hosts access SRs \\
+{\tt crashdump} & A VM crashdump \\
{\tt VTPM} & A virtual TPM device \\
{\tt console} & A console \\
{\tt user} & A user of the system \\
host.PBDs & PBD.host & many-to-one\\
SR.PBDs & PBD.SR & many-to-one\\
VDI.VBDs & VBD.VDI & many-to-one\\
+VDI.crash\_dumps & crashdump.VDI & many-to-one\\
VBD.VM & VM.VBDs & one-to-many\\
+crashdump.VM & VM.crash\_dumps & one-to-many\\
VIF.VM & VM.VIFs & one-to-many\\
VIF.network & network.VIFs & one-to-many\\
PIF.metrics & PIF\_metrics.PIF & one-to-one\\
\hspace{0.5cm}{\tt system} & a disk that may be replaced on upgrade \\
\hspace{0.5cm}{\tt user} & a disk that is always preserved on upgrade \\
\hspace{0.5cm}{\tt ephemeral} & a disk that may be reformatted on upgrade \\
+\hspace{0.5cm}{\tt suspend} & a disk that stores a suspend image \\
+\hspace{0.5cm}{\tt crashdump} & a disk that stores VM crashdump information \\
\hline
\end{longtable}
$\mathit{RW}$ & {\tt user\_version} & int & a user version number for this machine \\
$\mathit{RW}$ & {\tt is\_a\_template} & bool & true if this is a template. Template VMs can never be started, they are used only for cloning other VMs \\
$\mathit{RW}$ & {\tt auto\_power\_on} & bool & true if this VM should be started automatically after host boot \\
+$\mathit{RO}_\mathit{run}$ & {\tt suspend\_VDI} & VDI ref & The VDI that a suspend image is stored on. (Only has meaning if VM is currently suspended) \\
$\mathit{RO}_\mathit{run}$ & {\tt resident\_on} & host ref & the host the VM is currently resident on \\
$\mathit{RO}_\mathit{ins}$ & {\tt memory/static\_max} & int & Statically-set (i.e. absolute) maximum (bytes) \\
$\mathit{RW}$ & {\tt memory/dynamic\_max} & int & Dynamic maximum (bytes) \\
$\mathit{RO}_\mathit{run}$ & {\tt consoles} & (console ref) Set & virtual console devices \\
$\mathit{RO}_\mathit{run}$ & {\tt VIFs} & (VIF ref) Set & virtual network interfaces \\
$\mathit{RO}_\mathit{run}$ & {\tt VBDs} & (VBD ref) Set & virtual block devices \\
+$\mathit{RO}_\mathit{run}$ & {\tt crash\_dumps} & (crashdump ref) Set & crash dumps associated with this VM \\
$\mathit{RO}_\mathit{run}$ & {\tt VTPMs} & (VTPM ref) Set & virtual TPMs \\
$\mathit{RW}$ & {\tt PV/bootloader} & string & name of or path to bootloader \\
$\mathit{RW}$ & {\tt PV/kernel} & string & path to the kernel \\
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_suspend\_VDI}
+
+{\bf Overview:}
+Get the suspend\_VDI field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VDI ref) get_suspend_VDI (session_id s, VM ref self)\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 } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VDI ref
+}
+
+
+value of the field
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_crash\_dumps}
+
+{\bf Overview:}
+Get the crash\_dumps field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} ((crashdump ref) Set) get_crash_dumps (session_id s, VM ref self)\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 } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+(crashdump ref) Set
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RO}_\mathit{run}$ & {\tt resident\_VMs} & (VM ref) Set & list of VMs currently resident on host \\
$\mathit{RW}$ & {\tt logging} & (string $\rightarrow$ string) Map & logging configuration \\
$\mathit{RO}_\mathit{run}$ & {\tt PIFs} & (PIF ref) Set & physical network interfaces \\
+$\mathit{RW}$ & {\tt suspend\_image\_sr} & SR ref & The SR in which VDIs for suspend images are created \\
+$\mathit{RW}$ & {\tt crash\_dump\_sr} & SR ref & The SR in which VDIs for crash dumps are created \\
$\mathit{RO}_\mathit{run}$ & {\tt PBDs} & (PBD ref) Set & physical blockdevices \\
$\mathit{RO}_\mathit{run}$ & {\tt host\_CPUs} & (host\_cpu ref) Set & The physical CPUs on this host \\
\hline
value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_suspend\_image\_sr}
+
+{\bf Overview:}
+Get the suspend\_image\_sr field of the given host.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (SR ref) get_suspend_image_sr (session_id s, host ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+SR ref
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~set\_suspend\_image\_sr}
+
+{\bf Overview:}
+Set the suspend\_image\_sr field of the given host.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void set_suspend_image_sr (session_id s, host ref self, SR ref value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline
+
+{\tt SR ref } & value & New value to set \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_crash\_dump\_sr}
+
+{\bf Overview:}
+Get the crash\_dump\_sr field of the given host.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (SR ref) get_crash_dump_sr (session_id s, host ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+SR ref
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~set\_crash\_dump\_sr}
+
+{\bf Overview:}
+Set the crash\_dump\_sr field of the given host.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void set_crash_dump_sr (session_id s, host ref self, SR ref value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline
+
+{\tt SR ref } & value & New value to set \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
$\mathit{RW}$ & {\tt name/description} & string & a notes field containg human-readable description \\
$\mathit{RW}$ & {\tt SR} & SR ref & storage repository in which the VDI resides \\
$\mathit{RO}_\mathit{run}$ & {\tt VBDs} & (VBD ref) Set & list of vbds that refer to this disk \\
+$\mathit{RO}_\mathit{run}$ & {\tt crash\_dumps} & (crashdump ref) Set & list of crash dumps that refer to this disk \\
$\mathit{RW}$ & {\tt virtual\_size} & int & size of disk as presented to the guest (in multiples of sector\_size field) \\
$\mathit{RO}_\mathit{run}$ & {\tt physical\_utilisation} & int & amount of physical space that the disk image is currently taking up on the storage repository (in bytes) \\
$\mathit{RO}_\mathit{ins}$ & {\tt sector\_size} & int & sector size of VDI (in bytes) \\
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_crash\_dumps}
+
+{\bf Overview:}
+Get the crash\_dumps field of the given VDI.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} ((crashdump ref) Set) get_crash_dumps (session_id s, VDI ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VDI ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+(crashdump ref) Set
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
}
+all fields from the object
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+
+\vspace{1cm}
+\newpage
+\section{Class: crashdump}
+\subsection{Fields for class: crashdump}
+\begin{longtable}{|lllp{0.38\textwidth}|}
+\hline
+\multicolumn{1}{|l}{Name} & \multicolumn{3}{l|}{\bf crashdump} \\
+\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em A
+VM crashdump.}} \\
+\hline
+Quals & Field & Type & Description \\
+\hline
+$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
+$\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & the virtual machine \\
+$\mathit{RO}_\mathit{ins}$ & {\tt VDI} & VDI ref & the virtual disk \\
+\hline
+\end{longtable}
+\subsection{Additional RPCs associated with class: crashdump}
+\subsubsection{RPC name:~get\_all}
+
+{\bf Overview:}
+Return a list of all the crashdumps known to the system.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} ((crashdump ref) Set) get_all (session_id s)\end{verbatim}
+
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+(crashdump ref) Set
+}
+
+
+references to all objects
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_uuid}
+
+{\bf Overview:}
+Get the uuid field of the given crashdump.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} string get_uuid (session_id s, crashdump ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt crashdump ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+string
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VM}
+
+{\bf Overview:}
+Get the VM field of the given crashdump.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VM ref) get_VM (session_id s, crashdump ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt crashdump ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VM ref
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VDI}
+
+{\bf Overview:}
+Get the VDI field of the given crashdump.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VDI ref) get_VDI (session_id s, crashdump ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt crashdump ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VDI ref
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~create}
+
+{\bf Overview:}
+Create a new crashdump instance, and return its handle.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (crashdump ref) create (session_id s, crashdump record args)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt crashdump record } & args & All constructor arguments \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+crashdump ref
+}
+
+
+reference to the newly created object
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~destroy}
+
+{\bf Overview:}
+Destroy the specified crashdump instance.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void destroy (session_id s, crashdump ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt crashdump ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_by\_uuid}
+
+{\bf Overview:}
+Get a reference to the crashdump instance with the specified UUID.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (crashdump ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt string } & uuid & UUID of object to return \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+crashdump ref
+}
+
+
+reference to the object
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_record}
+
+{\bf Overview:}
+Get a record containing the current state of the given crashdump.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (crashdump record) get_record (session_id s, crashdump ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt crashdump ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+crashdump record
+}
+
+
all fields from the object
\vspace{0.3cm}
\vspace{0.3cm}
\begin{longtable}{|lllp{0.38\textwidth}|}
\hline
\multicolumn{1}{|l}{Name} & \multicolumn{3}{l|}{\bf VTPM} \\
-\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em A virtual TPM device}} \\
+\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em A
+virtual TPM device.}} \\
\hline
Quals & Field & Type & Description \\
\hline
--- /dev/null
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef XEN_CRASHDUMP_H
+#define XEN_CRASHDUMP_H
+
+#include "xen_common.h"
+#include "xen_crashdump_decl.h"
+#include "xen_vdi_decl.h"
+#include "xen_vm_decl.h"
+
+
+/*
+ * The crashdump class.
+ *
+ * A VM crashdump.
+ */
+
+
+/**
+ * Free the given xen_crashdump. The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_crashdump_free(xen_crashdump crashdump);
+
+
+typedef struct xen_crashdump_set
+{
+ size_t size;
+ xen_crashdump *contents[];
+} xen_crashdump_set;
+
+/**
+ * Allocate a xen_crashdump_set of the given size.
+ */
+extern xen_crashdump_set *
+xen_crashdump_set_alloc(size_t size);
+
+/**
+ * Free the given xen_crashdump_set. The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_crashdump_set_free(xen_crashdump_set *set);
+
+
+typedef struct xen_crashdump_record
+{
+ xen_crashdump handle;
+ char *uuid;
+ struct xen_vm_record_opt *vm;
+ struct xen_vdi_record_opt *vdi;
+} xen_crashdump_record;
+
+/**
+ * Allocate a xen_crashdump_record.
+ */
+extern xen_crashdump_record *
+xen_crashdump_record_alloc(void);
+
+/**
+ * Free the given xen_crashdump_record, and all referenced values. The
+ * given record must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_free(xen_crashdump_record *record);
+
+
+typedef struct xen_crashdump_record_opt
+{
+ bool is_record;
+ union
+ {
+ xen_crashdump handle;
+ xen_crashdump_record *record;
+ } u;
+} xen_crashdump_record_opt;
+
+/**
+ * Allocate a xen_crashdump_record_opt.
+ */
+extern xen_crashdump_record_opt *
+xen_crashdump_record_opt_alloc(void);
+
+/**
+ * Free the given xen_crashdump_record_opt, and all referenced values.
+ * The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
+
+
+typedef struct xen_crashdump_record_set
+{
+ size_t size;
+ xen_crashdump_record *contents[];
+} xen_crashdump_record_set;
+
+/**
+ * Allocate a xen_crashdump_record_set of the given size.
+ */
+extern xen_crashdump_record_set *
+xen_crashdump_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_crashdump_record_set, and all referenced values.
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_set_free(xen_crashdump_record_set *set);
+
+
+
+typedef struct xen_crashdump_record_opt_set
+{
+ size_t size;
+ xen_crashdump_record_opt *contents[];
+} xen_crashdump_record_opt_set;
+
+/**
+ * Allocate a xen_crashdump_record_opt_set of the given size.
+ */
+extern xen_crashdump_record_opt_set *
+xen_crashdump_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_crashdump_record_opt_set, and all referenced
+ * values. The given set must have been allocated by this library.
+ */
+extern void
+xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
+
+
+/**
+ * Get a reference to the crashdump instance with the specified UUID.
+ */
+extern bool
+xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
+
+
+/**
+ * Create a new crashdump instance, and return its handle.
+ */
+extern bool
+xen_crashdump_create(xen_session *session, xen_crashdump *result, xen_crashdump_record *record);
+
+
+/**
+ * Destroy the specified crashdump instance.
+ */
+extern bool
+xen_crashdump_destroy(xen_session *session, xen_crashdump crashdump);
+
+
+/**
+ * Get the uuid field of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
+
+
+/**
+ * Get the VM field of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
+
+
+/**
+ * Get the VDI field of the given crashdump.
+ */
+extern bool
+xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
+
+
+/**
+ * Return a list of all the crashdumps known to the system.
+ */
+extern bool
+xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
+
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef XEN_CRASHDUMP_DECL_H
+#define XEN_CRASHDUMP_DECL_H
+
+typedef void *xen_crashdump;
+
+struct xen_crashdump_set;
+struct xen_crashdump_record;
+struct xen_crashdump_record_set;
+struct xen_crashdump_record_opt;
+struct xen_crashdump_record_opt_set;
+
+#endif
#include "xen_host_decl.h"
#include "xen_pbd_decl.h"
#include "xen_pif_decl.h"
+#include "xen_sr_decl.h"
#include "xen_string_string_map.h"
#include "xen_vm_decl.h"
struct xen_vm_record_opt_set *resident_vms;
xen_string_string_map *logging;
struct xen_pif_record_opt_set *pifs;
+ struct xen_sr_record_opt *suspend_image_sr;
+ struct xen_sr_record_opt *crash_dump_sr;
struct xen_pbd_record_opt_set *pbds;
struct xen_host_cpu_record_opt_set *host_cpus;
} xen_host_record;
xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
+/**
+ * Get the suspend_image_sr field of the given host.
+ */
+extern bool
+xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
+
+
+/**
+ * Get the crash_dump_sr field of the given host.
+ */
+extern bool
+xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
+
+
/**
* Get the PBDs field of the given host.
*/
xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
+/**
+ * Set the suspend_image_sr field of the given host.
+ */
+extern bool
+xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
+
+
+/**
+ * Set the crash_dump_sr field of the given host.
+ */
+extern bool
+xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
+
+
/**
* Puts the host into a state in which no new VMs can be started.
* Currently active VMs on the host continue to execute.
#define XEN_VDI_H
#include "xen_common.h"
+#include "xen_crashdump_decl.h"
#include "xen_sr_decl.h"
#include "xen_vbd_decl.h"
#include "xen_vdi_decl.h"
char *name_description;
struct xen_sr_record_opt *sr;
struct xen_vbd_record_opt_set *vbds;
+ struct xen_crashdump_record_opt_set *crash_dumps;
int64_t virtual_size;
int64_t physical_utilisation;
int64_t sector_size;
xen_vdi_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vdi vdi);
+/**
+ * Get the crash_dumps field of the given VDI.
+ */
+extern bool
+xen_vdi_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vdi vdi);
+
+
/**
* Get the virtual_size field of the given VDI.
*/
/**
* a disk that may be reformatted on upgrade
*/
- XEN_VDI_TYPE_EPHEMERAL
+ XEN_VDI_TYPE_EPHEMERAL,
+
+ /**
+ * a disk that stores a suspend image
+ */
+ XEN_VDI_TYPE_SUSPEND,
+
+ /**
+ * a disk that stores VM crashdump information
+ */
+ XEN_VDI_TYPE_CRASHDUMP
};
#include "xen_common.h"
#include "xen_console_decl.h"
+#include "xen_crashdump_decl.h"
#include "xen_host_decl.h"
#include "xen_int_float_map.h"
#include "xen_on_crash_behaviour.h"
#include "xen_on_normal_exit.h"
#include "xen_string_string_map.h"
#include "xen_vbd_decl.h"
+#include "xen_vdi_decl.h"
#include "xen_vif_decl.h"
#include "xen_vm_decl.h"
#include "xen_vm_power_state.h"
int64_t user_version;
bool is_a_template;
bool auto_power_on;
+ struct xen_vdi_record_opt *suspend_vdi;
struct xen_host_record_opt *resident_on;
int64_t memory_static_max;
int64_t memory_dynamic_max;
struct xen_console_record_opt_set *consoles;
struct xen_vif_record_opt_set *vifs;
struct xen_vbd_record_opt_set *vbds;
+ struct xen_crashdump_record_opt_set *crash_dumps;
struct xen_vtpm_record_opt_set *vtpms;
char *pv_bootloader;
char *pv_kernel;
xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
+/**
+ * Get the suspend_VDI field of the given VM.
+ */
+extern bool
+xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm);
+
+
/**
* Get the resident_on field of the given VM.
*/
xen_vm_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vm vm);
+/**
+ * Get the crash_dumps field of the given VM.
+ */
+extern bool
+xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm);
+
+
/**
* Get the VTPMs field of the given VM.
*/
--- /dev/null
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "xen_common.h"
+#include "xen_crashdump.h"
+#include "xen_internal.h"
+#include "xen_vdi.h"
+#include "xen_vm.h"
+
+
+XEN_FREE(xen_crashdump)
+XEN_SET_ALLOC_FREE(xen_crashdump)
+XEN_ALLOC(xen_crashdump_record)
+XEN_SET_ALLOC_FREE(xen_crashdump_record)
+XEN_ALLOC(xen_crashdump_record_opt)
+XEN_RECORD_OPT_FREE(xen_crashdump)
+XEN_SET_ALLOC_FREE(xen_crashdump_record_opt)
+
+
+static const struct_member xen_crashdump_record_struct_members[] =
+ {
+ { .key = "uuid",
+ .type = &abstract_type_string,
+ .offset = offsetof(xen_crashdump_record, uuid) },
+ { .key = "VM",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_crashdump_record, vm) },
+ { .key = "VDI",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_crashdump_record, vdi) }
+ };
+
+const abstract_type xen_crashdump_record_abstract_type_ =
+ {
+ .typename = STRUCT,
+ .struct_size = sizeof(xen_crashdump_record),
+ .member_count =
+ sizeof(xen_crashdump_record_struct_members) / sizeof(struct_member),
+ .members = xen_crashdump_record_struct_members
+ };
+
+
+void
+xen_crashdump_record_free(xen_crashdump_record *record)
+{
+ if (record == NULL)
+ {
+ return;
+ }
+ free(record->handle);
+ free(record->uuid);
+ xen_vm_record_opt_free(record->vm);
+ xen_vdi_record_opt_free(record->vdi);
+ free(record);
+}
+
+
+bool
+xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = crashdump }
+ };
+
+ abstract_type result_type = xen_crashdump_record_abstract_type_;
+
+ *result = NULL;
+ XEN_CALL_("crashdump.get_record");
+
+ if (session->ok)
+ {
+ (*result)->handle = xen_strdup_((*result)->uuid);
+ }
+
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = uuid }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("crashdump.get_by_uuid");
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_create(xen_session *session, xen_crashdump *result, xen_crashdump_record *record)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &xen_crashdump_record_abstract_type_,
+ .u.struct_val = record }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("crashdump.create");
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_destroy(xen_session *session, xen_crashdump crashdump)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = crashdump }
+ };
+
+ xen_call_(session, "crashdump.destroy", param_values, 1, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = crashdump }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("crashdump.get_VM");
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = crashdump }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("crashdump.get_VDI");
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result)
+{
+
+ abstract_type result_type = abstract_type_string_set;
+
+ *result = NULL;
+ xen_call_(session, "crashdump.get_all", NULL, 0, &result_type, result);
+ return session->ok;
+}
+
+
+bool
+xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump)
+{
+ *result = session->ok ? xen_strdup_((char *)crashdump) : NULL;
+ return session->ok;
+}
#include "xen_internal.h"
#include "xen_pbd.h"
#include "xen_pif.h"
+#include "xen_sr.h"
#include "xen_string_string_map.h"
#include "xen_vm.h"
{ .key = "PIFs",
.type = &abstract_type_ref_set,
.offset = offsetof(xen_host_record, pifs) },
+ { .key = "suspend_image_sr",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_host_record, suspend_image_sr) },
+ { .key = "crash_dump_sr",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_host_record, crash_dump_sr) },
{ .key = "PBDs",
.type = &abstract_type_ref_set,
.offset = offsetof(xen_host_record, pbds) },
xen_vm_record_opt_set_free(record->resident_vms);
xen_string_string_map_free(record->logging);
xen_pif_record_opt_set_free(record->pifs);
+ xen_sr_record_opt_free(record->suspend_image_sr);
+ xen_sr_record_opt_free(record->crash_dump_sr);
xen_pbd_record_opt_set_free(record->pbds);
xen_host_cpu_record_opt_set_free(record->host_cpus);
free(record);
}
+bool
+xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = host }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("host.get_suspend_image_sr");
+ return session->ok;
+}
+
+
+bool
+xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = host }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("host.get_crash_dump_sr");
+ return session->ok;
+}
+
+
bool
xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host)
{
}
+bool
+xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = host },
+ { .type = &abstract_type_string,
+ .u.string_val = suspend_image_sr }
+ };
+
+ xen_call_(session, "host.set_suspend_image_sr", param_values, 2, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = host },
+ { .type = &abstract_type_string,
+ .u.string_val = crash_dump_sr }
+ };
+
+ xen_call_(session, "host.set_crash_dump_sr", param_values, 2, NULL, NULL);
+ return session->ok;
+}
+
+
bool
xen_host_disable(xen_session *session, xen_host host)
{
#include <stdlib.h>
#include "xen_common.h"
+#include "xen_crashdump.h"
#include "xen_internal.h"
#include "xen_sr.h"
#include "xen_vbd.h"
{ .key = "VBDs",
.type = &abstract_type_ref_set,
.offset = offsetof(xen_vdi_record, vbds) },
+ { .key = "crash_dumps",
+ .type = &abstract_type_ref_set,
+ .offset = offsetof(xen_vdi_record, crash_dumps) },
{ .key = "virtual_size",
.type = &abstract_type_int,
.offset = offsetof(xen_vdi_record, virtual_size) },
free(record->name_description);
xen_sr_record_opt_free(record->sr);
xen_vbd_record_opt_set_free(record->vbds);
+ xen_crashdump_record_opt_set_free(record->crash_dumps);
free(record);
}
}
+bool
+xen_vdi_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vdi vdi)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vdi }
+ };
+
+ abstract_type result_type = abstract_type_string_set;
+
+ *result = NULL;
+ XEN_CALL_("VDI.get_crash_dumps");
+ return session->ok;
+}
+
+
bool
xen_vdi_get_virtual_size(xen_session *session, int64_t *result, xen_vdi vdi)
{
};
abstract_type result_type = xen_vdi_type_abstract_type_;
- char *result_str = NULL;
XEN_CALL_("VDI.get_type");
- *result = xen_vdi_type_from_string(session, result_str);
return session->ok;
}
{
"system",
"user",
- "ephemeral"
+ "ephemeral",
+ "suspend",
+ "crashdump"
};
#include "xen_common.h"
#include "xen_console.h"
+#include "xen_crashdump.h"
#include "xen_host.h"
#include "xen_int_float_map.h"
#include "xen_internal.h"
#include "xen_on_normal_exit_internal.h"
#include "xen_string_string_map.h"
#include "xen_vbd.h"
+#include "xen_vdi.h"
#include "xen_vif.h"
#include "xen_vm.h"
#include "xen_vm_power_state_internal.h"
{ .key = "auto_power_on",
.type = &abstract_type_bool,
.offset = offsetof(xen_vm_record, auto_power_on) },
+ { .key = "suspend_VDI",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_vm_record, suspend_vdi) },
{ .key = "resident_on",
.type = &abstract_type_ref,
.offset = offsetof(xen_vm_record, resident_on) },
{ .key = "VBDs",
.type = &abstract_type_ref_set,
.offset = offsetof(xen_vm_record, vbds) },
+ { .key = "crash_dumps",
+ .type = &abstract_type_ref_set,
+ .offset = offsetof(xen_vm_record, crash_dumps) },
{ .key = "VTPMs",
.type = &abstract_type_ref_set,
.offset = offsetof(xen_vm_record, vtpms) },
free(record->uuid);
free(record->name_label);
free(record->name_description);
+ xen_vdi_record_opt_free(record->suspend_vdi);
xen_host_record_opt_free(record->resident_on);
free(record->vcpus_policy);
free(record->vcpus_params);
xen_console_record_opt_set_free(record->consoles);
xen_vif_record_opt_set_free(record->vifs);
xen_vbd_record_opt_set_free(record->vbds);
+ xen_crashdump_record_opt_set_free(record->crash_dumps);
xen_vtpm_record_opt_set_free(record->vtpms);
free(record->pv_bootloader);
free(record->pv_kernel);
}
+bool
+xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("VM.get_suspend_VDI");
+ return session->ok;
+}
+
+
bool
xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm)
{
}
+bool
+xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm }
+ };
+
+ abstract_type result_type = abstract_type_string_set;
+
+ *result = NULL;
+ XEN_CALL_("VM.get_crash_dumps");
+ return session->ok;
+}
+
+
bool
xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm)
{