ia64/xen-unstable

changeset 12879:970ff2ba748f

merge with xen-unstable.hg
author awilliam@xenbuild2.aw
date Fri Dec 08 09:09:18 2006 -0700 (2006-12-08)
parents 968caf47b548 da87dc126b33
children d85c905beac4
files patches/linux-2.6.16.33/kexec-generic.patch patches/linux-2.6.16.33/linux-2.6.19-rc1-kexec-xen-i386.patch patches/linux-2.6.16.33/linux-2.6.19-rc1-kexec-xen-x86_64.patch tools/ioemu/vl.c tools/libxc/xc_linux_build.c tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Thu Dec 07 16:18:55 2006 -0700
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Fri Dec 08 09:09:18 2006 -0700
     1.3 @@ -23,7 +23,7 @@ The following classes are defined:
     1.4  Name & Description \\
     1.5  \hline
     1.6  {\tt session} & A session \\
     1.7 -{\tt task} & A longrunning asynchronous task \\
     1.8 +{\tt task} & A long-running asynchronous task \\
     1.9  {\tt VM} & A virtual machine (or 'guest') \\
    1.10  {\tt host} & A physical host \\
    1.11  {\tt host\_cpu} & A physical CPU \\
    1.12 @@ -109,6 +109,7 @@ The following enumeration types are used
    1.13  \hline
    1.14  \end{longtable}
    1.15  
    1.16 +\vspace{1cm}
    1.17  \begin{longtable}{|ll|}
    1.18  \hline
    1.19  {\tt enum vdi\_type} & \\
    1.20 @@ -136,6 +137,17 @@ The following enumeration types are used
    1.21  \vspace{1cm}
    1.22  \begin{longtable}{|ll|}
    1.23  \hline
    1.24 +{\tt enum task\_status\_type} & \\
    1.25 +\hline
    1.26 +\hspace{0.5cm}{\tt pending} & task is in progress \\
    1.27 +\hspace{0.5cm}{\tt success} & task was completed successfully \\
    1.28 +\hspace{0.5cm}{\tt failure} & task has failed \\
    1.29 +\hline
    1.30 +\end{longtable}
    1.31 +
    1.32 +\vspace{1cm}
    1.33 +\begin{longtable}{|ll|}
    1.34 +\hline
    1.35  {\tt enum cpu\_feature} & \\
    1.36  \hline
    1.37  \hspace{0.5cm}{\tt FPU} &  Onboard FPU  \\
    1.38 @@ -254,6 +266,16 @@ The following enumeration types are used
    1.39  \vspace{1cm}
    1.40  \begin{longtable}{|ll|}
    1.41  \hline
    1.42 +{\tt enum vbd\_type} & \\
    1.43 +\hline
    1.44 +\hspace{0.5cm}{\tt CD} & VBD will appear to guest as CD \\
    1.45 +\hspace{0.5cm}{\tt Disk} & VBD will appear to guest as disk \\
    1.46 +\hline
    1.47 +\end{longtable}
    1.48 +
    1.49 +\vspace{1cm}
    1.50 +\begin{longtable}{|ll|}
    1.51 +\hline
    1.52  {\tt enum driver\_type} & \\
    1.53  \hline
    1.54  \hspace{0.5cm}{\tt ioemu} & use hardware emulation \\
    1.55 @@ -273,6 +295,7 @@ The following enumeration types are used
    1.56  \hline
    1.57  Quals & Field & Type & Description \\
    1.58  \hline
    1.59 +$\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object reference \\
    1.60  $\mathit{RO}_\mathit{ins}$ &  {\tt this\_host} & host ref & Currently connected host \\
    1.61  $\mathit{RO}_\mathit{ins}$ &  {\tt this\_user} & user ref & Currently connected user \\
    1.62  \hline
    1.63 @@ -333,10 +356,42 @@ void
    1.64  \vspace{0.3cm}
    1.65  \vspace{0.3cm}
    1.66  \vspace{0.3cm}
    1.67 +\subsubsection{RPC name:~get\_uuid}
    1.68 +
    1.69 +{\bf Overview:} 
    1.70 +Get the uuid field of the given session.
    1.71 +
    1.72 + \noindent {\bf Signature:} 
    1.73 +\begin{verbatim} string get_uuid (session_id s, session ref self)\end{verbatim}
    1.74 +
    1.75 +
    1.76 +\noindent{\bf Arguments:}
    1.77 +
    1.78 + 
    1.79 +\vspace{0.3cm}
    1.80 +\begin{tabular}{|c|c|p{7cm}|}
    1.81 + \hline
    1.82 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.83 +{\tt session ref } & self & reference to the object \\ \hline 
    1.84 +
    1.85 +\end{tabular}
    1.86 +
    1.87 +\vspace{0.3cm}
    1.88 +
    1.89 + \noindent {\bf Return Type:} 
    1.90 +{\tt 
    1.91 +string
    1.92 +}
    1.93 +
    1.94 +
    1.95 +value of the field
    1.96 +\vspace{0.3cm}
    1.97 +\vspace{0.3cm}
    1.98 +\vspace{0.3cm}
    1.99  \subsubsection{RPC name:~get\_this\_host}
   1.100  
   1.101  {\bf Overview:} 
   1.102 -get accessor message derived from field this\_host of object session
   1.103 +Get the this\_host field of the given session.
   1.104  
   1.105   \noindent {\bf Signature:} 
   1.106  \begin{verbatim} (host ref) get_this_host (session_id s, session ref self)\end{verbatim}
   1.107 @@ -349,7 +404,7 @@ get accessor message derived from field 
   1.108  \begin{tabular}{|c|c|p{7cm}|}
   1.109   \hline
   1.110  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.111 -{\tt session ref } & self & object instance \\ \hline 
   1.112 +{\tt session ref } & self & reference to the object \\ \hline 
   1.113  
   1.114  \end{tabular}
   1.115  
   1.116 @@ -368,7 +423,7 @@ value of the field
   1.117  \subsubsection{RPC name:~get\_this\_user}
   1.118  
   1.119  {\bf Overview:} 
   1.120 -get accessor message derived from field this\_user of object session
   1.121 +Get the this\_user field of the given session.
   1.122  
   1.123   \noindent {\bf Signature:} 
   1.124  \begin{verbatim} (user ref) get_this_user (session_id s, session ref self)\end{verbatim}
   1.125 @@ -381,7 +436,7 @@ get accessor message derived from field 
   1.126  \begin{tabular}{|c|c|p{7cm}|}
   1.127   \hline
   1.128  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.129 -{\tt session ref } & self & object instance \\ \hline 
   1.130 +{\tt session ref } & self & reference to the object \\ \hline 
   1.131  
   1.132  \end{tabular}
   1.133  
   1.134 @@ -400,7 +455,7 @@ value of the field
   1.135  \subsubsection{RPC name:~create}
   1.136  
   1.137  {\bf Overview:} 
   1.138 -constructor for class session
   1.139 +Create a new session instance, and return its handle.
   1.140  
   1.141   \noindent {\bf Signature:} 
   1.142  \begin{verbatim} (session ref) create (session_id s, session record args)\end{verbatim}
   1.143 @@ -432,7 +487,7 @@ reference to the newly created object
   1.144  \subsubsection{RPC name:~destroy}
   1.145  
   1.146  {\bf Overview:} 
   1.147 -destructor for class session
   1.148 +Destroy the specified session instance.
   1.149  
   1.150   \noindent {\bf Signature:} 
   1.151  \begin{verbatim} void destroy (session_id s, session ref self)\end{verbatim}
   1.152 @@ -445,7 +500,7 @@ destructor for class session
   1.153  \begin{tabular}{|c|c|p{7cm}|}
   1.154   \hline
   1.155  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.156 -{\tt session ref } & self & object instance \\ \hline 
   1.157 +{\tt session ref } & self & reference to the object \\ \hline 
   1.158  
   1.159  \end{tabular}
   1.160  
   1.161 @@ -464,7 +519,7 @@ void
   1.162  \subsubsection{RPC name:~get\_by\_uuid}
   1.163  
   1.164  {\bf Overview:} 
   1.165 -returns the session instance with a particular uuid
   1.166 +Get a reference to the session instance with the specified UUID.
   1.167  
   1.168   \noindent {\bf Signature:} 
   1.169  \begin{verbatim} (session ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
   1.170 @@ -496,7 +551,7 @@ reference to the object
   1.171  \subsubsection{RPC name:~get\_record}
   1.172  
   1.173  {\bf Overview:} 
   1.174 -returns a record containing the state of an instance of class session
   1.175 +Get a record containing the current state of the given session.
   1.176  
   1.177   \noindent {\bf Signature:} 
   1.178  \begin{verbatim} (session record) get_record (session_id s, session ref self)\end{verbatim}
   1.179 @@ -533,55 +588,30 @@ all fields from the object
   1.180  \begin{longtable}{|lllp{0.38\textwidth}|}
   1.181  \hline
   1.182  \multicolumn{1}{|l}{Name} & \multicolumn{3}{l|}{\bf task} \\
   1.183 -\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em A longrunning asynchronous task}} \\
   1.184 +\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em A long-running asynchronous task}} \\
   1.185  \hline
   1.186  Quals & Field & Type & Description \\
   1.187  \hline
   1.188  $\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object reference \\
   1.189  $\mathit{RW}$ &  {\tt name/label} & string & a human-readable name \\
   1.190  $\mathit{RW}$ &  {\tt name/description} & string & a notes field containg human-readable description \\
   1.191 +$\mathit{RO}_\mathit{run}$ &  {\tt status} & task\_status\_type & current status of the task \\
   1.192 +$\mathit{RO}_\mathit{run}$ &  {\tt progress} & int & if the task is still pending, this field contains the estimated percentage complete (0-100). If task has completed (successfully or unsuccessfully) this should be 100. \\
   1.193 +$\mathit{RO}_\mathit{run}$ &  {\tt eta} & datetime & if the task is still pending, this field contains the estimated completion time. If the task has finished (successfully or not) it contains the time the task finished. \\
   1.194 +$\mathit{RO}_\mathit{run}$ &  {\tt type} & string & if the task has completed successfully, this field contains the type of the encoded result (i.e. name of the class whose reference is in the result field). Undefined otherwise. \\
   1.195 +$\mathit{RO}_\mathit{run}$ &  {\tt result} & string & if the task has completed successfully, this field contains the result value (either Void or an object reference). Undefined otherwise. \\
   1.196 +$\mathit{RO}_\mathit{run}$ &  {\tt error\_code} & int & if the task has failed, this field contains the error code. Undefined otherwise. \\
   1.197 +$\mathit{RO}_\mathit{run}$ &  {\tt error\_info} & string Set & if the task has failed, this field contains the set of associated error strings. Undefined otherwise. \\
   1.198  \hline
   1.199  \end{longtable}
   1.200  \subsection{Additional RPCs associated with class: task}
   1.201 -\subsubsection{RPC name:~get\_status}
   1.202 -
   1.203 -{\bf Overview:} 
   1.204 -Poll a running asynchronous RPC invocation and query its status
   1.205 -
   1.206 - \noindent {\bf Signature:} 
   1.207 -\begin{verbatim} (uuid ref) get_status (session_id s, task ref task)\end{verbatim}
   1.208 -
   1.209 -
   1.210 -\noindent{\bf Arguments:}
   1.211 -
   1.212 - 
   1.213 -\vspace{0.3cm}
   1.214 -\begin{tabular}{|c|c|p{7cm}|}
   1.215 - \hline
   1.216 -{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.217 -{\tt task ref } & task & The ID of the RPC call to poll \\ \hline 
   1.218 -
   1.219 -\end{tabular}
   1.220 -
   1.221 -\vspace{0.3cm}
   1.222 -
   1.223 - \noindent {\bf Return Type:} 
   1.224 -{\tt 
   1.225 -uuid ref
   1.226 -}
   1.227 -
   1.228 -
   1.229 -String describing status of specified asynchronous RPC invocation, including estimated completion time
   1.230 -\vspace{0.3cm}
   1.231 -\vspace{0.3cm}
   1.232 -\vspace{0.3cm}
   1.233 -\subsubsection{RPC name:~get\_all\_tasks}
   1.234 -
   1.235 -{\bf Overview:} 
   1.236 -List all asynchronous RPC calls currently executing
   1.237 -
   1.238 - \noindent {\bf Signature:} 
   1.239 -\begin{verbatim} ((task ref) Set) get_all_tasks (session_id s)\end{verbatim}
   1.240 +\subsubsection{RPC name:~get\_all}
   1.241 +
   1.242 +{\bf Overview:} 
   1.243 +Return a list of all the tasks known to the system
   1.244 +
   1.245 + \noindent {\bf Signature:} 
   1.246 +\begin{verbatim} ((task ref) Set) get_all (session_id s)\end{verbatim}
   1.247  
   1.248  
   1.249  \vspace{0.3cm}
   1.250 @@ -592,17 +622,14 @@ List all asynchronous RPC calls currentl
   1.251  }
   1.252  
   1.253  
   1.254 -A list of tasks currently executing. Note that
   1.255 -tasks are associated with users rather than sessions. Thus, if you logout and
   1.256 -login again with a different session but the same user, this function will still
   1.257 -return the user's running tasks.
   1.258 +references to all objects
   1.259  \vspace{0.3cm}
   1.260  \vspace{0.3cm}
   1.261  \vspace{0.3cm}
   1.262  \subsubsection{RPC name:~get\_uuid}
   1.263  
   1.264  {\bf Overview:} 
   1.265 -get accessor message derived from field uuid of object task
   1.266 +Get the uuid field of the given task.
   1.267  
   1.268   \noindent {\bf Signature:} 
   1.269  \begin{verbatim} string get_uuid (session_id s, task ref self)\end{verbatim}
   1.270 @@ -615,7 +642,7 @@ get accessor message derived from field 
   1.271  \begin{tabular}{|c|c|p{7cm}|}
   1.272   \hline
   1.273  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.274 -{\tt task ref } & self & object instance \\ \hline 
   1.275 +{\tt task ref } & self & reference to the object \\ \hline 
   1.276  
   1.277  \end{tabular}
   1.278  
   1.279 @@ -634,7 +661,7 @@ value of the field
   1.280  \subsubsection{RPC name:~get\_name\_label}
   1.281  
   1.282  {\bf Overview:} 
   1.283 -get accessor message derived from field name/label of object task
   1.284 +Get the name/label field of the given task.
   1.285  
   1.286   \noindent {\bf Signature:} 
   1.287  \begin{verbatim} string get_name_label (session_id s, task ref self)\end{verbatim}
   1.288 @@ -647,7 +674,7 @@ get accessor message derived from field 
   1.289  \begin{tabular}{|c|c|p{7cm}|}
   1.290   \hline
   1.291  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.292 -{\tt task ref } & self & object instance \\ \hline 
   1.293 +{\tt task ref } & self & reference to the object \\ \hline 
   1.294  
   1.295  \end{tabular}
   1.296  
   1.297 @@ -666,7 +693,7 @@ value of the field
   1.298  \subsubsection{RPC name:~set\_name\_label}
   1.299  
   1.300  {\bf Overview:} 
   1.301 -set accessor message derived from field name/label of object task
   1.302 +Set the name/label field of the given task.
   1.303  
   1.304   \noindent {\bf Signature:} 
   1.305  \begin{verbatim} void set_name_label (session_id s, task ref self, string value)\end{verbatim}
   1.306 @@ -679,7 +706,7 @@ set accessor message derived from field 
   1.307  \begin{tabular}{|c|c|p{7cm}|}
   1.308   \hline
   1.309  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.310 -{\tt task ref } & self & object instance \\ \hline 
   1.311 +{\tt task ref } & self & reference to the object \\ \hline 
   1.312  
   1.313  {\tt string } & value & New value to set \\ \hline 
   1.314  
   1.315 @@ -700,7 +727,7 @@ void
   1.316  \subsubsection{RPC name:~get\_name\_description}
   1.317  
   1.318  {\bf Overview:} 
   1.319 -get accessor message derived from field name/description of object task
   1.320 +Get the name/description field of the given task.
   1.321  
   1.322   \noindent {\bf Signature:} 
   1.323  \begin{verbatim} string get_name_description (session_id s, task ref self)\end{verbatim}
   1.324 @@ -713,7 +740,7 @@ get accessor message derived from field 
   1.325  \begin{tabular}{|c|c|p{7cm}|}
   1.326   \hline
   1.327  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.328 -{\tt task ref } & self & object instance \\ \hline 
   1.329 +{\tt task ref } & self & reference to the object \\ \hline 
   1.330  
   1.331  \end{tabular}
   1.332  
   1.333 @@ -732,7 +759,7 @@ value of the field
   1.334  \subsubsection{RPC name:~set\_name\_description}
   1.335  
   1.336  {\bf Overview:} 
   1.337 -set accessor message derived from field name/description of object task
   1.338 +Set the name/description field of the given task.
   1.339  
   1.340   \noindent {\bf Signature:} 
   1.341  \begin{verbatim} void set_name_description (session_id s, task ref self, string value)\end{verbatim}
   1.342 @@ -745,7 +772,7 @@ set accessor message derived from field 
   1.343  \begin{tabular}{|c|c|p{7cm}|}
   1.344   \hline
   1.345  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.346 -{\tt task ref } & self & object instance \\ \hline 
   1.347 +{\tt task ref } & self & reference to the object \\ \hline 
   1.348  
   1.349  {\tt string } & value & New value to set \\ \hline 
   1.350  
   1.351 @@ -763,10 +790,234 @@ void
   1.352  \vspace{0.3cm}
   1.353  \vspace{0.3cm}
   1.354  \vspace{0.3cm}
   1.355 +\subsubsection{RPC name:~get\_status}
   1.356 +
   1.357 +{\bf Overview:} 
   1.358 +Get the status field of the given task.
   1.359 +
   1.360 + \noindent {\bf Signature:} 
   1.361 +\begin{verbatim} (task_status_type) get_status (session_id s, task ref self)\end{verbatim}
   1.362 +
   1.363 +
   1.364 +\noindent{\bf Arguments:}
   1.365 +
   1.366 + 
   1.367 +\vspace{0.3cm}
   1.368 +\begin{tabular}{|c|c|p{7cm}|}
   1.369 + \hline
   1.370 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.371 +{\tt task ref } & self & reference to the object \\ \hline 
   1.372 +
   1.373 +\end{tabular}
   1.374 +
   1.375 +\vspace{0.3cm}
   1.376 +
   1.377 + \noindent {\bf Return Type:} 
   1.378 +{\tt 
   1.379 +task\_status\_type
   1.380 +}
   1.381 +
   1.382 +
   1.383 +value of the field
   1.384 +\vspace{0.3cm}
   1.385 +\vspace{0.3cm}
   1.386 +\vspace{0.3cm}
   1.387 +\subsubsection{RPC name:~get\_progress}
   1.388 +
   1.389 +{\bf Overview:} 
   1.390 +Get the progress field of the given task.
   1.391 +
   1.392 + \noindent {\bf Signature:} 
   1.393 +\begin{verbatim} int get_progress (session_id s, task ref self)\end{verbatim}
   1.394 +
   1.395 +
   1.396 +\noindent{\bf Arguments:}
   1.397 +
   1.398 + 
   1.399 +\vspace{0.3cm}
   1.400 +\begin{tabular}{|c|c|p{7cm}|}
   1.401 + \hline
   1.402 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.403 +{\tt task ref } & self & reference to the object \\ \hline 
   1.404 +
   1.405 +\end{tabular}
   1.406 +
   1.407 +\vspace{0.3cm}
   1.408 +
   1.409 + \noindent {\bf Return Type:} 
   1.410 +{\tt 
   1.411 +int
   1.412 +}
   1.413 +
   1.414 +
   1.415 +value of the field
   1.416 +\vspace{0.3cm}
   1.417 +\vspace{0.3cm}
   1.418 +\vspace{0.3cm}
   1.419 +\subsubsection{RPC name:~get\_eta}
   1.420 +
   1.421 +{\bf Overview:} 
   1.422 +Get the eta field of the given task.
   1.423 +
   1.424 + \noindent {\bf Signature:} 
   1.425 +\begin{verbatim} datetime get_eta (session_id s, task ref self)\end{verbatim}
   1.426 +
   1.427 +
   1.428 +\noindent{\bf Arguments:}
   1.429 +
   1.430 + 
   1.431 +\vspace{0.3cm}
   1.432 +\begin{tabular}{|c|c|p{7cm}|}
   1.433 + \hline
   1.434 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.435 +{\tt task ref } & self & reference to the object \\ \hline 
   1.436 +
   1.437 +\end{tabular}
   1.438 +
   1.439 +\vspace{0.3cm}
   1.440 +
   1.441 + \noindent {\bf Return Type:} 
   1.442 +{\tt 
   1.443 +datetime
   1.444 +}
   1.445 +
   1.446 +
   1.447 +value of the field
   1.448 +\vspace{0.3cm}
   1.449 +\vspace{0.3cm}
   1.450 +\vspace{0.3cm}
   1.451 +\subsubsection{RPC name:~get\_type}
   1.452 +
   1.453 +{\bf Overview:} 
   1.454 +Get the type field of the given task.
   1.455 +
   1.456 + \noindent {\bf Signature:} 
   1.457 +\begin{verbatim} string get_type (session_id s, task ref self)\end{verbatim}
   1.458 +
   1.459 +
   1.460 +\noindent{\bf Arguments:}
   1.461 +
   1.462 + 
   1.463 +\vspace{0.3cm}
   1.464 +\begin{tabular}{|c|c|p{7cm}|}
   1.465 + \hline
   1.466 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.467 +{\tt task ref } & self & reference to the object \\ \hline 
   1.468 +
   1.469 +\end{tabular}
   1.470 +
   1.471 +\vspace{0.3cm}
   1.472 +
   1.473 + \noindent {\bf Return Type:} 
   1.474 +{\tt 
   1.475 +string
   1.476 +}
   1.477 +
   1.478 +
   1.479 +value of the field
   1.480 +\vspace{0.3cm}
   1.481 +\vspace{0.3cm}
   1.482 +\vspace{0.3cm}
   1.483 +\subsubsection{RPC name:~get\_result}
   1.484 +
   1.485 +{\bf Overview:} 
   1.486 +Get the result field of the given task.
   1.487 +
   1.488 + \noindent {\bf Signature:} 
   1.489 +\begin{verbatim} string get_result (session_id s, task ref self)\end{verbatim}
   1.490 +
   1.491 +
   1.492 +\noindent{\bf Arguments:}
   1.493 +
   1.494 + 
   1.495 +\vspace{0.3cm}
   1.496 +\begin{tabular}{|c|c|p{7cm}|}
   1.497 + \hline
   1.498 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.499 +{\tt task ref } & self & reference to the object \\ \hline 
   1.500 +
   1.501 +\end{tabular}
   1.502 +
   1.503 +\vspace{0.3cm}
   1.504 +
   1.505 + \noindent {\bf Return Type:} 
   1.506 +{\tt 
   1.507 +string
   1.508 +}
   1.509 +
   1.510 +
   1.511 +value of the field
   1.512 +\vspace{0.3cm}
   1.513 +\vspace{0.3cm}
   1.514 +\vspace{0.3cm}
   1.515 +\subsubsection{RPC name:~get\_error\_code}
   1.516 +
   1.517 +{\bf Overview:} 
   1.518 +Get the error\_code field of the given task.
   1.519 +
   1.520 + \noindent {\bf Signature:} 
   1.521 +\begin{verbatim} int get_error_code (session_id s, task ref self)\end{verbatim}
   1.522 +
   1.523 +
   1.524 +\noindent{\bf Arguments:}
   1.525 +
   1.526 + 
   1.527 +\vspace{0.3cm}
   1.528 +\begin{tabular}{|c|c|p{7cm}|}
   1.529 + \hline
   1.530 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.531 +{\tt task ref } & self & reference to the object \\ \hline 
   1.532 +
   1.533 +\end{tabular}
   1.534 +
   1.535 +\vspace{0.3cm}
   1.536 +
   1.537 + \noindent {\bf Return Type:} 
   1.538 +{\tt 
   1.539 +int
   1.540 +}
   1.541 +
   1.542 +
   1.543 +value of the field
   1.544 +\vspace{0.3cm}
   1.545 +\vspace{0.3cm}
   1.546 +\vspace{0.3cm}
   1.547 +\subsubsection{RPC name:~get\_error\_info}
   1.548 +
   1.549 +{\bf Overview:} 
   1.550 +Get the error\_info field of the given task.
   1.551 +
   1.552 + \noindent {\bf Signature:} 
   1.553 +\begin{verbatim} (string Set) get_error_info (session_id s, task ref self)\end{verbatim}
   1.554 +
   1.555 +
   1.556 +\noindent{\bf Arguments:}
   1.557 +
   1.558 + 
   1.559 +\vspace{0.3cm}
   1.560 +\begin{tabular}{|c|c|p{7cm}|}
   1.561 + \hline
   1.562 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.563 +{\tt task ref } & self & reference to the object \\ \hline 
   1.564 +
   1.565 +\end{tabular}
   1.566 +
   1.567 +\vspace{0.3cm}
   1.568 +
   1.569 + \noindent {\bf Return Type:} 
   1.570 +{\tt 
   1.571 +string Set
   1.572 +}
   1.573 +
   1.574 +
   1.575 +value of the field
   1.576 +\vspace{0.3cm}
   1.577 +\vspace{0.3cm}
   1.578 +\vspace{0.3cm}
   1.579  \subsubsection{RPC name:~create}
   1.580  
   1.581  {\bf Overview:} 
   1.582 -constructor for class task
   1.583 +Create a new task instance, and return its handle.
   1.584  
   1.585   \noindent {\bf Signature:} 
   1.586  \begin{verbatim} (task ref) create (session_id s, task record args)\end{verbatim}
   1.587 @@ -798,7 +1049,7 @@ reference to the newly created object
   1.588  \subsubsection{RPC name:~destroy}
   1.589  
   1.590  {\bf Overview:} 
   1.591 -destructor for class task
   1.592 +Destroy the specified task instance.
   1.593  
   1.594   \noindent {\bf Signature:} 
   1.595  \begin{verbatim} void destroy (session_id s, task ref self)\end{verbatim}
   1.596 @@ -811,7 +1062,7 @@ destructor for class task
   1.597  \begin{tabular}{|c|c|p{7cm}|}
   1.598   \hline
   1.599  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.600 -{\tt task ref } & self & object instance \\ \hline 
   1.601 +{\tt task ref } & self & reference to the object \\ \hline 
   1.602  
   1.603  \end{tabular}
   1.604  
   1.605 @@ -830,7 +1081,7 @@ void
   1.606  \subsubsection{RPC name:~get\_by\_uuid}
   1.607  
   1.608  {\bf Overview:} 
   1.609 -returns the task instance with a particular uuid
   1.610 +Get a reference to the task instance with the specified UUID.
   1.611  
   1.612   \noindent {\bf Signature:} 
   1.613  \begin{verbatim} (task ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
   1.614 @@ -862,7 +1113,7 @@ reference to the object
   1.615  \subsubsection{RPC name:~get\_record}
   1.616  
   1.617  {\bf Overview:} 
   1.618 -returns a record containing the state of an instance of class task
   1.619 +Get a record containing the current state of the given task.
   1.620  
   1.621   \noindent {\bf Signature:} 
   1.622  \begin{verbatim} (task record) get_record (session_id s, task ref self)\end{verbatim}
   1.623 @@ -894,7 +1145,7 @@ all fields from the object
   1.624  \subsubsection{RPC name:~get\_by\_name\_label}
   1.625  
   1.626  {\bf Overview:} 
   1.627 -returns the task instance with a particular name label
   1.628 +Get all the task instances with the given label.
   1.629  
   1.630   \noindent {\bf Signature:} 
   1.631  \begin{verbatim} ((task ref) Set) get_by_name_label (session_id s, string label)\end{verbatim}
   1.632 @@ -941,15 +1192,16 @@ Quals & Field & Type & Description \\
   1.633  $\mathit{RW}$ &  {\tt name/description} & string & a notes field containg human-readable description \\
   1.634  $\mathit{RW}$ &  {\tt user\_version} & int & a user version number for this machine \\
   1.635  $\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 \\
   1.636 +$\mathit{RW}$ &  {\tt auto\_power\_on} & bool & true if this VM should be started automatically after host boot \\
   1.637  $\mathit{RO}_\mathit{run}$ &  {\tt resident\_on} & host ref & the host the VM is currently resident on \\
   1.638 -$\mathit{RO}_\mathit{ins}$ &  {\tt memory/static\_max} & int & Statically-set (i.e. absolute) maximum \\
   1.639 -$\mathit{RW}$ &  {\tt memory/dynamic\_max} & int & Dynamic maximum \\
   1.640 -$\mathit{RO}_\mathit{run}$ &  {\tt memory/actual} & int & Guest's actual usage \\
   1.641 -$\mathit{RW}$ &  {\tt memory/dynamic\_min} & int & Dynamic minimum \\
   1.642 -$\mathit{RO}_\mathit{ins}$ &  {\tt memory/static\_min} & int & Statically-set (i.e. absolute) mininum \\
   1.643 +$\mathit{RO}_\mathit{ins}$ &  {\tt memory/static\_max} & int & Statically-set (i.e. absolute) maximum (bytes) \\
   1.644 +$\mathit{RW}$ &  {\tt memory/dynamic\_max} & int & Dynamic maximum (bytes) \\
   1.645 +$\mathit{RO}_\mathit{run}$ &  {\tt memory/actual} & int & Guest's actual usage (bytes) \\
   1.646 +$\mathit{RW}$ &  {\tt memory/dynamic\_min} & int & Dynamic minimum (bytes) \\
   1.647 +$\mathit{RO}_\mathit{ins}$ &  {\tt memory/static\_min} & int & Statically-set (i.e. absolute) mininum (bytes) \\
   1.648  $\mathit{RW}$ &  {\tt VCPUs/policy} & string & the name of the VCPU scheduling policy to be applied \\
   1.649  $\mathit{RW}$ &  {\tt VCPUs/params} & string & string-encoded parameters passed to selected VCPU policy \\
   1.650 -$\mathit{RO}_\mathit{run}$ &  {\tt VCPUs/number} & int & Current number of VCPUs \\
   1.651 +$\mathit{RW}$ &  {\tt VCPUs/number} & int & Current number of VCPUs \\
   1.652  $\mathit{RO}_\mathit{run}$ &  {\tt VCPUs/utilisation} & (int $\rightarrow$ float) Map & Utilisation for all of guest's current VCPUs \\
   1.653  $\mathit{RO}_\mathit{ins}$ &  {\tt VCPUs/features/required} & (cpu\_feature) Set & CPU features the guest demands the host supports \\
   1.654  $\mathit{RO}_\mathit{ins}$ &  {\tt VCPUs/features/can\_use} & (cpu\_feature) Set & CPU features the guest can use if available \\
   1.655 @@ -1335,7 +1587,7 @@ A list of all the IDs of all the VMs
   1.656  \subsubsection{RPC name:~get\_uuid}
   1.657  
   1.658  {\bf Overview:} 
   1.659 -get accessor message derived from field uuid of object VM
   1.660 +Get the uuid field of the given VM.
   1.661  
   1.662   \noindent {\bf Signature:} 
   1.663  \begin{verbatim} string get_uuid (session_id s, VM ref self)\end{verbatim}
   1.664 @@ -1348,7 +1600,7 @@ get accessor message derived from field 
   1.665  \begin{tabular}{|c|c|p{7cm}|}
   1.666   \hline
   1.667  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.668 -{\tt VM ref } & self & object instance \\ \hline 
   1.669 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.670  
   1.671  \end{tabular}
   1.672  
   1.673 @@ -1367,7 +1619,7 @@ value of the field
   1.674  \subsubsection{RPC name:~get\_power\_state}
   1.675  
   1.676  {\bf Overview:} 
   1.677 -get accessor message derived from field power\_state of object VM
   1.678 +Get the power\_state field of the given VM.
   1.679  
   1.680   \noindent {\bf Signature:} 
   1.681  \begin{verbatim} (vm_power_state) get_power_state (session_id s, VM ref self)\end{verbatim}
   1.682 @@ -1380,7 +1632,7 @@ get accessor message derived from field 
   1.683  \begin{tabular}{|c|c|p{7cm}|}
   1.684   \hline
   1.685  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.686 -{\tt VM ref } & self & object instance \\ \hline 
   1.687 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.688  
   1.689  \end{tabular}
   1.690  
   1.691 @@ -1399,7 +1651,7 @@ value of the field
   1.692  \subsubsection{RPC name:~get\_name\_label}
   1.693  
   1.694  {\bf Overview:} 
   1.695 -get accessor message derived from field name/label of object VM
   1.696 +Get the name/label field of the given VM.
   1.697  
   1.698   \noindent {\bf Signature:} 
   1.699  \begin{verbatim} string get_name_label (session_id s, VM ref self)\end{verbatim}
   1.700 @@ -1412,7 +1664,7 @@ get accessor message derived from field 
   1.701  \begin{tabular}{|c|c|p{7cm}|}
   1.702   \hline
   1.703  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.704 -{\tt VM ref } & self & object instance \\ \hline 
   1.705 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.706  
   1.707  \end{tabular}
   1.708  
   1.709 @@ -1431,7 +1683,7 @@ value of the field
   1.710  \subsubsection{RPC name:~set\_name\_label}
   1.711  
   1.712  {\bf Overview:} 
   1.713 -set accessor message derived from field name/label of object VM
   1.714 +Set the name/label field of the given VM.
   1.715  
   1.716   \noindent {\bf Signature:} 
   1.717  \begin{verbatim} void set_name_label (session_id s, VM ref self, string value)\end{verbatim}
   1.718 @@ -1444,7 +1696,7 @@ set accessor message derived from field 
   1.719  \begin{tabular}{|c|c|p{7cm}|}
   1.720   \hline
   1.721  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.722 -{\tt VM ref } & self & object instance \\ \hline 
   1.723 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.724  
   1.725  {\tt string } & value & New value to set \\ \hline 
   1.726  
   1.727 @@ -1465,7 +1717,7 @@ void
   1.728  \subsubsection{RPC name:~get\_name\_description}
   1.729  
   1.730  {\bf Overview:} 
   1.731 -get accessor message derived from field name/description of object VM
   1.732 +Get the name/description field of the given VM.
   1.733  
   1.734   \noindent {\bf Signature:} 
   1.735  \begin{verbatim} string get_name_description (session_id s, VM ref self)\end{verbatim}
   1.736 @@ -1478,7 +1730,7 @@ get accessor message derived from field 
   1.737  \begin{tabular}{|c|c|p{7cm}|}
   1.738   \hline
   1.739  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.740 -{\tt VM ref } & self & object instance \\ \hline 
   1.741 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.742  
   1.743  \end{tabular}
   1.744  
   1.745 @@ -1497,7 +1749,7 @@ value of the field
   1.746  \subsubsection{RPC name:~set\_name\_description}
   1.747  
   1.748  {\bf Overview:} 
   1.749 -set accessor message derived from field name/description of object VM
   1.750 +Set the name/description field of the given VM.
   1.751  
   1.752   \noindent {\bf Signature:} 
   1.753  \begin{verbatim} void set_name_description (session_id s, VM ref self, string value)\end{verbatim}
   1.754 @@ -1510,7 +1762,7 @@ set accessor message derived from field 
   1.755  \begin{tabular}{|c|c|p{7cm}|}
   1.756   \hline
   1.757  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.758 -{\tt VM ref } & self & object instance \\ \hline 
   1.759 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.760  
   1.761  {\tt string } & value & New value to set \\ \hline 
   1.762  
   1.763 @@ -1531,7 +1783,7 @@ void
   1.764  \subsubsection{RPC name:~get\_user\_version}
   1.765  
   1.766  {\bf Overview:} 
   1.767 -get accessor message derived from field user\_version of object VM
   1.768 +Get the user\_version field of the given VM.
   1.769  
   1.770   \noindent {\bf Signature:} 
   1.771  \begin{verbatim} int get_user_version (session_id s, VM ref self)\end{verbatim}
   1.772 @@ -1544,7 +1796,7 @@ get accessor message derived from field 
   1.773  \begin{tabular}{|c|c|p{7cm}|}
   1.774   \hline
   1.775  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.776 -{\tt VM ref } & self & object instance \\ \hline 
   1.777 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.778  
   1.779  \end{tabular}
   1.780  
   1.781 @@ -1563,7 +1815,7 @@ value of the field
   1.782  \subsubsection{RPC name:~set\_user\_version}
   1.783  
   1.784  {\bf Overview:} 
   1.785 -set accessor message derived from field user\_version of object VM
   1.786 +Set the user\_version field of the given VM.
   1.787  
   1.788   \noindent {\bf Signature:} 
   1.789  \begin{verbatim} void set_user_version (session_id s, VM ref self, int value)\end{verbatim}
   1.790 @@ -1576,7 +1828,7 @@ set accessor message derived from field 
   1.791  \begin{tabular}{|c|c|p{7cm}|}
   1.792   \hline
   1.793  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.794 -{\tt VM ref } & self & object instance \\ \hline 
   1.795 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.796  
   1.797  {\tt int } & value & New value to set \\ \hline 
   1.798  
   1.799 @@ -1597,7 +1849,7 @@ void
   1.800  \subsubsection{RPC name:~get\_is\_a\_template}
   1.801  
   1.802  {\bf Overview:} 
   1.803 -get accessor message derived from field is\_a\_template of object VM
   1.804 +Get the is\_a\_template field of the given VM.
   1.805  
   1.806   \noindent {\bf Signature:} 
   1.807  \begin{verbatim} bool get_is_a_template (session_id s, VM ref self)\end{verbatim}
   1.808 @@ -1610,7 +1862,7 @@ get accessor message derived from field 
   1.809  \begin{tabular}{|c|c|p{7cm}|}
   1.810   \hline
   1.811  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.812 -{\tt VM ref } & self & object instance \\ \hline 
   1.813 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.814  
   1.815  \end{tabular}
   1.816  
   1.817 @@ -1629,7 +1881,7 @@ value of the field
   1.818  \subsubsection{RPC name:~set\_is\_a\_template}
   1.819  
   1.820  {\bf Overview:} 
   1.821 -set accessor message derived from field is\_a\_template of object VM
   1.822 +Set the is\_a\_template field of the given VM.
   1.823  
   1.824   \noindent {\bf Signature:} 
   1.825  \begin{verbatim} void set_is_a_template (session_id s, VM ref self, bool value)\end{verbatim}
   1.826 @@ -1642,7 +1894,73 @@ set accessor message derived from field 
   1.827  \begin{tabular}{|c|c|p{7cm}|}
   1.828   \hline
   1.829  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.830 -{\tt VM ref } & self & object instance \\ \hline 
   1.831 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.832 +
   1.833 +{\tt bool } & value & New value to set \\ \hline 
   1.834 +
   1.835 +\end{tabular}
   1.836 +
   1.837 +\vspace{0.3cm}
   1.838 +
   1.839 + \noindent {\bf Return Type:} 
   1.840 +{\tt 
   1.841 +void
   1.842 +}
   1.843 +
   1.844 +
   1.845 +
   1.846 +\vspace{0.3cm}
   1.847 +\vspace{0.3cm}
   1.848 +\vspace{0.3cm}
   1.849 +\subsubsection{RPC name:~get\_auto\_power\_on}
   1.850 +
   1.851 +{\bf Overview:} 
   1.852 +Get the auto\_power\_on field of the given VM.
   1.853 +
   1.854 + \noindent {\bf Signature:} 
   1.855 +\begin{verbatim} bool get_auto_power_on (session_id s, VM ref self)\end{verbatim}
   1.856 +
   1.857 +
   1.858 +\noindent{\bf Arguments:}
   1.859 +
   1.860 + 
   1.861 +\vspace{0.3cm}
   1.862 +\begin{tabular}{|c|c|p{7cm}|}
   1.863 + \hline
   1.864 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.865 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.866 +
   1.867 +\end{tabular}
   1.868 +
   1.869 +\vspace{0.3cm}
   1.870 +
   1.871 + \noindent {\bf Return Type:} 
   1.872 +{\tt 
   1.873 +bool
   1.874 +}
   1.875 +
   1.876 +
   1.877 +value of the field
   1.878 +\vspace{0.3cm}
   1.879 +\vspace{0.3cm}
   1.880 +\vspace{0.3cm}
   1.881 +\subsubsection{RPC name:~set\_auto\_power\_on}
   1.882 +
   1.883 +{\bf Overview:} 
   1.884 +Set the auto\_power\_on field of the given VM.
   1.885 +
   1.886 + \noindent {\bf Signature:} 
   1.887 +\begin{verbatim} void set_auto_power_on (session_id s, VM ref self, bool value)\end{verbatim}
   1.888 +
   1.889 +
   1.890 +\noindent{\bf Arguments:}
   1.891 +
   1.892 + 
   1.893 +\vspace{0.3cm}
   1.894 +\begin{tabular}{|c|c|p{7cm}|}
   1.895 + \hline
   1.896 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.897 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.898  
   1.899  {\tt bool } & value & New value to set \\ \hline 
   1.900  
   1.901 @@ -1663,7 +1981,7 @@ void
   1.902  \subsubsection{RPC name:~get\_resident\_on}
   1.903  
   1.904  {\bf Overview:} 
   1.905 -get accessor message derived from field resident\_on of object VM
   1.906 +Get the resident\_on field of the given VM.
   1.907  
   1.908   \noindent {\bf Signature:} 
   1.909  \begin{verbatim} (host ref) get_resident_on (session_id s, VM ref self)\end{verbatim}
   1.910 @@ -1676,7 +1994,7 @@ get accessor message derived from field 
   1.911  \begin{tabular}{|c|c|p{7cm}|}
   1.912   \hline
   1.913  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.914 -{\tt VM ref } & self & object instance \\ \hline 
   1.915 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.916  
   1.917  \end{tabular}
   1.918  
   1.919 @@ -1695,7 +2013,7 @@ value of the field
   1.920  \subsubsection{RPC name:~get\_memory\_static\_max}
   1.921  
   1.922  {\bf Overview:} 
   1.923 -get accessor message derived from field memory/static\_max of object VM
   1.924 +Get the memory/static\_max field of the given VM.
   1.925  
   1.926   \noindent {\bf Signature:} 
   1.927  \begin{verbatim} int get_memory_static_max (session_id s, VM ref self)\end{verbatim}
   1.928 @@ -1708,7 +2026,7 @@ get accessor message derived from field 
   1.929  \begin{tabular}{|c|c|p{7cm}|}
   1.930   \hline
   1.931  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.932 -{\tt VM ref } & self & object instance \\ \hline 
   1.933 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.934  
   1.935  \end{tabular}
   1.936  
   1.937 @@ -1727,7 +2045,7 @@ value of the field
   1.938  \subsubsection{RPC name:~get\_memory\_dynamic\_max}
   1.939  
   1.940  {\bf Overview:} 
   1.941 -get accessor message derived from field memory/dynamic\_max of object VM
   1.942 +Get the memory/dynamic\_max field of the given VM.
   1.943  
   1.944   \noindent {\bf Signature:} 
   1.945  \begin{verbatim} int get_memory_dynamic_max (session_id s, VM ref self)\end{verbatim}
   1.946 @@ -1740,7 +2058,7 @@ get accessor message derived from field 
   1.947  \begin{tabular}{|c|c|p{7cm}|}
   1.948   \hline
   1.949  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.950 -{\tt VM ref } & self & object instance \\ \hline 
   1.951 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.952  
   1.953  \end{tabular}
   1.954  
   1.955 @@ -1759,7 +2077,7 @@ value of the field
   1.956  \subsubsection{RPC name:~set\_memory\_dynamic\_max}
   1.957  
   1.958  {\bf Overview:} 
   1.959 -set accessor message derived from field memory/dynamic\_max of object VM
   1.960 +Set the memory/dynamic\_max field of the given VM.
   1.961  
   1.962   \noindent {\bf Signature:} 
   1.963  \begin{verbatim} void set_memory_dynamic_max (session_id s, VM ref self, int value)\end{verbatim}
   1.964 @@ -1772,7 +2090,7 @@ set accessor message derived from field 
   1.965  \begin{tabular}{|c|c|p{7cm}|}
   1.966   \hline
   1.967  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.968 -{\tt VM ref } & self & object instance \\ \hline 
   1.969 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.970  
   1.971  {\tt int } & value & New value to set \\ \hline 
   1.972  
   1.973 @@ -1793,7 +2111,7 @@ void
   1.974  \subsubsection{RPC name:~get\_memory\_actual}
   1.975  
   1.976  {\bf Overview:} 
   1.977 -get accessor message derived from field memory/actual of object VM
   1.978 +Get the memory/actual field of the given VM.
   1.979  
   1.980   \noindent {\bf Signature:} 
   1.981  \begin{verbatim} int get_memory_actual (session_id s, VM ref self)\end{verbatim}
   1.982 @@ -1806,7 +2124,7 @@ get accessor message derived from field 
   1.983  \begin{tabular}{|c|c|p{7cm}|}
   1.984   \hline
   1.985  {\bf type} & {\bf name} & {\bf description} \\ \hline
   1.986 -{\tt VM ref } & self & object instance \\ \hline 
   1.987 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.988  
   1.989  \end{tabular}
   1.990  
   1.991 @@ -1825,7 +2143,7 @@ value of the field
   1.992  \subsubsection{RPC name:~get\_memory\_dynamic\_min}
   1.993  
   1.994  {\bf Overview:} 
   1.995 -get accessor message derived from field memory/dynamic\_min of object VM
   1.996 +Get the memory/dynamic\_min field of the given VM.
   1.997  
   1.998   \noindent {\bf Signature:} 
   1.999  \begin{verbatim} int get_memory_dynamic_min (session_id s, VM ref self)\end{verbatim}
  1.1000 @@ -1838,7 +2156,7 @@ get accessor message derived from field 
  1.1001  \begin{tabular}{|c|c|p{7cm}|}
  1.1002   \hline
  1.1003  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1004 -{\tt VM ref } & self & object instance \\ \hline 
  1.1005 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1006  
  1.1007  \end{tabular}
  1.1008  
  1.1009 @@ -1857,7 +2175,7 @@ value of the field
  1.1010  \subsubsection{RPC name:~set\_memory\_dynamic\_min}
  1.1011  
  1.1012  {\bf Overview:} 
  1.1013 -set accessor message derived from field memory/dynamic\_min of object VM
  1.1014 +Set the memory/dynamic\_min field of the given VM.
  1.1015  
  1.1016   \noindent {\bf Signature:} 
  1.1017  \begin{verbatim} void set_memory_dynamic_min (session_id s, VM ref self, int value)\end{verbatim}
  1.1018 @@ -1870,7 +2188,7 @@ set accessor message derived from field 
  1.1019  \begin{tabular}{|c|c|p{7cm}|}
  1.1020   \hline
  1.1021  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1022 -{\tt VM ref } & self & object instance \\ \hline 
  1.1023 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1024  
  1.1025  {\tt int } & value & New value to set \\ \hline 
  1.1026  
  1.1027 @@ -1891,7 +2209,7 @@ void
  1.1028  \subsubsection{RPC name:~get\_memory\_static\_min}
  1.1029  
  1.1030  {\bf Overview:} 
  1.1031 -get accessor message derived from field memory/static\_min of object VM
  1.1032 +Get the memory/static\_min field of the given VM.
  1.1033  
  1.1034   \noindent {\bf Signature:} 
  1.1035  \begin{verbatim} int get_memory_static_min (session_id s, VM ref self)\end{verbatim}
  1.1036 @@ -1904,7 +2222,7 @@ get accessor message derived from field 
  1.1037  \begin{tabular}{|c|c|p{7cm}|}
  1.1038   \hline
  1.1039  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1040 -{\tt VM ref } & self & object instance \\ \hline 
  1.1041 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1042  
  1.1043  \end{tabular}
  1.1044  
  1.1045 @@ -1923,7 +2241,7 @@ value of the field
  1.1046  \subsubsection{RPC name:~get\_VCPUs\_policy}
  1.1047  
  1.1048  {\bf Overview:} 
  1.1049 -get accessor message derived from field VCPUs/policy of object VM
  1.1050 +Get the VCPUs/policy field of the given VM.
  1.1051  
  1.1052   \noindent {\bf Signature:} 
  1.1053  \begin{verbatim} string get_VCPUs_policy (session_id s, VM ref self)\end{verbatim}
  1.1054 @@ -1936,7 +2254,7 @@ get accessor message derived from field 
  1.1055  \begin{tabular}{|c|c|p{7cm}|}
  1.1056   \hline
  1.1057  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1058 -{\tt VM ref } & self & object instance \\ \hline 
  1.1059 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1060  
  1.1061  \end{tabular}
  1.1062  
  1.1063 @@ -1955,7 +2273,7 @@ value of the field
  1.1064  \subsubsection{RPC name:~set\_VCPUs\_policy}
  1.1065  
  1.1066  {\bf Overview:} 
  1.1067 -set accessor message derived from field VCPUs/policy of object VM
  1.1068 +Set the VCPUs/policy field of the given VM.
  1.1069  
  1.1070   \noindent {\bf Signature:} 
  1.1071  \begin{verbatim} void set_VCPUs_policy (session_id s, VM ref self, string value)\end{verbatim}
  1.1072 @@ -1968,7 +2286,7 @@ set accessor message derived from field 
  1.1073  \begin{tabular}{|c|c|p{7cm}|}
  1.1074   \hline
  1.1075  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1076 -{\tt VM ref } & self & object instance \\ \hline 
  1.1077 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1078  
  1.1079  {\tt string } & value & New value to set \\ \hline 
  1.1080  
  1.1081 @@ -1989,7 +2307,7 @@ void
  1.1082  \subsubsection{RPC name:~get\_VCPUs\_params}
  1.1083  
  1.1084  {\bf Overview:} 
  1.1085 -get accessor message derived from field VCPUs/params of object VM
  1.1086 +Get the VCPUs/params field of the given VM.
  1.1087  
  1.1088   \noindent {\bf Signature:} 
  1.1089  \begin{verbatim} string get_VCPUs_params (session_id s, VM ref self)\end{verbatim}
  1.1090 @@ -2002,7 +2320,7 @@ get accessor message derived from field 
  1.1091  \begin{tabular}{|c|c|p{7cm}|}
  1.1092   \hline
  1.1093  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1094 -{\tt VM ref } & self & object instance \\ \hline 
  1.1095 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1096  
  1.1097  \end{tabular}
  1.1098  
  1.1099 @@ -2021,7 +2339,7 @@ value of the field
  1.1100  \subsubsection{RPC name:~set\_VCPUs\_params}
  1.1101  
  1.1102  {\bf Overview:} 
  1.1103 -set accessor message derived from field VCPUs/params of object VM
  1.1104 +Set the VCPUs/params field of the given VM.
  1.1105  
  1.1106   \noindent {\bf Signature:} 
  1.1107  \begin{verbatim} void set_VCPUs_params (session_id s, VM ref self, string value)\end{verbatim}
  1.1108 @@ -2034,7 +2352,7 @@ set accessor message derived from field 
  1.1109  \begin{tabular}{|c|c|p{7cm}|}
  1.1110   \hline
  1.1111  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1112 -{\tt VM ref } & self & object instance \\ \hline 
  1.1113 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1114  
  1.1115  {\tt string } & value & New value to set \\ \hline 
  1.1116  
  1.1117 @@ -2055,7 +2373,7 @@ void
  1.1118  \subsubsection{RPC name:~get\_VCPUs\_number}
  1.1119  
  1.1120  {\bf Overview:} 
  1.1121 -get accessor message derived from field VCPUs/number of object VM
  1.1122 +Get the VCPUs/number field of the given VM.
  1.1123  
  1.1124   \noindent {\bf Signature:} 
  1.1125  \begin{verbatim} int get_VCPUs_number (session_id s, VM ref self)\end{verbatim}
  1.1126 @@ -2068,7 +2386,7 @@ get accessor message derived from field 
  1.1127  \begin{tabular}{|c|c|p{7cm}|}
  1.1128   \hline
  1.1129  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1130 -{\tt VM ref } & self & object instance \\ \hline 
  1.1131 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1132  
  1.1133  \end{tabular}
  1.1134  
  1.1135 @@ -2084,10 +2402,44 @@ value of the field
  1.1136  \vspace{0.3cm}
  1.1137  \vspace{0.3cm}
  1.1138  \vspace{0.3cm}
  1.1139 +\subsubsection{RPC name:~set\_VCPUs\_number}
  1.1140 +
  1.1141 +{\bf Overview:} 
  1.1142 +Set the VCPUs/number field of the given VM.
  1.1143 +
  1.1144 + \noindent {\bf Signature:} 
  1.1145 +\begin{verbatim} void set_VCPUs_number (session_id s, VM ref self, int value)\end{verbatim}
  1.1146 +
  1.1147 +
  1.1148 +\noindent{\bf Arguments:}
  1.1149 +
  1.1150 + 
  1.1151 +\vspace{0.3cm}
  1.1152 +\begin{tabular}{|c|c|p{7cm}|}
  1.1153 + \hline
  1.1154 +{\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1155 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1156 +
  1.1157 +{\tt int } & value & New value to set \\ \hline 
  1.1158 +
  1.1159 +\end{tabular}
  1.1160 +
  1.1161 +\vspace{0.3cm}
  1.1162 +
  1.1163 + \noindent {\bf Return Type:} 
  1.1164 +{\tt 
  1.1165 +void
  1.1166 +}
  1.1167 +
  1.1168 +
  1.1169 +
  1.1170 +\vspace{0.3cm}
  1.1171 +\vspace{0.3cm}
  1.1172 +\vspace{0.3cm}
  1.1173  \subsubsection{RPC name:~get\_VCPUs\_utilisation}
  1.1174  
  1.1175  {\bf Overview:} 
  1.1176 -get accessor message derived from field VCPUs/utilisation of object VM
  1.1177 +Get the VCPUs/utilisation field of the given VM.
  1.1178  
  1.1179   \noindent {\bf Signature:} 
  1.1180  \begin{verbatim} ((int -> float) Map) get_VCPUs_utilisation (session_id s, VM ref self)\end{verbatim}
  1.1181 @@ -2100,7 +2452,7 @@ get accessor message derived from field 
  1.1182  \begin{tabular}{|c|c|p{7cm}|}
  1.1183   \hline
  1.1184  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1185 -{\tt VM ref } & self & object instance \\ \hline 
  1.1186 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1187  
  1.1188  \end{tabular}
  1.1189  
  1.1190 @@ -2119,7 +2471,7 @@ value of the field
  1.1191  \subsubsection{RPC name:~get\_VCPUs\_features\_required}
  1.1192  
  1.1193  {\bf Overview:} 
  1.1194 -get accessor message derived from field VCPUs/features/required of object VM
  1.1195 +Get the VCPUs/features/required field of the given VM.
  1.1196  
  1.1197   \noindent {\bf Signature:} 
  1.1198  \begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_required (session_id s, VM ref self)\end{verbatim}
  1.1199 @@ -2132,7 +2484,7 @@ get accessor message derived from field 
  1.1200  \begin{tabular}{|c|c|p{7cm}|}
  1.1201   \hline
  1.1202  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1203 -{\tt VM ref } & self & object instance \\ \hline 
  1.1204 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1205  
  1.1206  \end{tabular}
  1.1207  
  1.1208 @@ -2151,7 +2503,7 @@ value of the field
  1.1209  \subsubsection{RPC name:~get\_VCPUs\_features\_can\_use}
  1.1210  
  1.1211  {\bf Overview:} 
  1.1212 -get accessor message derived from field VCPUs/features/can\_use of object VM
  1.1213 +Get the VCPUs/features/can\_use field of the given VM.
  1.1214  
  1.1215   \noindent {\bf Signature:} 
  1.1216  \begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_can_use (session_id s, VM ref self)\end{verbatim}
  1.1217 @@ -2164,7 +2516,7 @@ get accessor message derived from field 
  1.1218  \begin{tabular}{|c|c|p{7cm}|}
  1.1219   \hline
  1.1220  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1221 -{\tt VM ref } & self & object instance \\ \hline 
  1.1222 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1223  
  1.1224  \end{tabular}
  1.1225  
  1.1226 @@ -2183,7 +2535,7 @@ value of the field
  1.1227  \subsubsection{RPC name:~get\_VCPUs\_features\_force\_on}
  1.1228  
  1.1229  {\bf Overview:} 
  1.1230 -get accessor message derived from field VCPUs/features/force\_on of object VM
  1.1231 +Get the VCPUs/features/force\_on field of the given VM.
  1.1232  
  1.1233   \noindent {\bf Signature:} 
  1.1234  \begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_force_on (session_id s, VM ref self)\end{verbatim}
  1.1235 @@ -2196,7 +2548,7 @@ get accessor message derived from field 
  1.1236  \begin{tabular}{|c|c|p{7cm}|}
  1.1237   \hline
  1.1238  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1239 -{\tt VM ref } & self & object instance \\ \hline 
  1.1240 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1241  
  1.1242  \end{tabular}
  1.1243  
  1.1244 @@ -2212,6 +2564,40 @@ value of the field
  1.1245  \vspace{0.3cm}
  1.1246  \vspace{0.3cm}
  1.1247  \vspace{0.3cm}
  1.1248 +\subsubsection{RPC name:~set\_VCPUs\_features\_force\_on}
  1.1249 +
  1.1250 +{\bf Overview:} 
  1.1251 +Set the VCPUs/features/force\_on field of the given VM.
  1.1252 +
  1.1253 + \noindent {\bf Signature:} 
  1.1254 +\begin{verbatim} void set_VCPUs_features_force_on (session_id s, VM ref self, (cpu_feature) Set value)\end{verbatim}
  1.1255 +
  1.1256 +
  1.1257 +\noindent{\bf Arguments:}
  1.1258 +
  1.1259 + 
  1.1260 +\vspace{0.3cm}
  1.1261 +\begin{tabular}{|c|c|p{7cm}|}
  1.1262 + \hline
  1.1263 +{\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1264 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1265 +
  1.1266 +{\tt (cpu\_feature) Set } & value & New value to set \\ \hline 
  1.1267 +
  1.1268 +\end{tabular}
  1.1269 +
  1.1270 +\vspace{0.3cm}
  1.1271 +
  1.1272 + \noindent {\bf Return Type:} 
  1.1273 +{\tt 
  1.1274 +void
  1.1275 +}
  1.1276 +
  1.1277 +
  1.1278 +
  1.1279 +\vspace{0.3cm}
  1.1280 +\vspace{0.3cm}
  1.1281 +\vspace{0.3cm}
  1.1282  \subsubsection{RPC name:~add\_VCPUs\_features\_force\_on}
  1.1283  
  1.1284  {\bf Overview:} 
  1.1285 @@ -2228,7 +2614,7 @@ set add message derived from field VCPUs
  1.1286  \begin{tabular}{|c|c|p{7cm}|}
  1.1287   \hline
  1.1288  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1289 -{\tt VM ref } & self & object instance \\ \hline 
  1.1290 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1291  
  1.1292  {\tt cpu\_feature } & value & New value to add \\ \hline 
  1.1293  
  1.1294 @@ -2262,7 +2648,7 @@ set remove message derived from field VC
  1.1295  \begin{tabular}{|c|c|p{7cm}|}
  1.1296   \hline
  1.1297  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1298 -{\tt VM ref } & self & object instance \\ \hline 
  1.1299 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1300  
  1.1301  {\tt cpu\_feature } & value & Value to remove \\ \hline 
  1.1302  
  1.1303 @@ -2283,7 +2669,7 @@ void
  1.1304  \subsubsection{RPC name:~get\_VCPUs\_features\_force\_off}
  1.1305  
  1.1306  {\bf Overview:} 
  1.1307 -get accessor message derived from field VCPUs/features/force\_off of object VM
  1.1308 +Get the VCPUs/features/force\_off field of the given VM.
  1.1309  
  1.1310   \noindent {\bf Signature:} 
  1.1311  \begin{verbatim} ((cpu_feature) Set) get_VCPUs_features_force_off (session_id s, VM ref self)\end{verbatim}
  1.1312 @@ -2296,7 +2682,7 @@ get accessor message derived from field 
  1.1313  \begin{tabular}{|c|c|p{7cm}|}
  1.1314   \hline
  1.1315  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1316 -{\tt VM ref } & self & object instance \\ \hline 
  1.1317 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1318  
  1.1319  \end{tabular}
  1.1320  
  1.1321 @@ -2312,6 +2698,40 @@ value of the field
  1.1322  \vspace{0.3cm}
  1.1323  \vspace{0.3cm}
  1.1324  \vspace{0.3cm}
  1.1325 +\subsubsection{RPC name:~set\_VCPUs\_features\_force\_off}
  1.1326 +
  1.1327 +{\bf Overview:} 
  1.1328 +Set the VCPUs/features/force\_off field of the given VM.
  1.1329 +
  1.1330 + \noindent {\bf Signature:} 
  1.1331 +\begin{verbatim} void set_VCPUs_features_force_off (session_id s, VM ref self, (cpu_feature) Set value)\end{verbatim}
  1.1332 +
  1.1333 +
  1.1334 +\noindent{\bf Arguments:}
  1.1335 +
  1.1336 + 
  1.1337 +\vspace{0.3cm}
  1.1338 +\begin{tabular}{|c|c|p{7cm}|}
  1.1339 + \hline
  1.1340 +{\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1341 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1342 +
  1.1343 +{\tt (cpu\_feature) Set } & value & New value to set \\ \hline 
  1.1344 +
  1.1345 +\end{tabular}
  1.1346 +
  1.1347 +\vspace{0.3cm}
  1.1348 +
  1.1349 + \noindent {\bf Return Type:} 
  1.1350 +{\tt 
  1.1351 +void
  1.1352 +}
  1.1353 +
  1.1354 +
  1.1355 +
  1.1356 +\vspace{0.3cm}
  1.1357 +\vspace{0.3cm}
  1.1358 +\vspace{0.3cm}
  1.1359  \subsubsection{RPC name:~add\_VCPUs\_features\_force\_off}
  1.1360  
  1.1361  {\bf Overview:} 
  1.1362 @@ -2328,7 +2748,7 @@ set add message derived from field VCPUs
  1.1363  \begin{tabular}{|c|c|p{7cm}|}
  1.1364   \hline
  1.1365  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1366 -{\tt VM ref } & self & object instance \\ \hline 
  1.1367 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1368  
  1.1369  {\tt cpu\_feature } & value & New value to add \\ \hline 
  1.1370  
  1.1371 @@ -2362,7 +2782,7 @@ set remove message derived from field VC
  1.1372  \begin{tabular}{|c|c|p{7cm}|}
  1.1373   \hline
  1.1374  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1375 -{\tt VM ref } & self & object instance \\ \hline 
  1.1376 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1377  
  1.1378  {\tt cpu\_feature } & value & Value to remove \\ \hline 
  1.1379  
  1.1380 @@ -2383,7 +2803,7 @@ void
  1.1381  \subsubsection{RPC name:~get\_actions\_after\_shutdown}
  1.1382  
  1.1383  {\bf Overview:} 
  1.1384 -get accessor message derived from field actions/after\_shutdown of object VM
  1.1385 +Get the actions/after\_shutdown field of the given VM.
  1.1386  
  1.1387   \noindent {\bf Signature:} 
  1.1388  \begin{verbatim} (on_normal_exit) get_actions_after_shutdown (session_id s, VM ref self)\end{verbatim}
  1.1389 @@ -2396,7 +2816,7 @@ get accessor message derived from field 
  1.1390  \begin{tabular}{|c|c|p{7cm}|}
  1.1391   \hline
  1.1392  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1393 -{\tt VM ref } & self & object instance \\ \hline 
  1.1394 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1395  
  1.1396  \end{tabular}
  1.1397  
  1.1398 @@ -2415,7 +2835,7 @@ value of the field
  1.1399  \subsubsection{RPC name:~set\_actions\_after\_shutdown}
  1.1400  
  1.1401  {\bf Overview:} 
  1.1402 -set accessor message derived from field actions/after\_shutdown of object VM
  1.1403 +Set the actions/after\_shutdown field of the given VM.
  1.1404  
  1.1405   \noindent {\bf Signature:} 
  1.1406  \begin{verbatim} void set_actions_after_shutdown (session_id s, VM ref self, on_normal_exit value)\end{verbatim}
  1.1407 @@ -2428,7 +2848,7 @@ set accessor message derived from field 
  1.1408  \begin{tabular}{|c|c|p{7cm}|}
  1.1409   \hline
  1.1410  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1411 -{\tt VM ref } & self & object instance \\ \hline 
  1.1412 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1413  
  1.1414  {\tt on\_normal\_exit } & value & New value to set \\ \hline 
  1.1415  
  1.1416 @@ -2449,7 +2869,7 @@ void
  1.1417  \subsubsection{RPC name:~get\_actions\_after\_reboot}
  1.1418  
  1.1419  {\bf Overview:} 
  1.1420 -get accessor message derived from field actions/after\_reboot of object VM
  1.1421 +Get the actions/after\_reboot field of the given VM.
  1.1422  
  1.1423   \noindent {\bf Signature:} 
  1.1424  \begin{verbatim} (on_normal_exit) get_actions_after_reboot (session_id s, VM ref self)\end{verbatim}
  1.1425 @@ -2462,7 +2882,7 @@ get accessor message derived from field 
  1.1426  \begin{tabular}{|c|c|p{7cm}|}
  1.1427   \hline
  1.1428  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1429 -{\tt VM ref } & self & object instance \\ \hline 
  1.1430 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1431  
  1.1432  \end{tabular}
  1.1433  
  1.1434 @@ -2481,7 +2901,7 @@ value of the field
  1.1435  \subsubsection{RPC name:~set\_actions\_after\_reboot}
  1.1436  
  1.1437  {\bf Overview:} 
  1.1438 -set accessor message derived from field actions/after\_reboot of object VM
  1.1439 +Set the actions/after\_reboot field of the given VM.
  1.1440  
  1.1441   \noindent {\bf Signature:} 
  1.1442  \begin{verbatim} void set_actions_after_reboot (session_id s, VM ref self, on_normal_exit value)\end{verbatim}
  1.1443 @@ -2494,7 +2914,7 @@ set accessor message derived from field 
  1.1444  \begin{tabular}{|c|c|p{7cm}|}
  1.1445   \hline
  1.1446  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1447 -{\tt VM ref } & self & object instance \\ \hline 
  1.1448 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1449  
  1.1450  {\tt on\_normal\_exit } & value & New value to set \\ \hline 
  1.1451  
  1.1452 @@ -2515,7 +2935,7 @@ void
  1.1453  \subsubsection{RPC name:~get\_actions\_after\_suspend}
  1.1454  
  1.1455  {\bf Overview:} 
  1.1456 -get accessor message derived from field actions/after\_suspend of object VM
  1.1457 +Get the actions/after\_suspend field of the given VM.
  1.1458  
  1.1459   \noindent {\bf Signature:} 
  1.1460  \begin{verbatim} (on_normal_exit) get_actions_after_suspend (session_id s, VM ref self)\end{verbatim}
  1.1461 @@ -2528,7 +2948,7 @@ get accessor message derived from field 
  1.1462  \begin{tabular}{|c|c|p{7cm}|}
  1.1463   \hline
  1.1464  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1465 -{\tt VM ref } & self & object instance \\ \hline 
  1.1466 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1467  
  1.1468  \end{tabular}
  1.1469  
  1.1470 @@ -2547,7 +2967,7 @@ value of the field
  1.1471  \subsubsection{RPC name:~set\_actions\_after\_suspend}
  1.1472  
  1.1473  {\bf Overview:} 
  1.1474 -set accessor message derived from field actions/after\_suspend of object VM
  1.1475 +Set the actions/after\_suspend field of the given VM.
  1.1476  
  1.1477   \noindent {\bf Signature:} 
  1.1478  \begin{verbatim} void set_actions_after_suspend (session_id s, VM ref self, on_normal_exit value)\end{verbatim}
  1.1479 @@ -2560,7 +2980,7 @@ set accessor message derived from field 
  1.1480  \begin{tabular}{|c|c|p{7cm}|}
  1.1481   \hline
  1.1482  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1483 -{\tt VM ref } & self & object instance \\ \hline 
  1.1484 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1485  
  1.1486  {\tt on\_normal\_exit } & value & New value to set \\ \hline 
  1.1487  
  1.1488 @@ -2581,7 +3001,7 @@ void
  1.1489  \subsubsection{RPC name:~get\_actions\_after\_crash}
  1.1490  
  1.1491  {\bf Overview:} 
  1.1492 -get accessor message derived from field actions/after\_crash of object VM
  1.1493 +Get the actions/after\_crash field of the given VM.
  1.1494  
  1.1495   \noindent {\bf Signature:} 
  1.1496  \begin{verbatim} (on_crash_behaviour) get_actions_after_crash (session_id s, VM ref self)\end{verbatim}
  1.1497 @@ -2594,7 +3014,7 @@ get accessor message derived from field 
  1.1498  \begin{tabular}{|c|c|p{7cm}|}
  1.1499   \hline
  1.1500  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1501 -{\tt VM ref } & self & object instance \\ \hline 
  1.1502 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1503  
  1.1504  \end{tabular}
  1.1505  
  1.1506 @@ -2613,7 +3033,7 @@ value of the field
  1.1507  \subsubsection{RPC name:~set\_actions\_after\_crash}
  1.1508  
  1.1509  {\bf Overview:} 
  1.1510 -set accessor message derived from field actions/after\_crash of object VM
  1.1511 +Set the actions/after\_crash field of the given VM.
  1.1512  
  1.1513   \noindent {\bf Signature:} 
  1.1514  \begin{verbatim} void set_actions_after_crash (session_id s, VM ref self, on_crash_behaviour value)\end{verbatim}
  1.1515 @@ -2626,7 +3046,7 @@ set accessor message derived from field 
  1.1516  \begin{tabular}{|c|c|p{7cm}|}
  1.1517   \hline
  1.1518  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1519 -{\tt VM ref } & self & object instance \\ \hline 
  1.1520 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1521  
  1.1522  {\tt on\_crash\_behaviour } & value & New value to set \\ \hline 
  1.1523  
  1.1524 @@ -2660,7 +3080,7 @@ Get the consoles field of the given VM.
  1.1525  \begin{tabular}{|c|c|p{7cm}|}
  1.1526   \hline
  1.1527  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1528 -{\tt VM ref } & self & object instance \\ \hline 
  1.1529 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1530  
  1.1531  \end{tabular}
  1.1532  
  1.1533 @@ -2679,7 +3099,7 @@ value of the field
  1.1534  \subsubsection{RPC name:~get\_VIFs}
  1.1535  
  1.1536  {\bf Overview:} 
  1.1537 -get accessor message derived from field VIFs of object VM
  1.1538 +Get the VIFs field of the given VM.
  1.1539  
  1.1540   \noindent {\bf Signature:} 
  1.1541  \begin{verbatim} ((VIF ref) Set) get_VIFs (session_id s, VM ref self)\end{verbatim}
  1.1542 @@ -2692,7 +3112,7 @@ get accessor message derived from field 
  1.1543  \begin{tabular}{|c|c|p{7cm}|}
  1.1544   \hline
  1.1545  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1546 -{\tt VM ref } & self & object instance \\ \hline 
  1.1547 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1548  
  1.1549  \end{tabular}
  1.1550  
  1.1551 @@ -2711,7 +3131,7 @@ value of the field
  1.1552  \subsubsection{RPC name:~get\_VBDs}
  1.1553  
  1.1554  {\bf Overview:} 
  1.1555 -get accessor message derived from field VBDs of object VM
  1.1556 +Get the VBDs field of the given VM.
  1.1557  
  1.1558   \noindent {\bf Signature:} 
  1.1559  \begin{verbatim} ((VBD ref) Set) get_VBDs (session_id s, VM ref self)\end{verbatim}
  1.1560 @@ -2724,7 +3144,7 @@ get accessor message derived from field 
  1.1561  \begin{tabular}{|c|c|p{7cm}|}
  1.1562   \hline
  1.1563  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1564 -{\tt VM ref } & self & object instance \\ \hline 
  1.1565 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1566  
  1.1567  \end{tabular}
  1.1568  
  1.1569 @@ -2743,7 +3163,7 @@ value of the field
  1.1570  \subsubsection{RPC name:~get\_VTPMs}
  1.1571  
  1.1572  {\bf Overview:} 
  1.1573 -get accessor message derived from field VTPMs of object VM
  1.1574 +Get the VTPMs field of the given VM.
  1.1575  
  1.1576   \noindent {\bf Signature:} 
  1.1577  \begin{verbatim} ((VTPM ref) Set) get_VTPMs (session_id s, VM ref self)\end{verbatim}
  1.1578 @@ -2756,7 +3176,7 @@ get accessor message derived from field 
  1.1579  \begin{tabular}{|c|c|p{7cm}|}
  1.1580   \hline
  1.1581  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1582 -{\tt VM ref } & self & object instance \\ \hline 
  1.1583 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1584  
  1.1585  \end{tabular}
  1.1586  
  1.1587 @@ -2775,7 +3195,7 @@ value of the field
  1.1588  \subsubsection{RPC name:~get\_bios\_boot}
  1.1589  
  1.1590  {\bf Overview:} 
  1.1591 -get accessor message derived from field bios/boot of object VM
  1.1592 +Get the bios/boot field of the given VM.
  1.1593  
  1.1594   \noindent {\bf Signature:} 
  1.1595  \begin{verbatim} string get_bios_boot (session_id s, VM ref self)\end{verbatim}
  1.1596 @@ -2788,7 +3208,7 @@ get accessor message derived from field 
  1.1597  \begin{tabular}{|c|c|p{7cm}|}
  1.1598   \hline
  1.1599  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1600 -{\tt VM ref } & self & object instance \\ \hline 
  1.1601 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1602  
  1.1603  \end{tabular}
  1.1604  
  1.1605 @@ -2807,7 +3227,7 @@ value of the field
  1.1606  \subsubsection{RPC name:~set\_bios\_boot}
  1.1607  
  1.1608  {\bf Overview:} 
  1.1609 -set accessor message derived from field bios/boot of object VM
  1.1610 +Set the bios/boot field of the given VM.
  1.1611  
  1.1612   \noindent {\bf Signature:} 
  1.1613  \begin{verbatim} void set_bios_boot (session_id s, VM ref self, string value)\end{verbatim}
  1.1614 @@ -2820,7 +3240,7 @@ set accessor message derived from field 
  1.1615  \begin{tabular}{|c|c|p{7cm}|}
  1.1616   \hline
  1.1617  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1618 -{\tt VM ref } & self & object instance \\ \hline 
  1.1619 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1620  
  1.1621  {\tt string } & value & New value to set \\ \hline 
  1.1622  
  1.1623 @@ -2841,7 +3261,7 @@ void
  1.1624  \subsubsection{RPC name:~get\_platform\_std\_VGA}
  1.1625  
  1.1626  {\bf Overview:} 
  1.1627 -get accessor message derived from field platform/std\_VGA of object VM
  1.1628 +Get the platform/std\_VGA field of the given VM.
  1.1629  
  1.1630   \noindent {\bf Signature:} 
  1.1631  \begin{verbatim} bool get_platform_std_VGA (session_id s, VM ref self)\end{verbatim}
  1.1632 @@ -2854,7 +3274,7 @@ get accessor message derived from field 
  1.1633  \begin{tabular}{|c|c|p{7cm}|}
  1.1634   \hline
  1.1635  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1636 -{\tt VM ref } & self & object instance \\ \hline 
  1.1637 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1638  
  1.1639  \end{tabular}
  1.1640  
  1.1641 @@ -2873,7 +3293,7 @@ value of the field
  1.1642  \subsubsection{RPC name:~set\_platform\_std\_VGA}
  1.1643  
  1.1644  {\bf Overview:} 
  1.1645 -set accessor message derived from field platform/std\_VGA of object VM
  1.1646 +Set the platform/std\_VGA field of the given VM.
  1.1647  
  1.1648   \noindent {\bf Signature:} 
  1.1649  \begin{verbatim} void set_platform_std_VGA (session_id s, VM ref self, bool value)\end{verbatim}
  1.1650 @@ -2886,7 +3306,7 @@ set accessor message derived from field 
  1.1651  \begin{tabular}{|c|c|p{7cm}|}
  1.1652   \hline
  1.1653  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1654 -{\tt VM ref } & self & object instance \\ \hline 
  1.1655 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1656  
  1.1657  {\tt bool } & value & New value to set \\ \hline 
  1.1658  
  1.1659 @@ -2907,7 +3327,7 @@ void
  1.1660  \subsubsection{RPC name:~get\_platform\_serial}
  1.1661  
  1.1662  {\bf Overview:} 
  1.1663 -get accessor message derived from field platform/serial of object VM
  1.1664 +Get the platform/serial field of the given VM.
  1.1665  
  1.1666   \noindent {\bf Signature:} 
  1.1667  \begin{verbatim} string get_platform_serial (session_id s, VM ref self)\end{verbatim}
  1.1668 @@ -2920,7 +3340,7 @@ get accessor message derived from field 
  1.1669  \begin{tabular}{|c|c|p{7cm}|}
  1.1670   \hline
  1.1671  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1672 -{\tt VM ref } & self & object instance \\ \hline 
  1.1673 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1674  
  1.1675  \end{tabular}
  1.1676  
  1.1677 @@ -2939,7 +3359,7 @@ value of the field
  1.1678  \subsubsection{RPC name:~set\_platform\_serial}
  1.1679  
  1.1680  {\bf Overview:} 
  1.1681 -set accessor message derived from field platform/serial of object VM
  1.1682 +Set the platform/serial field of the given VM.
  1.1683  
  1.1684   \noindent {\bf Signature:} 
  1.1685  \begin{verbatim} void set_platform_serial (session_id s, VM ref self, string value)\end{verbatim}
  1.1686 @@ -2952,7 +3372,7 @@ set accessor message derived from field 
  1.1687  \begin{tabular}{|c|c|p{7cm}|}
  1.1688   \hline
  1.1689  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1690 -{\tt VM ref } & self & object instance \\ \hline 
  1.1691 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1692  
  1.1693  {\tt string } & value & New value to set \\ \hline 
  1.1694  
  1.1695 @@ -2973,7 +3393,7 @@ void
  1.1696  \subsubsection{RPC name:~get\_platform\_localtime}
  1.1697  
  1.1698  {\bf Overview:} 
  1.1699 -get accessor message derived from field platform/localtime of object VM
  1.1700 +Get the platform/localtime field of the given VM.
  1.1701  
  1.1702   \noindent {\bf Signature:} 
  1.1703  \begin{verbatim} bool get_platform_localtime (session_id s, VM ref self)\end{verbatim}
  1.1704 @@ -2986,7 +3406,7 @@ get accessor message derived from field 
  1.1705  \begin{tabular}{|c|c|p{7cm}|}
  1.1706   \hline
  1.1707  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1708 -{\tt VM ref } & self & object instance \\ \hline 
  1.1709 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1710  
  1.1711  \end{tabular}
  1.1712  
  1.1713 @@ -3005,7 +3425,7 @@ value of the field
  1.1714  \subsubsection{RPC name:~set\_platform\_localtime}
  1.1715  
  1.1716  {\bf Overview:} 
  1.1717 -set accessor message derived from field platform/localtime of object VM
  1.1718 +Set the platform/localtime field of the given VM.
  1.1719  
  1.1720   \noindent {\bf Signature:} 
  1.1721  \begin{verbatim} void set_platform_localtime (session_id s, VM ref self, bool value)\end{verbatim}
  1.1722 @@ -3018,7 +3438,7 @@ set accessor message derived from field 
  1.1723  \begin{tabular}{|c|c|p{7cm}|}
  1.1724   \hline
  1.1725  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1726 -{\tt VM ref } & self & object instance \\ \hline 
  1.1727 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1728  
  1.1729  {\tt bool } & value & New value to set \\ \hline 
  1.1730  
  1.1731 @@ -3039,7 +3459,7 @@ void
  1.1732  \subsubsection{RPC name:~get\_platform\_clock\_offset}
  1.1733  
  1.1734  {\bf Overview:} 
  1.1735 -get accessor message derived from field platform/clock\_offset of object VM
  1.1736 +Get the platform/clock\_offset field of the given VM.
  1.1737  
  1.1738   \noindent {\bf Signature:} 
  1.1739  \begin{verbatim} bool get_platform_clock_offset (session_id s, VM ref self)\end{verbatim}
  1.1740 @@ -3052,7 +3472,7 @@ get accessor message derived from field 
  1.1741  \begin{tabular}{|c|c|p{7cm}|}
  1.1742   \hline
  1.1743  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1744 -{\tt VM ref } & self & object instance \\ \hline 
  1.1745 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1746  
  1.1747  \end{tabular}
  1.1748  
  1.1749 @@ -3071,7 +3491,7 @@ value of the field
  1.1750  \subsubsection{RPC name:~set\_platform\_clock\_offset}
  1.1751  
  1.1752  {\bf Overview:} 
  1.1753 -set accessor message derived from field platform/clock\_offset of object VM
  1.1754 +Set the platform/clock\_offset field of the given VM.
  1.1755  
  1.1756   \noindent {\bf Signature:} 
  1.1757  \begin{verbatim} void set_platform_clock_offset (session_id s, VM ref self, bool value)\end{verbatim}
  1.1758 @@ -3084,7 +3504,7 @@ set accessor message derived from field 
  1.1759  \begin{tabular}{|c|c|p{7cm}|}
  1.1760   \hline
  1.1761  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1762 -{\tt VM ref } & self & object instance \\ \hline 
  1.1763 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1764  
  1.1765  {\tt bool } & value & New value to set \\ \hline 
  1.1766  
  1.1767 @@ -3105,7 +3525,7 @@ void
  1.1768  \subsubsection{RPC name:~get\_platform\_enable\_audio}
  1.1769  
  1.1770  {\bf Overview:} 
  1.1771 -get accessor message derived from field platform/enable\_audio of object VM
  1.1772 +Get the platform/enable\_audio field of the given VM.
  1.1773  
  1.1774   \noindent {\bf Signature:} 
  1.1775  \begin{verbatim} bool get_platform_enable_audio (session_id s, VM ref self)\end{verbatim}
  1.1776 @@ -3118,7 +3538,7 @@ get accessor message derived from field 
  1.1777  \begin{tabular}{|c|c|p{7cm}|}
  1.1778   \hline
  1.1779  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1780 -{\tt VM ref } & self & object instance \\ \hline 
  1.1781 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1782  
  1.1783  \end{tabular}
  1.1784  
  1.1785 @@ -3137,7 +3557,7 @@ value of the field
  1.1786  \subsubsection{RPC name:~set\_platform\_enable\_audio}
  1.1787  
  1.1788  {\bf Overview:} 
  1.1789 -set accessor message derived from field platform/enable\_audio of object VM
  1.1790 +Set the platform/enable\_audio field of the given VM.
  1.1791  
  1.1792   \noindent {\bf Signature:} 
  1.1793  \begin{verbatim} void set_platform_enable_audio (session_id s, VM ref self, bool value)\end{verbatim}
  1.1794 @@ -3150,7 +3570,7 @@ set accessor message derived from field 
  1.1795  \begin{tabular}{|c|c|p{7cm}|}
  1.1796   \hline
  1.1797  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1798 -{\tt VM ref } & self & object instance \\ \hline 
  1.1799 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1800  
  1.1801  {\tt bool } & value & New value to set \\ \hline 
  1.1802  
  1.1803 @@ -3171,7 +3591,7 @@ void
  1.1804  \subsubsection{RPC name:~get\_builder}
  1.1805  
  1.1806  {\bf Overview:} 
  1.1807 -get accessor message derived from field builder of object VM
  1.1808 +Get the builder field of the given VM.
  1.1809  
  1.1810   \noindent {\bf Signature:} 
  1.1811  \begin{verbatim} string get_builder (session_id s, VM ref self)\end{verbatim}
  1.1812 @@ -3184,7 +3604,7 @@ get accessor message derived from field 
  1.1813  \begin{tabular}{|c|c|p{7cm}|}
  1.1814   \hline
  1.1815  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1816 -{\tt VM ref } & self & object instance \\ \hline 
  1.1817 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1818  
  1.1819  \end{tabular}
  1.1820  
  1.1821 @@ -3203,7 +3623,7 @@ value of the field
  1.1822  \subsubsection{RPC name:~set\_builder}
  1.1823  
  1.1824  {\bf Overview:} 
  1.1825 -set accessor message derived from field builder of object VM
  1.1826 +Set the builder field of the given VM.
  1.1827  
  1.1828   \noindent {\bf Signature:} 
  1.1829  \begin{verbatim} void set_builder (session_id s, VM ref self, string value)\end{verbatim}
  1.1830 @@ -3216,7 +3636,7 @@ set accessor message derived from field 
  1.1831  \begin{tabular}{|c|c|p{7cm}|}
  1.1832   \hline
  1.1833  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1834 -{\tt VM ref } & self & object instance \\ \hline 
  1.1835 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1836  
  1.1837  {\tt string } & value & New value to set \\ \hline 
  1.1838  
  1.1839 @@ -3237,7 +3657,7 @@ void
  1.1840  \subsubsection{RPC name:~get\_boot\_method}
  1.1841  
  1.1842  {\bf Overview:} 
  1.1843 -get accessor message derived from field boot\_method of object VM
  1.1844 +Get the boot\_method field of the given VM.
  1.1845  
  1.1846   \noindent {\bf Signature:} 
  1.1847  \begin{verbatim} (boot_type) get_boot_method (session_id s, VM ref self)\end{verbatim}
  1.1848 @@ -3250,7 +3670,7 @@ get accessor message derived from field 
  1.1849  \begin{tabular}{|c|c|p{7cm}|}
  1.1850   \hline
  1.1851  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1852 -{\tt VM ref } & self & object instance \\ \hline 
  1.1853 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1854  
  1.1855  \end{tabular}
  1.1856  
  1.1857 @@ -3269,7 +3689,7 @@ value of the field
  1.1858  \subsubsection{RPC name:~set\_boot\_method}
  1.1859  
  1.1860  {\bf Overview:} 
  1.1861 -set accessor message derived from field boot\_method of object VM
  1.1862 +Set the boot\_method field of the given VM.
  1.1863  
  1.1864   \noindent {\bf Signature:} 
  1.1865  \begin{verbatim} void set_boot_method (session_id s, VM ref self, boot_type value)\end{verbatim}
  1.1866 @@ -3282,7 +3702,7 @@ set accessor message derived from field 
  1.1867  \begin{tabular}{|c|c|p{7cm}|}
  1.1868   \hline
  1.1869  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1870 -{\tt VM ref } & self & object instance \\ \hline 
  1.1871 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1872  
  1.1873  {\tt boot\_type } & value & New value to set \\ \hline 
  1.1874  
  1.1875 @@ -3303,7 +3723,7 @@ void
  1.1876  \subsubsection{RPC name:~get\_kernel\_kernel}
  1.1877  
  1.1878  {\bf Overview:} 
  1.1879 -get accessor message derived from field kernel/kernel of object VM
  1.1880 +Get the kernel/kernel field of the given VM.
  1.1881  
  1.1882   \noindent {\bf Signature:} 
  1.1883  \begin{verbatim} string get_kernel_kernel (session_id s, VM ref self)\end{verbatim}
  1.1884 @@ -3316,7 +3736,7 @@ get accessor message derived from field 
  1.1885  \begin{tabular}{|c|c|p{7cm}|}
  1.1886   \hline
  1.1887  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1888 -{\tt VM ref } & self & object instance \\ \hline 
  1.1889 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1890  
  1.1891  \end{tabular}
  1.1892  
  1.1893 @@ -3335,7 +3755,7 @@ value of the field
  1.1894  \subsubsection{RPC name:~set\_kernel\_kernel}
  1.1895  
  1.1896  {\bf Overview:} 
  1.1897 -set accessor message derived from field kernel/kernel of object VM
  1.1898 +Set the kernel/kernel field of the given VM.
  1.1899  
  1.1900   \noindent {\bf Signature:} 
  1.1901  \begin{verbatim} void set_kernel_kernel (session_id s, VM ref self, string value)\end{verbatim}
  1.1902 @@ -3348,7 +3768,7 @@ set accessor message derived from field 
  1.1903  \begin{tabular}{|c|c|p{7cm}|}
  1.1904   \hline
  1.1905  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1906 -{\tt VM ref } & self & object instance \\ \hline 
  1.1907 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1908  
  1.1909  {\tt string } & value & New value to set \\ \hline 
  1.1910  
  1.1911 @@ -3369,7 +3789,7 @@ void
  1.1912  \subsubsection{RPC name:~get\_kernel\_initrd}
  1.1913  
  1.1914  {\bf Overview:} 
  1.1915 -get accessor message derived from field kernel/initrd of object VM
  1.1916 +Get the kernel/initrd field of the given VM.
  1.1917  
  1.1918   \noindent {\bf Signature:} 
  1.1919  \begin{verbatim} string get_kernel_initrd (session_id s, VM ref self)\end{verbatim}
  1.1920 @@ -3382,7 +3802,7 @@ get accessor message derived from field 
  1.1921  \begin{tabular}{|c|c|p{7cm}|}
  1.1922   \hline
  1.1923  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1924 -{\tt VM ref } & self & object instance \\ \hline 
  1.1925 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1926  
  1.1927  \end{tabular}
  1.1928  
  1.1929 @@ -3401,7 +3821,7 @@ value of the field
  1.1930  \subsubsection{RPC name:~set\_kernel\_initrd}
  1.1931  
  1.1932  {\bf Overview:} 
  1.1933 -set accessor message derived from field kernel/initrd of object VM
  1.1934 +Set the kernel/initrd field of the given VM.
  1.1935  
  1.1936   \noindent {\bf Signature:} 
  1.1937  \begin{verbatim} void set_kernel_initrd (session_id s, VM ref self, string value)\end{verbatim}
  1.1938 @@ -3414,7 +3834,7 @@ set accessor message derived from field 
  1.1939  \begin{tabular}{|c|c|p{7cm}|}
  1.1940   \hline
  1.1941  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1942 -{\tt VM ref } & self & object instance \\ \hline 
  1.1943 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1944  
  1.1945  {\tt string } & value & New value to set \\ \hline 
  1.1946  
  1.1947 @@ -3435,7 +3855,7 @@ void
  1.1948  \subsubsection{RPC name:~get\_kernel\_args}
  1.1949  
  1.1950  {\bf Overview:} 
  1.1951 -get accessor message derived from field kernel/args of object VM
  1.1952 +Get the kernel/args field of the given VM.
  1.1953  
  1.1954   \noindent {\bf Signature:} 
  1.1955  \begin{verbatim} string get_kernel_args (session_id s, VM ref self)\end{verbatim}
  1.1956 @@ -3448,7 +3868,7 @@ get accessor message derived from field 
  1.1957  \begin{tabular}{|c|c|p{7cm}|}
  1.1958   \hline
  1.1959  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1960 -{\tt VM ref } & self & object instance \\ \hline 
  1.1961 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1962  
  1.1963  \end{tabular}
  1.1964  
  1.1965 @@ -3467,7 +3887,7 @@ value of the field
  1.1966  \subsubsection{RPC name:~set\_kernel\_args}
  1.1967  
  1.1968  {\bf Overview:} 
  1.1969 -set accessor message derived from field kernel/args of object VM
  1.1970 +Set the kernel/args field of the given VM.
  1.1971  
  1.1972   \noindent {\bf Signature:} 
  1.1973  \begin{verbatim} void set_kernel_args (session_id s, VM ref self, string value)\end{verbatim}
  1.1974 @@ -3480,7 +3900,7 @@ set accessor message derived from field 
  1.1975  \begin{tabular}{|c|c|p{7cm}|}
  1.1976   \hline
  1.1977  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1978 -{\tt VM ref } & self & object instance \\ \hline 
  1.1979 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1980  
  1.1981  {\tt string } & value & New value to set \\ \hline 
  1.1982  
  1.1983 @@ -3501,7 +3921,7 @@ void
  1.1984  \subsubsection{RPC name:~get\_grub\_cmdline}
  1.1985  
  1.1986  {\bf Overview:} 
  1.1987 -get accessor message derived from field grub/cmdline of object VM
  1.1988 +Get the grub/cmdline field of the given VM.
  1.1989  
  1.1990   \noindent {\bf Signature:} 
  1.1991  \begin{verbatim} string get_grub_cmdline (session_id s, VM ref self)\end{verbatim}
  1.1992 @@ -3514,7 +3934,7 @@ get accessor message derived from field 
  1.1993  \begin{tabular}{|c|c|p{7cm}|}
  1.1994   \hline
  1.1995  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.1996 -{\tt VM ref } & self & object instance \\ \hline 
  1.1997 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.1998  
  1.1999  \end{tabular}
  1.2000  
  1.2001 @@ -3533,7 +3953,7 @@ value of the field
  1.2002  \subsubsection{RPC name:~set\_grub\_cmdline}
  1.2003  
  1.2004  {\bf Overview:} 
  1.2005 -set accessor message derived from field grub/cmdline of object VM
  1.2006 +Set the grub/cmdline field of the given VM.
  1.2007  
  1.2008   \noindent {\bf Signature:} 
  1.2009  \begin{verbatim} void set_grub_cmdline (session_id s, VM ref self, string value)\end{verbatim}
  1.2010 @@ -3546,7 +3966,7 @@ set accessor message derived from field 
  1.2011  \begin{tabular}{|c|c|p{7cm}|}
  1.2012   \hline
  1.2013  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2014 -{\tt VM ref } & self & object instance \\ \hline 
  1.2015 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2016  
  1.2017  {\tt string } & value & New value to set \\ \hline 
  1.2018  
  1.2019 @@ -3567,7 +3987,7 @@ void
  1.2020  \subsubsection{RPC name:~get\_PCI\_bus}
  1.2021  
  1.2022  {\bf Overview:} 
  1.2023 -get accessor message derived from field PCI\_bus of object VM
  1.2024 +Get the PCI\_bus field of the given VM.
  1.2025  
  1.2026   \noindent {\bf Signature:} 
  1.2027  \begin{verbatim} string get_PCI_bus (session_id s, VM ref self)\end{verbatim}
  1.2028 @@ -3580,7 +4000,7 @@ get accessor message derived from field 
  1.2029  \begin{tabular}{|c|c|p{7cm}|}
  1.2030   \hline
  1.2031  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2032 -{\tt VM ref } & self & object instance \\ \hline 
  1.2033 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2034  
  1.2035  \end{tabular}
  1.2036  
  1.2037 @@ -3599,7 +4019,7 @@ value of the field
  1.2038  \subsubsection{RPC name:~get\_tools\_version}
  1.2039  
  1.2040  {\bf Overview:} 
  1.2041 -get accessor message derived from field tools\_version of object VM
  1.2042 +Get the tools\_version field of the given VM.
  1.2043  
  1.2044   \noindent {\bf Signature:} 
  1.2045  \begin{verbatim} ((string -> string) Map) get_tools_version (session_id s, VM ref self)\end{verbatim}
  1.2046 @@ -3612,7 +4032,7 @@ get accessor message derived from field 
  1.2047  \begin{tabular}{|c|c|p{7cm}|}
  1.2048   \hline
  1.2049  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2050 -{\tt VM ref } & self & object instance \\ \hline 
  1.2051 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2052  
  1.2053  \end{tabular}
  1.2054  
  1.2055 @@ -3631,7 +4051,7 @@ value of the field
  1.2056  \subsubsection{RPC name:~get\_otherConfig}
  1.2057  
  1.2058  {\bf Overview:} 
  1.2059 -get accessor message derived from field otherConfig of object VM
  1.2060 +Get the otherConfig field of the given VM.
  1.2061  
  1.2062   \noindent {\bf Signature:} 
  1.2063  \begin{verbatim} ((string -> string) Map) get_otherConfig (session_id s, VM ref self)\end{verbatim}
  1.2064 @@ -3644,7 +4064,7 @@ get accessor message derived from field 
  1.2065  \begin{tabular}{|c|c|p{7cm}|}
  1.2066   \hline
  1.2067  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2068 -{\tt VM ref } & self & object instance \\ \hline 
  1.2069 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2070  
  1.2071  \end{tabular}
  1.2072  
  1.2073 @@ -3660,6 +4080,40 @@ value of the field
  1.2074  \vspace{0.3cm}
  1.2075  \vspace{0.3cm}
  1.2076  \vspace{0.3cm}
  1.2077 +\subsubsection{RPC name:~set\_otherConfig}
  1.2078 +
  1.2079 +{\bf Overview:} 
  1.2080 +Set the otherConfig field of the given VM.
  1.2081 +
  1.2082 + \noindent {\bf Signature:} 
  1.2083 +\begin{verbatim} void set_otherConfig (session_id s, VM ref self, (string -> string) Map value)\end{verbatim}
  1.2084 +
  1.2085 +
  1.2086 +\noindent{\bf Arguments:}
  1.2087 +
  1.2088 + 
  1.2089 +\vspace{0.3cm}
  1.2090 +\begin{tabular}{|c|c|p{7cm}|}
  1.2091 + \hline
  1.2092 +{\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2093 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2094 +
  1.2095 +{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline 
  1.2096 +
  1.2097 +\end{tabular}
  1.2098 +
  1.2099 +\vspace{0.3cm}
  1.2100 +
  1.2101 + \noindent {\bf Return Type:} 
  1.2102 +{\tt 
  1.2103 +void
  1.2104 +}
  1.2105 +
  1.2106 +
  1.2107 +
  1.2108 +\vspace{0.3cm}
  1.2109 +\vspace{0.3cm}
  1.2110 +\vspace{0.3cm}
  1.2111  \subsubsection{RPC name:~add\_to\_otherConfig}
  1.2112  
  1.2113  {\bf Overview:} 
  1.2114 @@ -3676,7 +4130,7 @@ map add message derived from field other
  1.2115  \begin{tabular}{|c|c|p{7cm}|}
  1.2116   \hline
  1.2117  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2118 -{\tt VM ref } & self & object instance \\ \hline 
  1.2119 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2120  
  1.2121  {\tt string } & key & Key to add \\ \hline 
  1.2122  
  1.2123 @@ -3712,7 +4166,7 @@ map remove message derived from field ot
  1.2124  \begin{tabular}{|c|c|p{7cm}|}
  1.2125   \hline
  1.2126  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2127 -{\tt VM ref } & self & object instance \\ \hline 
  1.2128 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2129  
  1.2130  {\tt string } & key & Key to remove \\ \hline 
  1.2131  
  1.2132 @@ -3733,7 +4187,7 @@ void
  1.2133  \subsubsection{RPC name:~create}
  1.2134  
  1.2135  {\bf Overview:} 
  1.2136 -constructor for class VM
  1.2137 +Create a new VM instance, and return its handle.
  1.2138  
  1.2139   \noindent {\bf Signature:} 
  1.2140  \begin{verbatim} (VM ref) create (session_id s, VM record args)\end{verbatim}
  1.2141 @@ -3765,7 +4219,7 @@ reference to the newly created object
  1.2142  \subsubsection{RPC name:~destroy}
  1.2143  
  1.2144  {\bf Overview:} 
  1.2145 -destructor for class VM
  1.2146 +Destroy the specified VM.  The VM is completely removed from the system.  This function can only be called when the VM is in the Halted State.
  1.2147  
  1.2148   \noindent {\bf Signature:} 
  1.2149  \begin{verbatim} void destroy (session_id s, VM ref self)\end{verbatim}
  1.2150 @@ -3778,7 +4232,7 @@ destructor for class VM
  1.2151  \begin{tabular}{|c|c|p{7cm}|}
  1.2152   \hline
  1.2153  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2154 -{\tt VM ref } & self & object instance \\ \hline 
  1.2155 +{\tt VM ref } & self & reference to the object \\ \hline 
  1.2156  
  1.2157  \end{tabular}
  1.2158  
  1.2159 @@ -3797,7 +4251,7 @@ void
  1.2160  \subsubsection{RPC name:~get\_by\_uuid}
  1.2161  
  1.2162  {\bf Overview:} 
  1.2163 -returns the VM instance with a particular uuid
  1.2164 +Get a reference to the VM instance with the specified UUID.
  1.2165  
  1.2166   \noindent {\bf Signature:} 
  1.2167  \begin{verbatim} (VM ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.2168 @@ -3829,7 +4283,7 @@ reference to the object
  1.2169  \subsubsection{RPC name:~get\_record}
  1.2170  
  1.2171  {\bf Overview:} 
  1.2172 -returns a record containing the state of an instance of class VM
  1.2173 +Get a record containing the current state of the given VM.
  1.2174  
  1.2175   \noindent {\bf Signature:} 
  1.2176  \begin{verbatim} (VM record) get_record (session_id s, VM ref self)\end{verbatim}
  1.2177 @@ -3861,7 +4315,7 @@ all fields from the object
  1.2178  \subsubsection{RPC name:~get\_by\_name\_label}
  1.2179  
  1.2180  {\bf Overview:} 
  1.2181 -returns the VM instance with a particular name label
  1.2182 +Get all the VM instances with the given label.
  1.2183  
  1.2184   \noindent {\bf Signature:} 
  1.2185  \begin{verbatim} ((VM ref) Set) get_by_name_label (session_id s, string label)\end{verbatim}
  1.2186 @@ -4064,7 +4518,7 @@ A list of all the IDs of all the hosts
  1.2187  \subsubsection{RPC name:~get\_uuid}
  1.2188  
  1.2189  {\bf Overview:} 
  1.2190 -get accessor message derived from field uuid of object host
  1.2191 +Get the uuid field of the given host.
  1.2192  
  1.2193   \noindent {\bf Signature:} 
  1.2194  \begin{verbatim} string get_uuid (session_id s, host ref self)\end{verbatim}
  1.2195 @@ -4077,7 +4531,7 @@ get accessor message derived from field 
  1.2196  \begin{tabular}{|c|c|p{7cm}|}
  1.2197   \hline
  1.2198  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2199 -{\tt host ref } & self & object instance \\ \hline 
  1.2200 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2201  
  1.2202  \end{tabular}
  1.2203  
  1.2204 @@ -4096,7 +4550,7 @@ value of the field
  1.2205  \subsubsection{RPC name:~get\_name\_label}
  1.2206  
  1.2207  {\bf Overview:} 
  1.2208 -get accessor message derived from field name/label of object host
  1.2209 +Get the name/label field of the given host.
  1.2210  
  1.2211   \noindent {\bf Signature:} 
  1.2212  \begin{verbatim} string get_name_label (session_id s, host ref self)\end{verbatim}
  1.2213 @@ -4109,7 +4563,7 @@ get accessor message derived from field 
  1.2214  \begin{tabular}{|c|c|p{7cm}|}
  1.2215   \hline
  1.2216  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2217 -{\tt host ref } & self & object instance \\ \hline 
  1.2218 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2219  
  1.2220  \end{tabular}
  1.2221  
  1.2222 @@ -4128,7 +4582,7 @@ value of the field
  1.2223  \subsubsection{RPC name:~set\_name\_label}
  1.2224  
  1.2225  {\bf Overview:} 
  1.2226 -set accessor message derived from field name/label of object host
  1.2227 +Set the name/label field of the given host.
  1.2228  
  1.2229   \noindent {\bf Signature:} 
  1.2230  \begin{verbatim} void set_name_label (session_id s, host ref self, string value)\end{verbatim}
  1.2231 @@ -4141,7 +4595,7 @@ set accessor message derived from field 
  1.2232  \begin{tabular}{|c|c|p{7cm}|}
  1.2233   \hline
  1.2234  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2235 -{\tt host ref } & self & object instance \\ \hline 
  1.2236 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2237  
  1.2238  {\tt string } & value & New value to set \\ \hline 
  1.2239  
  1.2240 @@ -4162,7 +4616,7 @@ void
  1.2241  \subsubsection{RPC name:~get\_name\_description}
  1.2242  
  1.2243  {\bf Overview:} 
  1.2244 -get accessor message derived from field name/description of object host
  1.2245 +Get the name/description field of the given host.
  1.2246  
  1.2247   \noindent {\bf Signature:} 
  1.2248  \begin{verbatim} string get_name_description (session_id s, host ref self)\end{verbatim}
  1.2249 @@ -4175,7 +4629,7 @@ get accessor message derived from field 
  1.2250  \begin{tabular}{|c|c|p{7cm}|}
  1.2251   \hline
  1.2252  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2253 -{\tt host ref } & self & object instance \\ \hline 
  1.2254 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2255  
  1.2256  \end{tabular}
  1.2257  
  1.2258 @@ -4194,7 +4648,7 @@ value of the field
  1.2259  \subsubsection{RPC name:~set\_name\_description}
  1.2260  
  1.2261  {\bf Overview:} 
  1.2262 -set accessor message derived from field name/description of object host
  1.2263 +Set the name/description field of the given host.
  1.2264  
  1.2265   \noindent {\bf Signature:} 
  1.2266  \begin{verbatim} void set_name_description (session_id s, host ref self, string value)\end{verbatim}
  1.2267 @@ -4207,7 +4661,7 @@ set accessor message derived from field 
  1.2268  \begin{tabular}{|c|c|p{7cm}|}
  1.2269   \hline
  1.2270  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2271 -{\tt host ref } & self & object instance \\ \hline 
  1.2272 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2273  
  1.2274  {\tt string } & value & New value to set \\ \hline 
  1.2275  
  1.2276 @@ -4228,7 +4682,7 @@ void
  1.2277  \subsubsection{RPC name:~get\_software\_version}
  1.2278  
  1.2279  {\bf Overview:} 
  1.2280 -get accessor message derived from field software\_version of object host
  1.2281 +Get the software\_version field of the given host.
  1.2282  
  1.2283   \noindent {\bf Signature:} 
  1.2284  \begin{verbatim} ((string -> string) Map) get_software_version (session_id s, host ref self)\end{verbatim}
  1.2285 @@ -4241,7 +4695,7 @@ get accessor message derived from field 
  1.2286  \begin{tabular}{|c|c|p{7cm}|}
  1.2287   \hline
  1.2288  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2289 -{\tt host ref } & self & object instance \\ \hline 
  1.2290 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2291  
  1.2292  \end{tabular}
  1.2293  
  1.2294 @@ -4260,7 +4714,7 @@ value of the field
  1.2295  \subsubsection{RPC name:~get\_resident\_VMs}
  1.2296  
  1.2297  {\bf Overview:} 
  1.2298 -get accessor message derived from field resident\_VMs of object host
  1.2299 +Get the resident\_VMs field of the given host.
  1.2300  
  1.2301   \noindent {\bf Signature:} 
  1.2302  \begin{verbatim} ((VM ref) Set) get_resident_VMs (session_id s, host ref self)\end{verbatim}
  1.2303 @@ -4273,7 +4727,7 @@ get accessor message derived from field 
  1.2304  \begin{tabular}{|c|c|p{7cm}|}
  1.2305   \hline
  1.2306  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2307 -{\tt host ref } & self & object instance \\ \hline 
  1.2308 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2309  
  1.2310  \end{tabular}
  1.2311  
  1.2312 @@ -4292,7 +4746,7 @@ value of the field
  1.2313  \subsubsection{RPC name:~get\_PIFs}
  1.2314  
  1.2315  {\bf Overview:} 
  1.2316 -get accessor message derived from field PIFs of object host
  1.2317 +Get the PIFs field of the given host.
  1.2318  
  1.2319   \noindent {\bf Signature:} 
  1.2320  \begin{verbatim} ((PIF ref) Set) get_PIFs (session_id s, host ref self)\end{verbatim}
  1.2321 @@ -4305,7 +4759,7 @@ get accessor message derived from field 
  1.2322  \begin{tabular}{|c|c|p{7cm}|}
  1.2323   \hline
  1.2324  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2325 -{\tt host ref } & self & object instance \\ \hline 
  1.2326 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2327  
  1.2328  \end{tabular}
  1.2329  
  1.2330 @@ -4324,7 +4778,7 @@ value of the field
  1.2331  \subsubsection{RPC name:~get\_host\_CPUs}
  1.2332  
  1.2333  {\bf Overview:} 
  1.2334 -get accessor message derived from field host\_CPUs of object host
  1.2335 +Get the host\_CPUs field of the given host.
  1.2336  
  1.2337   \noindent {\bf Signature:} 
  1.2338  \begin{verbatim} ((host_cpu ref) Set) get_host_CPUs (session_id s, host ref self)\end{verbatim}
  1.2339 @@ -4337,7 +4791,7 @@ get accessor message derived from field 
  1.2340  \begin{tabular}{|c|c|p{7cm}|}
  1.2341   \hline
  1.2342  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2343 -{\tt host ref } & self & object instance \\ \hline 
  1.2344 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2345  
  1.2346  \end{tabular}
  1.2347  
  1.2348 @@ -4356,7 +4810,7 @@ value of the field
  1.2349  \subsubsection{RPC name:~create}
  1.2350  
  1.2351  {\bf Overview:} 
  1.2352 -constructor for class host
  1.2353 +Create a new host instance, and return its handle.
  1.2354  
  1.2355   \noindent {\bf Signature:} 
  1.2356  \begin{verbatim} (host ref) create (session_id s, host record args)\end{verbatim}
  1.2357 @@ -4388,7 +4842,7 @@ reference to the newly created object
  1.2358  \subsubsection{RPC name:~destroy}
  1.2359  
  1.2360  {\bf Overview:} 
  1.2361 -destructor for class host
  1.2362 +Destroy the specified host instance.
  1.2363  
  1.2364   \noindent {\bf Signature:} 
  1.2365  \begin{verbatim} void destroy (session_id s, host ref self)\end{verbatim}
  1.2366 @@ -4401,7 +4855,7 @@ destructor for class host
  1.2367  \begin{tabular}{|c|c|p{7cm}|}
  1.2368   \hline
  1.2369  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2370 -{\tt host ref } & self & object instance \\ \hline 
  1.2371 +{\tt host ref } & self & reference to the object \\ \hline 
  1.2372  
  1.2373  \end{tabular}
  1.2374  
  1.2375 @@ -4420,7 +4874,7 @@ void
  1.2376  \subsubsection{RPC name:~get\_by\_uuid}
  1.2377  
  1.2378  {\bf Overview:} 
  1.2379 -returns the host instance with a particular uuid
  1.2380 +Get a reference to the host instance with the specified UUID.
  1.2381  
  1.2382   \noindent {\bf Signature:} 
  1.2383  \begin{verbatim} (host ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.2384 @@ -4452,7 +4906,7 @@ reference to the object
  1.2385  \subsubsection{RPC name:~get\_record}
  1.2386  
  1.2387  {\bf Overview:} 
  1.2388 -returns a record containing the state of an instance of class host
  1.2389 +Get a record containing the current state of the given host.
  1.2390  
  1.2391   \noindent {\bf Signature:} 
  1.2392  \begin{verbatim} (host record) get_record (session_id s, host ref self)\end{verbatim}
  1.2393 @@ -4484,7 +4938,7 @@ all fields from the object
  1.2394  \subsubsection{RPC name:~get\_by\_name\_label}
  1.2395  
  1.2396  {\bf Overview:} 
  1.2397 -returns the host instance with a particular name label
  1.2398 +Get all the host instances with the given label.
  1.2399  
  1.2400   \noindent {\bf Signature:} 
  1.2401  \begin{verbatim} ((host ref) Set) get_by_name_label (session_id s, string label)\end{verbatim}
  1.2402 @@ -4539,7 +4993,7 @@ Quals & Field & Type & Description \\
  1.2403  \subsubsection{RPC name:~get\_uuid}
  1.2404  
  1.2405  {\bf Overview:} 
  1.2406 -get accessor message derived from field uuid of object host\_cpu
  1.2407 +Get the uuid field of the given host\_cpu.
  1.2408  
  1.2409   \noindent {\bf Signature:} 
  1.2410  \begin{verbatim} string get_uuid (session_id s, host_cpu ref self)\end{verbatim}
  1.2411 @@ -4552,7 +5006,7 @@ get accessor message derived from field 
  1.2412  \begin{tabular}{|c|c|p{7cm}|}
  1.2413   \hline
  1.2414  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2415 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2416 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2417  
  1.2418  \end{tabular}
  1.2419  
  1.2420 @@ -4571,7 +5025,7 @@ value of the field
  1.2421  \subsubsection{RPC name:~get\_host}
  1.2422  
  1.2423  {\bf Overview:} 
  1.2424 -get accessor message derived from field host of object host\_cpu
  1.2425 +Get the host field of the given host\_cpu.
  1.2426  
  1.2427   \noindent {\bf Signature:} 
  1.2428  \begin{verbatim} (host ref) get_host (session_id s, host_cpu ref self)\end{verbatim}
  1.2429 @@ -4584,7 +5038,7 @@ get accessor message derived from field 
  1.2430  \begin{tabular}{|c|c|p{7cm}|}
  1.2431   \hline
  1.2432  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2433 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2434 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2435  
  1.2436  \end{tabular}
  1.2437  
  1.2438 @@ -4603,7 +5057,7 @@ value of the field
  1.2439  \subsubsection{RPC name:~get\_number}
  1.2440  
  1.2441  {\bf Overview:} 
  1.2442 -get accessor message derived from field number of object host\_cpu
  1.2443 +Get the number field of the given host\_cpu.
  1.2444  
  1.2445   \noindent {\bf Signature:} 
  1.2446  \begin{verbatim} int get_number (session_id s, host_cpu ref self)\end{verbatim}
  1.2447 @@ -4616,7 +5070,7 @@ get accessor message derived from field 
  1.2448  \begin{tabular}{|c|c|p{7cm}|}
  1.2449   \hline
  1.2450  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2451 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2452 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2453  
  1.2454  \end{tabular}
  1.2455  
  1.2456 @@ -4635,7 +5089,7 @@ value of the field
  1.2457  \subsubsection{RPC name:~get\_vendor}
  1.2458  
  1.2459  {\bf Overview:} 
  1.2460 -get accessor message derived from field vendor of object host\_cpu
  1.2461 +Get the vendor field of the given host\_cpu.
  1.2462  
  1.2463   \noindent {\bf Signature:} 
  1.2464  \begin{verbatim} string get_vendor (session_id s, host_cpu ref self)\end{verbatim}
  1.2465 @@ -4648,7 +5102,7 @@ get accessor message derived from field 
  1.2466  \begin{tabular}{|c|c|p{7cm}|}
  1.2467   \hline
  1.2468  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2469 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2470 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2471  
  1.2472  \end{tabular}
  1.2473  
  1.2474 @@ -4667,7 +5121,7 @@ value of the field
  1.2475  \subsubsection{RPC name:~get\_speed}
  1.2476  
  1.2477  {\bf Overview:} 
  1.2478 -get accessor message derived from field speed of object host\_cpu
  1.2479 +Get the speed field of the given host\_cpu.
  1.2480  
  1.2481   \noindent {\bf Signature:} 
  1.2482  \begin{verbatim} int get_speed (session_id s, host_cpu ref self)\end{verbatim}
  1.2483 @@ -4680,7 +5134,7 @@ get accessor message derived from field 
  1.2484  \begin{tabular}{|c|c|p{7cm}|}
  1.2485   \hline
  1.2486  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2487 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2488 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2489  
  1.2490  \end{tabular}
  1.2491  
  1.2492 @@ -4699,7 +5153,7 @@ value of the field
  1.2493  \subsubsection{RPC name:~get\_modelname}
  1.2494  
  1.2495  {\bf Overview:} 
  1.2496 -get accessor message derived from field modelname of object host\_cpu
  1.2497 +Get the modelname field of the given host\_cpu.
  1.2498  
  1.2499   \noindent {\bf Signature:} 
  1.2500  \begin{verbatim} string get_modelname (session_id s, host_cpu ref self)\end{verbatim}
  1.2501 @@ -4712,7 +5166,7 @@ get accessor message derived from field 
  1.2502  \begin{tabular}{|c|c|p{7cm}|}
  1.2503   \hline
  1.2504  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2505 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2506 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2507  
  1.2508  \end{tabular}
  1.2509  
  1.2510 @@ -4731,7 +5185,7 @@ value of the field
  1.2511  \subsubsection{RPC name:~get\_features}
  1.2512  
  1.2513  {\bf Overview:} 
  1.2514 -get accessor message derived from field features of object host\_cpu
  1.2515 +Get the features field of the given host\_cpu.
  1.2516  
  1.2517   \noindent {\bf Signature:} 
  1.2518  \begin{verbatim} ((cpu_feature) Set) get_features (session_id s, host_cpu ref self)\end{verbatim}
  1.2519 @@ -4744,7 +5198,7 @@ get accessor message derived from field 
  1.2520  \begin{tabular}{|c|c|p{7cm}|}
  1.2521   \hline
  1.2522  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2523 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2524 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2525  
  1.2526  \end{tabular}
  1.2527  
  1.2528 @@ -4763,7 +5217,7 @@ value of the field
  1.2529  \subsubsection{RPC name:~get\_utilisation}
  1.2530  
  1.2531  {\bf Overview:} 
  1.2532 -get accessor message derived from field utilisation of object host\_cpu
  1.2533 +Get the utilisation field of the given host\_cpu.
  1.2534  
  1.2535   \noindent {\bf Signature:} 
  1.2536  \begin{verbatim} float get_utilisation (session_id s, host_cpu ref self)\end{verbatim}
  1.2537 @@ -4776,7 +5230,7 @@ get accessor message derived from field 
  1.2538  \begin{tabular}{|c|c|p{7cm}|}
  1.2539   \hline
  1.2540  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2541 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2542 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2543  
  1.2544  \end{tabular}
  1.2545  
  1.2546 @@ -4795,7 +5249,7 @@ value of the field
  1.2547  \subsubsection{RPC name:~create}
  1.2548  
  1.2549  {\bf Overview:} 
  1.2550 -constructor for class host\_cpu
  1.2551 +Create a new host\_cpu instance, and return its handle.
  1.2552  
  1.2553   \noindent {\bf Signature:} 
  1.2554  \begin{verbatim} (host_cpu ref) create (session_id s, host_cpu record args)\end{verbatim}
  1.2555 @@ -4827,7 +5281,7 @@ reference to the newly created object
  1.2556  \subsubsection{RPC name:~destroy}
  1.2557  
  1.2558  {\bf Overview:} 
  1.2559 -destructor for class host\_cpu
  1.2560 +Destroy the specified host\_cpu instance.
  1.2561  
  1.2562   \noindent {\bf Signature:} 
  1.2563  \begin{verbatim} void destroy (session_id s, host_cpu ref self)\end{verbatim}
  1.2564 @@ -4840,7 +5294,7 @@ destructor for class host\_cpu
  1.2565  \begin{tabular}{|c|c|p{7cm}|}
  1.2566   \hline
  1.2567  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2568 -{\tt host\_cpu ref } & self & object instance \\ \hline 
  1.2569 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
  1.2570  
  1.2571  \end{tabular}
  1.2572  
  1.2573 @@ -4859,7 +5313,7 @@ void
  1.2574  \subsubsection{RPC name:~get\_by\_uuid}
  1.2575  
  1.2576  {\bf Overview:} 
  1.2577 -returns the host\_cpu instance with a particular uuid
  1.2578 +Get a reference to the host\_cpu instance with the specified UUID.
  1.2579  
  1.2580   \noindent {\bf Signature:} 
  1.2581  \begin{verbatim} (host_cpu ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.2582 @@ -4891,7 +5345,7 @@ reference to the object
  1.2583  \subsubsection{RPC name:~get\_record}
  1.2584  
  1.2585  {\bf Overview:} 
  1.2586 -returns a record containing the state of an instance of class host\_cpu
  1.2587 +Get a record containing the current state of the given host\_cpu.
  1.2588  
  1.2589   \noindent {\bf Signature:} 
  1.2590  \begin{verbatim} (host_cpu record) get_record (session_id s, host_cpu ref self)\end{verbatim}
  1.2591 @@ -4966,7 +5420,7 @@ A list of all the IDs of all the network
  1.2592  \subsubsection{RPC name:~get\_uuid}
  1.2593  
  1.2594  {\bf Overview:} 
  1.2595 -get accessor message derived from field uuid of object network
  1.2596 +Get the uuid field of the given network.
  1.2597  
  1.2598   \noindent {\bf Signature:} 
  1.2599  \begin{verbatim} string get_uuid (session_id s, network ref self)\end{verbatim}
  1.2600 @@ -4979,7 +5433,7 @@ get accessor message derived from field 
  1.2601  \begin{tabular}{|c|c|p{7cm}|}
  1.2602   \hline
  1.2603  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2604 -{\tt network ref } & self & object instance \\ \hline 
  1.2605 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2606  
  1.2607  \end{tabular}
  1.2608  
  1.2609 @@ -4998,7 +5452,7 @@ value of the field
  1.2610  \subsubsection{RPC name:~get\_name\_label}
  1.2611  
  1.2612  {\bf Overview:} 
  1.2613 -get accessor message derived from field name/label of object network
  1.2614 +Get the name/label field of the given network.
  1.2615  
  1.2616   \noindent {\bf Signature:} 
  1.2617  \begin{verbatim} string get_name_label (session_id s, network ref self)\end{verbatim}
  1.2618 @@ -5011,7 +5465,7 @@ get accessor message derived from field 
  1.2619  \begin{tabular}{|c|c|p{7cm}|}
  1.2620   \hline
  1.2621  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2622 -{\tt network ref } & self & object instance \\ \hline 
  1.2623 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2624  
  1.2625  \end{tabular}
  1.2626  
  1.2627 @@ -5030,7 +5484,7 @@ value of the field
  1.2628  \subsubsection{RPC name:~set\_name\_label}
  1.2629  
  1.2630  {\bf Overview:} 
  1.2631 -set accessor message derived from field name/label of object network
  1.2632 +Set the name/label field of the given network.
  1.2633  
  1.2634   \noindent {\bf Signature:} 
  1.2635  \begin{verbatim} void set_name_label (session_id s, network ref self, string value)\end{verbatim}
  1.2636 @@ -5043,7 +5497,7 @@ set accessor message derived from field 
  1.2637  \begin{tabular}{|c|c|p{7cm}|}
  1.2638   \hline
  1.2639  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2640 -{\tt network ref } & self & object instance \\ \hline 
  1.2641 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2642  
  1.2643  {\tt string } & value & New value to set \\ \hline 
  1.2644  
  1.2645 @@ -5064,7 +5518,7 @@ void
  1.2646  \subsubsection{RPC name:~get\_name\_description}
  1.2647  
  1.2648  {\bf Overview:} 
  1.2649 -get accessor message derived from field name/description of object network
  1.2650 +Get the name/description field of the given network.
  1.2651  
  1.2652   \noindent {\bf Signature:} 
  1.2653  \begin{verbatim} string get_name_description (session_id s, network ref self)\end{verbatim}
  1.2654 @@ -5077,7 +5531,7 @@ get accessor message derived from field 
  1.2655  \begin{tabular}{|c|c|p{7cm}|}
  1.2656   \hline
  1.2657  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2658 -{\tt network ref } & self & object instance \\ \hline 
  1.2659 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2660  
  1.2661  \end{tabular}
  1.2662  
  1.2663 @@ -5096,7 +5550,7 @@ value of the field
  1.2664  \subsubsection{RPC name:~set\_name\_description}
  1.2665  
  1.2666  {\bf Overview:} 
  1.2667 -set accessor message derived from field name/description of object network
  1.2668 +Set the name/description field of the given network.
  1.2669  
  1.2670   \noindent {\bf Signature:} 
  1.2671  \begin{verbatim} void set_name_description (session_id s, network ref self, string value)\end{verbatim}
  1.2672 @@ -5109,7 +5563,7 @@ set accessor message derived from field 
  1.2673  \begin{tabular}{|c|c|p{7cm}|}
  1.2674   \hline
  1.2675  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2676 -{\tt network ref } & self & object instance \\ \hline 
  1.2677 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2678  
  1.2679  {\tt string } & value & New value to set \\ \hline 
  1.2680  
  1.2681 @@ -5130,7 +5584,7 @@ void
  1.2682  \subsubsection{RPC name:~get\_VIFs}
  1.2683  
  1.2684  {\bf Overview:} 
  1.2685 -get accessor message derived from field VIFs of object network
  1.2686 +Get the VIFs field of the given network.
  1.2687  
  1.2688   \noindent {\bf Signature:} 
  1.2689  \begin{verbatim} ((VIF ref) Set) get_VIFs (session_id s, network ref self)\end{verbatim}
  1.2690 @@ -5143,7 +5597,7 @@ get accessor message derived from field 
  1.2691  \begin{tabular}{|c|c|p{7cm}|}
  1.2692   \hline
  1.2693  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2694 -{\tt network ref } & self & object instance \\ \hline 
  1.2695 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2696  
  1.2697  \end{tabular}
  1.2698  
  1.2699 @@ -5162,7 +5616,7 @@ value of the field
  1.2700  \subsubsection{RPC name:~get\_PIFs}
  1.2701  
  1.2702  {\bf Overview:} 
  1.2703 -get accessor message derived from field PIFs of object network
  1.2704 +Get the PIFs field of the given network.
  1.2705  
  1.2706   \noindent {\bf Signature:} 
  1.2707  \begin{verbatim} ((PIF ref) Set) get_PIFs (session_id s, network ref self)\end{verbatim}
  1.2708 @@ -5175,7 +5629,7 @@ get accessor message derived from field 
  1.2709  \begin{tabular}{|c|c|p{7cm}|}
  1.2710   \hline
  1.2711  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2712 -{\tt network ref } & self & object instance \\ \hline 
  1.2713 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2714  
  1.2715  \end{tabular}
  1.2716  
  1.2717 @@ -5194,7 +5648,7 @@ value of the field
  1.2718  \subsubsection{RPC name:~get\_default\_gateway}
  1.2719  
  1.2720  {\bf Overview:} 
  1.2721 -get accessor message derived from field default\_gateway of object network
  1.2722 +Get the default\_gateway field of the given network.
  1.2723  
  1.2724   \noindent {\bf Signature:} 
  1.2725  \begin{verbatim} string get_default_gateway (session_id s, network ref self)\end{verbatim}
  1.2726 @@ -5207,7 +5661,7 @@ get accessor message derived from field 
  1.2727  \begin{tabular}{|c|c|p{7cm}|}
  1.2728   \hline
  1.2729  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2730 -{\tt network ref } & self & object instance \\ \hline 
  1.2731 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2732  
  1.2733  \end{tabular}
  1.2734  
  1.2735 @@ -5226,7 +5680,7 @@ value of the field
  1.2736  \subsubsection{RPC name:~set\_default\_gateway}
  1.2737  
  1.2738  {\bf Overview:} 
  1.2739 -set accessor message derived from field default\_gateway of object network
  1.2740 +Set the default\_gateway field of the given network.
  1.2741  
  1.2742   \noindent {\bf Signature:} 
  1.2743  \begin{verbatim} void set_default_gateway (session_id s, network ref self, string value)\end{verbatim}
  1.2744 @@ -5239,7 +5693,7 @@ set accessor message derived from field 
  1.2745  \begin{tabular}{|c|c|p{7cm}|}
  1.2746   \hline
  1.2747  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2748 -{\tt network ref } & self & object instance \\ \hline 
  1.2749 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2750  
  1.2751  {\tt string } & value & New value to set \\ \hline 
  1.2752  
  1.2753 @@ -5260,7 +5714,7 @@ void
  1.2754  \subsubsection{RPC name:~get\_default\_netmask}
  1.2755  
  1.2756  {\bf Overview:} 
  1.2757 -get accessor message derived from field default\_netmask of object network
  1.2758 +Get the default\_netmask field of the given network.
  1.2759  
  1.2760   \noindent {\bf Signature:} 
  1.2761  \begin{verbatim} string get_default_netmask (session_id s, network ref self)\end{verbatim}
  1.2762 @@ -5273,7 +5727,7 @@ get accessor message derived from field 
  1.2763  \begin{tabular}{|c|c|p{7cm}|}
  1.2764   \hline
  1.2765  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2766 -{\tt network ref } & self & object instance \\ \hline 
  1.2767 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2768  
  1.2769  \end{tabular}
  1.2770  
  1.2771 @@ -5292,7 +5746,7 @@ value of the field
  1.2772  \subsubsection{RPC name:~set\_default\_netmask}
  1.2773  
  1.2774  {\bf Overview:} 
  1.2775 -set accessor message derived from field default\_netmask of object network
  1.2776 +Set the default\_netmask field of the given network.
  1.2777  
  1.2778   \noindent {\bf Signature:} 
  1.2779  \begin{verbatim} void set_default_netmask (session_id s, network ref self, string value)\end{verbatim}
  1.2780 @@ -5305,7 +5759,7 @@ set accessor message derived from field 
  1.2781  \begin{tabular}{|c|c|p{7cm}|}
  1.2782   \hline
  1.2783  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2784 -{\tt network ref } & self & object instance \\ \hline 
  1.2785 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2786  
  1.2787  {\tt string } & value & New value to set \\ \hline 
  1.2788  
  1.2789 @@ -5326,7 +5780,7 @@ void
  1.2790  \subsubsection{RPC name:~create}
  1.2791  
  1.2792  {\bf Overview:} 
  1.2793 -constructor for class network
  1.2794 +Create a new network instance, and return its handle.
  1.2795  
  1.2796   \noindent {\bf Signature:} 
  1.2797  \begin{verbatim} (network ref) create (session_id s, network record args)\end{verbatim}
  1.2798 @@ -5358,7 +5812,7 @@ reference to the newly created object
  1.2799  \subsubsection{RPC name:~destroy}
  1.2800  
  1.2801  {\bf Overview:} 
  1.2802 -destructor for class network
  1.2803 +Destroy the specified network instance.
  1.2804  
  1.2805   \noindent {\bf Signature:} 
  1.2806  \begin{verbatim} void destroy (session_id s, network ref self)\end{verbatim}
  1.2807 @@ -5371,7 +5825,7 @@ destructor for class network
  1.2808  \begin{tabular}{|c|c|p{7cm}|}
  1.2809   \hline
  1.2810  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2811 -{\tt network ref } & self & object instance \\ \hline 
  1.2812 +{\tt network ref } & self & reference to the object \\ \hline 
  1.2813  
  1.2814  \end{tabular}
  1.2815  
  1.2816 @@ -5390,7 +5844,7 @@ void
  1.2817  \subsubsection{RPC name:~get\_by\_uuid}
  1.2818  
  1.2819  {\bf Overview:} 
  1.2820 -returns the network instance with a particular uuid
  1.2821 +Get a reference to the network instance with the specified UUID.
  1.2822  
  1.2823   \noindent {\bf Signature:} 
  1.2824  \begin{verbatim} (network ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.2825 @@ -5422,7 +5876,7 @@ reference to the object
  1.2826  \subsubsection{RPC name:~get\_record}
  1.2827  
  1.2828  {\bf Overview:} 
  1.2829 -returns a record containing the state of an instance of class network
  1.2830 +Get a record containing the current state of the given network.
  1.2831  
  1.2832   \noindent {\bf Signature:} 
  1.2833  \begin{verbatim} (network record) get_record (session_id s, network ref self)\end{verbatim}
  1.2834 @@ -5454,7 +5908,7 @@ all fields from the object
  1.2835  \subsubsection{RPC name:~get\_by\_name\_label}
  1.2836  
  1.2837  {\bf Overview:} 
  1.2838 -returns the network instance with a particular name label
  1.2839 +Get all the network instances with the given label.
  1.2840  
  1.2841   \noindent {\bf Signature:} 
  1.2842  \begin{verbatim} ((network ref) Set) get_by_name_label (session_id s, string label)\end{verbatim}
  1.2843 @@ -5511,7 +5965,7 @@ Quals & Field & Type & Description \\
  1.2844  \subsubsection{RPC name:~get\_uuid}
  1.2845  
  1.2846  {\bf Overview:} 
  1.2847 -get accessor message derived from field uuid of object VIF
  1.2848 +Get the uuid field of the given VIF.
  1.2849  
  1.2850   \noindent {\bf Signature:} 
  1.2851  \begin{verbatim} string get_uuid (session_id s, VIF ref self)\end{verbatim}
  1.2852 @@ -5524,7 +5978,7 @@ get accessor message derived from field 
  1.2853  \begin{tabular}{|c|c|p{7cm}|}
  1.2854   \hline
  1.2855  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2856 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2857 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2858  
  1.2859  \end{tabular}
  1.2860  
  1.2861 @@ -5543,7 +5997,7 @@ value of the field
  1.2862  \subsubsection{RPC name:~get\_name}
  1.2863  
  1.2864  {\bf Overview:} 
  1.2865 -get accessor message derived from field name of object VIF
  1.2866 +Get the name field of the given VIF.
  1.2867  
  1.2868   \noindent {\bf Signature:} 
  1.2869  \begin{verbatim} string get_name (session_id s, VIF ref self)\end{verbatim}
  1.2870 @@ -5556,7 +6010,7 @@ get accessor message derived from field 
  1.2871  \begin{tabular}{|c|c|p{7cm}|}
  1.2872   \hline
  1.2873  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2874 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2875 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2876  
  1.2877  \end{tabular}
  1.2878  
  1.2879 @@ -5575,7 +6029,7 @@ value of the field
  1.2880  \subsubsection{RPC name:~set\_name}
  1.2881  
  1.2882  {\bf Overview:} 
  1.2883 -set accessor message derived from field name of object VIF
  1.2884 +Set the name field of the given VIF.
  1.2885  
  1.2886   \noindent {\bf Signature:} 
  1.2887  \begin{verbatim} void set_name (session_id s, VIF ref self, string value)\end{verbatim}
  1.2888 @@ -5588,7 +6042,7 @@ set accessor message derived from field 
  1.2889  \begin{tabular}{|c|c|p{7cm}|}
  1.2890   \hline
  1.2891  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2892 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2893 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2894  
  1.2895  {\tt string } & value & New value to set \\ \hline 
  1.2896  
  1.2897 @@ -5609,7 +6063,7 @@ void
  1.2898  \subsubsection{RPC name:~get\_type}
  1.2899  
  1.2900  {\bf Overview:} 
  1.2901 -get accessor message derived from field type of object VIF
  1.2902 +Get the type field of the given VIF.
  1.2903  
  1.2904   \noindent {\bf Signature:} 
  1.2905  \begin{verbatim} (driver_type) get_type (session_id s, VIF ref self)\end{verbatim}
  1.2906 @@ -5622,7 +6076,7 @@ get accessor message derived from field 
  1.2907  \begin{tabular}{|c|c|p{7cm}|}
  1.2908   \hline
  1.2909  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2910 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2911 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2912  
  1.2913  \end{tabular}
  1.2914  
  1.2915 @@ -5641,7 +6095,7 @@ value of the field
  1.2916  \subsubsection{RPC name:~set\_type}
  1.2917  
  1.2918  {\bf Overview:} 
  1.2919 -set accessor message derived from field type of object VIF
  1.2920 +Set the type field of the given VIF.
  1.2921  
  1.2922   \noindent {\bf Signature:} 
  1.2923  \begin{verbatim} void set_type (session_id s, VIF ref self, driver_type value)\end{verbatim}
  1.2924 @@ -5654,7 +6108,7 @@ set accessor message derived from field 
  1.2925  \begin{tabular}{|c|c|p{7cm}|}
  1.2926   \hline
  1.2927  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2928 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2929 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2930  
  1.2931  {\tt driver\_type } & value & New value to set \\ \hline 
  1.2932  
  1.2933 @@ -5675,7 +6129,7 @@ void
  1.2934  \subsubsection{RPC name:~get\_device}
  1.2935  
  1.2936  {\bf Overview:} 
  1.2937 -get accessor message derived from field device of object VIF
  1.2938 +Get the device field of the given VIF.
  1.2939  
  1.2940   \noindent {\bf Signature:} 
  1.2941  \begin{verbatim} string get_device (session_id s, VIF ref self)\end{verbatim}
  1.2942 @@ -5688,7 +6142,7 @@ get accessor message derived from field 
  1.2943  \begin{tabular}{|c|c|p{7cm}|}
  1.2944   \hline
  1.2945  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2946 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2947 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2948  
  1.2949  \end{tabular}
  1.2950  
  1.2951 @@ -5707,7 +6161,7 @@ value of the field
  1.2952  \subsubsection{RPC name:~set\_device}
  1.2953  
  1.2954  {\bf Overview:} 
  1.2955 -set accessor message derived from field device of object VIF
  1.2956 +Set the device field of the given VIF.
  1.2957  
  1.2958   \noindent {\bf Signature:} 
  1.2959  \begin{verbatim} void set_device (session_id s, VIF ref self, string value)\end{verbatim}
  1.2960 @@ -5720,7 +6174,7 @@ set accessor message derived from field 
  1.2961  \begin{tabular}{|c|c|p{7cm}|}
  1.2962   \hline
  1.2963  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2964 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2965 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2966  
  1.2967  {\tt string } & value & New value to set \\ \hline 
  1.2968  
  1.2969 @@ -5741,7 +6195,7 @@ void
  1.2970  \subsubsection{RPC name:~get\_network}
  1.2971  
  1.2972  {\bf Overview:} 
  1.2973 -get accessor message derived from field network of object VIF
  1.2974 +Get the network field of the given VIF.
  1.2975  
  1.2976   \noindent {\bf Signature:} 
  1.2977  \begin{verbatim} (network ref) get_network (session_id s, VIF ref self)\end{verbatim}
  1.2978 @@ -5754,7 +6208,7 @@ get accessor message derived from field 
  1.2979  \begin{tabular}{|c|c|p{7cm}|}
  1.2980   \hline
  1.2981  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.2982 -{\tt VIF ref } & self & object instance \\ \hline 
  1.2983 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.2984  
  1.2985  \end{tabular}
  1.2986  
  1.2987 @@ -5773,7 +6227,7 @@ value of the field
  1.2988  \subsubsection{RPC name:~set\_network}
  1.2989  
  1.2990  {\bf Overview:} 
  1.2991 -set accessor message derived from field network of object VIF
  1.2992 +Set the network field of the given VIF.
  1.2993  
  1.2994   \noindent {\bf Signature:} 
  1.2995  \begin{verbatim} void set_network (session_id s, VIF ref self, network ref value)\end{verbatim}
  1.2996 @@ -5786,7 +6240,7 @@ set accessor message derived from field 
  1.2997  \begin{tabular}{|c|c|p{7cm}|}
  1.2998   \hline
  1.2999  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3000 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3001 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3002  
  1.3003  {\tt network ref } & value & New value to set \\ \hline 
  1.3004  
  1.3005 @@ -5807,7 +6261,7 @@ void
  1.3006  \subsubsection{RPC name:~get\_VM}
  1.3007  
  1.3008  {\bf Overview:} 
  1.3009 -get accessor message derived from field VM of object VIF
  1.3010 +Get the VM field of the given VIF.
  1.3011  
  1.3012   \noindent {\bf Signature:} 
  1.3013  \begin{verbatim} (VM ref) get_VM (session_id s, VIF ref self)\end{verbatim}
  1.3014 @@ -5820,7 +6274,7 @@ get accessor message derived from field 
  1.3015  \begin{tabular}{|c|c|p{7cm}|}
  1.3016   \hline
  1.3017  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3018 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3019 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3020  
  1.3021  \end{tabular}
  1.3022  
  1.3023 @@ -5839,7 +6293,7 @@ value of the field
  1.3024  \subsubsection{RPC name:~set\_VM}
  1.3025  
  1.3026  {\bf Overview:} 
  1.3027 -set accessor message derived from field VM of object VIF
  1.3028 +Set the VM field of the given VIF.
  1.3029  
  1.3030   \noindent {\bf Signature:} 
  1.3031  \begin{verbatim} void set_VM (session_id s, VIF ref self, VM ref value)\end{verbatim}
  1.3032 @@ -5852,7 +6306,7 @@ set accessor message derived from field 
  1.3033  \begin{tabular}{|c|c|p{7cm}|}
  1.3034   \hline
  1.3035  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3036 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3037 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3038  
  1.3039  {\tt VM ref } & value & New value to set \\ \hline 
  1.3040  
  1.3041 @@ -5873,7 +6327,7 @@ void
  1.3042  \subsubsection{RPC name:~get\_MAC}
  1.3043  
  1.3044  {\bf Overview:} 
  1.3045 -get accessor message derived from field MAC of object VIF
  1.3046 +Get the MAC field of the given VIF.
  1.3047  
  1.3048   \noindent {\bf Signature:} 
  1.3049  \begin{verbatim} string get_MAC (session_id s, VIF ref self)\end{verbatim}
  1.3050 @@ -5886,7 +6340,7 @@ get accessor message derived from field 
  1.3051  \begin{tabular}{|c|c|p{7cm}|}
  1.3052   \hline
  1.3053  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3054 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3055 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3056  
  1.3057  \end{tabular}
  1.3058  
  1.3059 @@ -5905,7 +6359,7 @@ value of the field
  1.3060  \subsubsection{RPC name:~set\_MAC}
  1.3061  
  1.3062  {\bf Overview:} 
  1.3063 -set accessor message derived from field MAC of object VIF
  1.3064 +Set the MAC field of the given VIF.
  1.3065  
  1.3066   \noindent {\bf Signature:} 
  1.3067  \begin{verbatim} void set_MAC (session_id s, VIF ref self, string value)\end{verbatim}
  1.3068 @@ -5918,7 +6372,7 @@ set accessor message derived from field 
  1.3069  \begin{tabular}{|c|c|p{7cm}|}
  1.3070   \hline
  1.3071  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3072 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3073 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3074  
  1.3075  {\tt string } & value & New value to set \\ \hline 
  1.3076  
  1.3077 @@ -5939,7 +6393,7 @@ void
  1.3078  \subsubsection{RPC name:~get\_MTU}
  1.3079  
  1.3080  {\bf Overview:} 
  1.3081 -get accessor message derived from field MTU of object VIF
  1.3082 +Get the MTU field of the given VIF.
  1.3083  
  1.3084   \noindent {\bf Signature:} 
  1.3085  \begin{verbatim} int get_MTU (session_id s, VIF ref self)\end{verbatim}
  1.3086 @@ -5952,7 +6406,7 @@ get accessor message derived from field 
  1.3087  \begin{tabular}{|c|c|p{7cm}|}
  1.3088   \hline
  1.3089  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3090 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3091 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3092  
  1.3093  \end{tabular}
  1.3094  
  1.3095 @@ -5971,7 +6425,7 @@ value of the field
  1.3096  \subsubsection{RPC name:~set\_MTU}
  1.3097  
  1.3098  {\bf Overview:} 
  1.3099 -set accessor message derived from field MTU of object VIF
  1.3100 +Set the MTU field of the given VIF.
  1.3101  
  1.3102   \noindent {\bf Signature:} 
  1.3103  \begin{verbatim} void set_MTU (session_id s, VIF ref self, int value)\end{verbatim}
  1.3104 @@ -5984,7 +6438,7 @@ set accessor message derived from field 
  1.3105  \begin{tabular}{|c|c|p{7cm}|}
  1.3106   \hline
  1.3107  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3108 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3109 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3110  
  1.3111  {\tt int } & value & New value to set \\ \hline 
  1.3112  
  1.3113 @@ -6005,7 +6459,7 @@ void
  1.3114  \subsubsection{RPC name:~get\_io\_read\_kbs}
  1.3115  
  1.3116  {\bf Overview:} 
  1.3117 -get accessor message derived from field io/read\_kbs of object VIF
  1.3118 +Get the io/read\_kbs field of the given VIF.
  1.3119  
  1.3120   \noindent {\bf Signature:} 
  1.3121  \begin{verbatim} float get_io_read_kbs (session_id s, VIF ref self)\end{verbatim}
  1.3122 @@ -6018,7 +6472,7 @@ get accessor message derived from field 
  1.3123  \begin{tabular}{|c|c|p{7cm}|}
  1.3124   \hline
  1.3125  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3126 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3127 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3128  
  1.3129  \end{tabular}
  1.3130  
  1.3131 @@ -6037,7 +6491,7 @@ value of the field
  1.3132  \subsubsection{RPC name:~get\_io\_write\_kbs}
  1.3133  
  1.3134  {\bf Overview:} 
  1.3135 -get accessor message derived from field io/write\_kbs of object VIF
  1.3136 +Get the io/write\_kbs field of the given VIF.
  1.3137  
  1.3138   \noindent {\bf Signature:} 
  1.3139  \begin{verbatim} float get_io_write_kbs (session_id s, VIF ref self)\end{verbatim}
  1.3140 @@ -6050,7 +6504,7 @@ get accessor message derived from field 
  1.3141  \begin{tabular}{|c|c|p{7cm}|}
  1.3142   \hline
  1.3143  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3144 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3145 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3146  
  1.3147  \end{tabular}
  1.3148  
  1.3149 @@ -6069,7 +6523,7 @@ value of the field
  1.3150  \subsubsection{RPC name:~create}
  1.3151  
  1.3152  {\bf Overview:} 
  1.3153 -constructor for class VIF
  1.3154 +Create a new VIF instance, and return its handle.
  1.3155  
  1.3156   \noindent {\bf Signature:} 
  1.3157  \begin{verbatim} (VIF ref) create (session_id s, VIF record args)\end{verbatim}
  1.3158 @@ -6101,7 +6555,7 @@ reference to the newly created object
  1.3159  \subsubsection{RPC name:~destroy}
  1.3160  
  1.3161  {\bf Overview:} 
  1.3162 -destructor for class VIF
  1.3163 +Destroy the specified VIF instance.
  1.3164  
  1.3165   \noindent {\bf Signature:} 
  1.3166  \begin{verbatim} void destroy (session_id s, VIF ref self)\end{verbatim}
  1.3167 @@ -6114,7 +6568,7 @@ destructor for class VIF
  1.3168  \begin{tabular}{|c|c|p{7cm}|}
  1.3169   \hline
  1.3170  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3171 -{\tt VIF ref } & self & object instance \\ \hline 
  1.3172 +{\tt VIF ref } & self & reference to the object \\ \hline 
  1.3173  
  1.3174  \end{tabular}
  1.3175  
  1.3176 @@ -6133,7 +6587,7 @@ void
  1.3177  \subsubsection{RPC name:~get\_by\_uuid}
  1.3178  
  1.3179  {\bf Overview:} 
  1.3180 -returns the VIF instance with a particular uuid
  1.3181 +Get a reference to the VIF instance with the specified UUID.
  1.3182  
  1.3183   \noindent {\bf Signature:} 
  1.3184  \begin{verbatim} (VIF ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.3185 @@ -6165,7 +6619,7 @@ reference to the object
  1.3186  \subsubsection{RPC name:~get\_record}
  1.3187  
  1.3188  {\bf Overview:} 
  1.3189 -returns a record containing the state of an instance of class VIF
  1.3190 +Get a record containing the current state of the given VIF.
  1.3191  
  1.3192   \noindent {\bf Signature:} 
  1.3193  \begin{verbatim} (VIF record) get_record (session_id s, VIF ref self)\end{verbatim}
  1.3194 @@ -6221,7 +6675,7 @@ Quals & Field & Type & Description \\
  1.3195  \subsubsection{RPC name:~get\_uuid}
  1.3196  
  1.3197  {\bf Overview:} 
  1.3198 -get accessor message derived from field uuid of object PIF
  1.3199 +Get the uuid field of the given PIF.
  1.3200  
  1.3201   \noindent {\bf Signature:} 
  1.3202  \begin{verbatim} string get_uuid (session_id s, PIF ref self)\end{verbatim}
  1.3203 @@ -6234,7 +6688,7 @@ get accessor message derived from field 
  1.3204  \begin{tabular}{|c|c|p{7cm}|}
  1.3205   \hline
  1.3206  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3207 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3208 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3209  
  1.3210  \end{tabular}
  1.3211  
  1.3212 @@ -6253,7 +6707,7 @@ value of the field
  1.3213  \subsubsection{RPC name:~get\_name}
  1.3214  
  1.3215  {\bf Overview:} 
  1.3216 -get accessor message derived from field name of object PIF
  1.3217 +Get the name field of the given PIF.
  1.3218  
  1.3219   \noindent {\bf Signature:} 
  1.3220  \begin{verbatim} string get_name (session_id s, PIF ref self)\end{verbatim}
  1.3221 @@ -6266,7 +6720,7 @@ get accessor message derived from field 
  1.3222  \begin{tabular}{|c|c|p{7cm}|}
  1.3223   \hline
  1.3224  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3225 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3226 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3227  
  1.3228  \end{tabular}
  1.3229  
  1.3230 @@ -6285,7 +6739,7 @@ value of the field
  1.3231  \subsubsection{RPC name:~set\_name}
  1.3232  
  1.3233  {\bf Overview:} 
  1.3234 -set accessor message derived from field name of object PIF
  1.3235 +Set the name field of the given PIF.
  1.3236  
  1.3237   \noindent {\bf Signature:} 
  1.3238  \begin{verbatim} void set_name (session_id s, PIF ref self, string value)\end{verbatim}
  1.3239 @@ -6298,7 +6752,7 @@ set accessor message derived from field 
  1.3240  \begin{tabular}{|c|c|p{7cm}|}
  1.3241   \hline
  1.3242  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3243 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3244 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3245  
  1.3246  {\tt string } & value & New value to set \\ \hline 
  1.3247  
  1.3248 @@ -6319,7 +6773,7 @@ void
  1.3249  \subsubsection{RPC name:~get\_network}
  1.3250  
  1.3251  {\bf Overview:} 
  1.3252 -get accessor message derived from field network of object PIF
  1.3253 +Get the network field of the given PIF.
  1.3254  
  1.3255   \noindent {\bf Signature:} 
  1.3256  \begin{verbatim} (network ref) get_network (session_id s, PIF ref self)\end{verbatim}
  1.3257 @@ -6332,7 +6786,7 @@ get accessor message derived from field 
  1.3258  \begin{tabular}{|c|c|p{7cm}|}
  1.3259   \hline
  1.3260  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3261 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3262 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3263  
  1.3264  \end{tabular}
  1.3265  
  1.3266 @@ -6351,7 +6805,7 @@ value of the field
  1.3267  \subsubsection{RPC name:~set\_network}
  1.3268  
  1.3269  {\bf Overview:} 
  1.3270 -set accessor message derived from field network of object PIF
  1.3271 +Set the network field of the given PIF.
  1.3272  
  1.3273   \noindent {\bf Signature:} 
  1.3274  \begin{verbatim} void set_network (session_id s, PIF ref self, network ref value)\end{verbatim}
  1.3275 @@ -6364,7 +6818,7 @@ set accessor message derived from field 
  1.3276  \begin{tabular}{|c|c|p{7cm}|}
  1.3277   \hline
  1.3278  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3279 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3280 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3281  
  1.3282  {\tt network ref } & value & New value to set \\ \hline 
  1.3283  
  1.3284 @@ -6385,7 +6839,7 @@ void
  1.3285  \subsubsection{RPC name:~get\_host}
  1.3286  
  1.3287  {\bf Overview:} 
  1.3288 -get accessor message derived from field host of object PIF
  1.3289 +Get the host field of the given PIF.
  1.3290  
  1.3291   \noindent {\bf Signature:} 
  1.3292  \begin{verbatim} (host ref) get_host (session_id s, PIF ref self)\end{verbatim}
  1.3293 @@ -6398,7 +6852,7 @@ get accessor message derived from field 
  1.3294  \begin{tabular}{|c|c|p{7cm}|}
  1.3295   \hline
  1.3296  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3297 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3298 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3299  
  1.3300  \end{tabular}
  1.3301  
  1.3302 @@ -6417,7 +6871,7 @@ value of the field
  1.3303  \subsubsection{RPC name:~set\_host}
  1.3304  
  1.3305  {\bf Overview:} 
  1.3306 -set accessor message derived from field host of object PIF
  1.3307 +Set the host field of the given PIF.
  1.3308  
  1.3309   \noindent {\bf Signature:} 
  1.3310  \begin{verbatim} void set_host (session_id s, PIF ref self, host ref value)\end{verbatim}
  1.3311 @@ -6430,7 +6884,7 @@ set accessor message derived from field 
  1.3312  \begin{tabular}{|c|c|p{7cm}|}
  1.3313   \hline
  1.3314  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3315 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3316 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3317  
  1.3318  {\tt host ref } & value & New value to set \\ \hline 
  1.3319  
  1.3320 @@ -6451,7 +6905,7 @@ void
  1.3321  \subsubsection{RPC name:~get\_MAC}
  1.3322  
  1.3323  {\bf Overview:} 
  1.3324 -get accessor message derived from field MAC of object PIF
  1.3325 +Get the MAC field of the given PIF.
  1.3326  
  1.3327   \noindent {\bf Signature:} 
  1.3328  \begin{verbatim} string get_MAC (session_id s, PIF ref self)\end{verbatim}
  1.3329 @@ -6464,7 +6918,7 @@ get accessor message derived from field 
  1.3330  \begin{tabular}{|c|c|p{7cm}|}
  1.3331   \hline
  1.3332  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3333 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3334 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3335  
  1.3336  \end{tabular}
  1.3337  
  1.3338 @@ -6483,7 +6937,7 @@ value of the field
  1.3339  \subsubsection{RPC name:~set\_MAC}
  1.3340  
  1.3341  {\bf Overview:} 
  1.3342 -set accessor message derived from field MAC of object PIF
  1.3343 +Set the MAC field of the given PIF.
  1.3344  
  1.3345   \noindent {\bf Signature:} 
  1.3346  \begin{verbatim} void set_MAC (session_id s, PIF ref self, string value)\end{verbatim}
  1.3347 @@ -6496,7 +6950,7 @@ set accessor message derived from field 
  1.3348  \begin{tabular}{|c|c|p{7cm}|}
  1.3349   \hline
  1.3350  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3351 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3352 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3353  
  1.3354  {\tt string } & value & New value to set \\ \hline 
  1.3355  
  1.3356 @@ -6517,7 +6971,7 @@ void
  1.3357  \subsubsection{RPC name:~get\_MTU}
  1.3358  
  1.3359  {\bf Overview:} 
  1.3360 -get accessor message derived from field MTU of object PIF
  1.3361 +Get the MTU field of the given PIF.
  1.3362  
  1.3363   \noindent {\bf Signature:} 
  1.3364  \begin{verbatim} int get_MTU (session_id s, PIF ref self)\end{verbatim}
  1.3365 @@ -6530,7 +6984,7 @@ get accessor message derived from field 
  1.3366  \begin{tabular}{|c|c|p{7cm}|}
  1.3367   \hline
  1.3368  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3369 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3370 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3371  
  1.3372  \end{tabular}
  1.3373  
  1.3374 @@ -6549,7 +7003,7 @@ value of the field
  1.3375  \subsubsection{RPC name:~set\_MTU}
  1.3376  
  1.3377  {\bf Overview:} 
  1.3378 -set accessor message derived from field MTU of object PIF
  1.3379 +Set the MTU field of the given PIF.
  1.3380  
  1.3381   \noindent {\bf Signature:} 
  1.3382  \begin{verbatim} void set_MTU (session_id s, PIF ref self, int value)\end{verbatim}
  1.3383 @@ -6562,7 +7016,7 @@ set accessor message derived from field 
  1.3384  \begin{tabular}{|c|c|p{7cm}|}
  1.3385   \hline
  1.3386  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3387 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3388 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3389  
  1.3390  {\tt int } & value & New value to set \\ \hline 
  1.3391  
  1.3392 @@ -6583,7 +7037,7 @@ void
  1.3393  \subsubsection{RPC name:~get\_VLAN}
  1.3394  
  1.3395  {\bf Overview:} 
  1.3396 -get accessor message derived from field VLAN of object PIF
  1.3397 +Get the VLAN field of the given PIF.
  1.3398  
  1.3399   \noindent {\bf Signature:} 
  1.3400  \begin{verbatim} string get_VLAN (session_id s, PIF ref self)\end{verbatim}
  1.3401 @@ -6596,7 +7050,7 @@ get accessor message derived from field 
  1.3402  \begin{tabular}{|c|c|p{7cm}|}
  1.3403   \hline
  1.3404  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3405 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3406 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3407  
  1.3408  \end{tabular}
  1.3409  
  1.3410 @@ -6615,7 +7069,7 @@ value of the field
  1.3411  \subsubsection{RPC name:~set\_VLAN}
  1.3412  
  1.3413  {\bf Overview:} 
  1.3414 -set accessor message derived from field VLAN of object PIF
  1.3415 +Set the VLAN field of the given PIF.
  1.3416  
  1.3417   \noindent {\bf Signature:} 
  1.3418  \begin{verbatim} void set_VLAN (session_id s, PIF ref self, string value)\end{verbatim}
  1.3419 @@ -6628,7 +7082,7 @@ set accessor message derived from field 
  1.3420  \begin{tabular}{|c|c|p{7cm}|}
  1.3421   \hline
  1.3422  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3423 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3424 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3425  
  1.3426  {\tt string } & value & New value to set \\ \hline 
  1.3427  
  1.3428 @@ -6649,7 +7103,7 @@ void
  1.3429  \subsubsection{RPC name:~get\_io\_read\_kbs}
  1.3430  
  1.3431  {\bf Overview:} 
  1.3432 -get accessor message derived from field io/read\_kbs of object PIF
  1.3433 +Get the io/read\_kbs field of the given PIF.
  1.3434  
  1.3435   \noindent {\bf Signature:} 
  1.3436  \begin{verbatim} float get_io_read_kbs (session_id s, PIF ref self)\end{verbatim}
  1.3437 @@ -6662,7 +7116,7 @@ get accessor message derived from field 
  1.3438  \begin{tabular}{|c|c|p{7cm}|}
  1.3439   \hline
  1.3440  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3441 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3442 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3443  
  1.3444  \end{tabular}
  1.3445  
  1.3446 @@ -6681,7 +7135,7 @@ value of the field
  1.3447  \subsubsection{RPC name:~get\_io\_write\_kbs}
  1.3448  
  1.3449  {\bf Overview:} 
  1.3450 -get accessor message derived from field io/write\_kbs of object PIF
  1.3451 +Get the io/write\_kbs field of the given PIF.
  1.3452  
  1.3453   \noindent {\bf Signature:} 
  1.3454  \begin{verbatim} float get_io_write_kbs (session_id s, PIF ref self)\end{verbatim}
  1.3455 @@ -6694,7 +7148,7 @@ get accessor message derived from field 
  1.3456  \begin{tabular}{|c|c|p{7cm}|}
  1.3457   \hline
  1.3458  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3459 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3460 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3461  
  1.3462  \end{tabular}
  1.3463  
  1.3464 @@ -6713,7 +7167,7 @@ value of the field
  1.3465  \subsubsection{RPC name:~create}
  1.3466  
  1.3467  {\bf Overview:} 
  1.3468 -constructor for class PIF
  1.3469 +Create a new PIF instance, and return its handle.
  1.3470  
  1.3471   \noindent {\bf Signature:} 
  1.3472  \begin{verbatim} (PIF ref) create (session_id s, PIF record args)\end{verbatim}
  1.3473 @@ -6745,7 +7199,7 @@ reference to the newly created object
  1.3474  \subsubsection{RPC name:~destroy}
  1.3475  
  1.3476  {\bf Overview:} 
  1.3477 -destructor for class PIF
  1.3478 +Destroy the specified PIF instance.
  1.3479  
  1.3480   \noindent {\bf Signature:} 
  1.3481  \begin{verbatim} void destroy (session_id s, PIF ref self)\end{verbatim}
  1.3482 @@ -6758,7 +7212,7 @@ destructor for class PIF
  1.3483  \begin{tabular}{|c|c|p{7cm}|}
  1.3484   \hline
  1.3485  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3486 -{\tt PIF ref } & self & object instance \\ \hline 
  1.3487 +{\tt PIF ref } & self & reference to the object \\ \hline 
  1.3488  
  1.3489  \end{tabular}
  1.3490  
  1.3491 @@ -6777,7 +7231,7 @@ void
  1.3492  \subsubsection{RPC name:~get\_by\_uuid}
  1.3493  
  1.3494  {\bf Overview:} 
  1.3495 -returns the PIF instance with a particular uuid
  1.3496 +Get a reference to the PIF instance with the specified UUID.
  1.3497  
  1.3498   \noindent {\bf Signature:} 
  1.3499  \begin{verbatim} (PIF ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.3500 @@ -6809,7 +7263,7 @@ reference to the object
  1.3501  \subsubsection{RPC name:~get\_record}
  1.3502  
  1.3503  {\bf Overview:} 
  1.3504 -returns a record containing the state of an instance of class PIF
  1.3505 +Get a record containing the current state of the given PIF.
  1.3506  
  1.3507   \noindent {\bf Signature:} 
  1.3508  \begin{verbatim} (PIF record) get_record (session_id s, PIF ref self)\end{verbatim}
  1.3509 @@ -6923,7 +7377,7 @@ A list of all the IDs of all the Storage
  1.3510  \subsubsection{RPC name:~get\_uuid}
  1.3511  
  1.3512  {\bf Overview:} 
  1.3513 -get accessor message derived from field uuid of object SR
  1.3514 +Get the uuid field of the given SR.
  1.3515  
  1.3516   \noindent {\bf Signature:} 
  1.3517  \begin{verbatim} string get_uuid (session_id s, SR ref self)\end{verbatim}
  1.3518 @@ -6936,7 +7390,7 @@ get accessor message derived from field 
  1.3519  \begin{tabular}{|c|c|p{7cm}|}
  1.3520   \hline
  1.3521  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3522 -{\tt SR ref } & self & object instance \\ \hline 
  1.3523 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3524  
  1.3525  \end{tabular}
  1.3526  
  1.3527 @@ -6955,7 +7409,7 @@ value of the field
  1.3528  \subsubsection{RPC name:~get\_name\_label}
  1.3529  
  1.3530  {\bf Overview:} 
  1.3531 -get accessor message derived from field name/label of object SR
  1.3532 +Get the name/label field of the given SR.
  1.3533  
  1.3534   \noindent {\bf Signature:} 
  1.3535  \begin{verbatim} string get_name_label (session_id s, SR ref self)\end{verbatim}
  1.3536 @@ -6968,7 +7422,7 @@ get accessor message derived from field 
  1.3537  \begin{tabular}{|c|c|p{7cm}|}
  1.3538   \hline
  1.3539  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3540 -{\tt SR ref } & self & object instance \\ \hline 
  1.3541 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3542  
  1.3543  \end{tabular}
  1.3544  
  1.3545 @@ -6987,7 +7441,7 @@ value of the field
  1.3546  \subsubsection{RPC name:~set\_name\_label}
  1.3547  
  1.3548  {\bf Overview:} 
  1.3549 -set accessor message derived from field name/label of object SR
  1.3550 +Set the name/label field of the given SR.
  1.3551  
  1.3552   \noindent {\bf Signature:} 
  1.3553  \begin{verbatim} void set_name_label (session_id s, SR ref self, string value)\end{verbatim}
  1.3554 @@ -7000,7 +7454,7 @@ set accessor message derived from field 
  1.3555  \begin{tabular}{|c|c|p{7cm}|}
  1.3556   \hline
  1.3557  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3558 -{\tt SR ref } & self & object instance \\ \hline 
  1.3559 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3560  
  1.3561  {\tt string } & value & New value to set \\ \hline 
  1.3562  
  1.3563 @@ -7021,7 +7475,7 @@ void
  1.3564  \subsubsection{RPC name:~get\_name\_description}
  1.3565  
  1.3566  {\bf Overview:} 
  1.3567 -get accessor message derived from field name/description of object SR
  1.3568 +Get the name/description field of the given SR.
  1.3569  
  1.3570   \noindent {\bf Signature:} 
  1.3571  \begin{verbatim} string get_name_description (session_id s, SR ref self)\end{verbatim}
  1.3572 @@ -7034,7 +7488,7 @@ get accessor message derived from field 
  1.3573  \begin{tabular}{|c|c|p{7cm}|}
  1.3574   \hline
  1.3575  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3576 -{\tt SR ref } & self & object instance \\ \hline 
  1.3577 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3578  
  1.3579  \end{tabular}
  1.3580  
  1.3581 @@ -7053,7 +7507,7 @@ value of the field
  1.3582  \subsubsection{RPC name:~set\_name\_description}
  1.3583  
  1.3584  {\bf Overview:} 
  1.3585 -set accessor message derived from field name/description of object SR
  1.3586 +Set the name/description field of the given SR.
  1.3587  
  1.3588   \noindent {\bf Signature:} 
  1.3589  \begin{verbatim} void set_name_description (session_id s, SR ref self, string value)\end{verbatim}
  1.3590 @@ -7066,7 +7520,7 @@ set accessor message derived from field 
  1.3591  \begin{tabular}{|c|c|p{7cm}|}
  1.3592   \hline
  1.3593  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3594 -{\tt SR ref } & self & object instance \\ \hline 
  1.3595 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3596  
  1.3597  {\tt string } & value & New value to set \\ \hline 
  1.3598  
  1.3599 @@ -7087,7 +7541,7 @@ void
  1.3600  \subsubsection{RPC name:~get\_VDIs}
  1.3601  
  1.3602  {\bf Overview:} 
  1.3603 -get accessor message derived from field VDIs of object SR
  1.3604 +Get the VDIs field of the given SR.
  1.3605  
  1.3606   \noindent {\bf Signature:} 
  1.3607  \begin{verbatim} ((VDI ref) Set) get_VDIs (session_id s, SR ref self)\end{verbatim}
  1.3608 @@ -7100,7 +7554,7 @@ get accessor message derived from field 
  1.3609  \begin{tabular}{|c|c|p{7cm}|}
  1.3610   \hline
  1.3611  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3612 -{\tt SR ref } & self & object instance \\ \hline 
  1.3613 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3614  
  1.3615  \end{tabular}
  1.3616  
  1.3617 @@ -7119,7 +7573,7 @@ value of the field
  1.3618  \subsubsection{RPC name:~get\_virtual\_allocation}
  1.3619  
  1.3620  {\bf Overview:} 
  1.3621 -get accessor message derived from field virtual\_allocation of object SR
  1.3622 +Get the virtual\_allocation field of the given SR.
  1.3623  
  1.3624   \noindent {\bf Signature:} 
  1.3625  \begin{verbatim} int get_virtual_allocation (session_id s, SR ref self)\end{verbatim}
  1.3626 @@ -7132,7 +7586,7 @@ get accessor message derived from field 
  1.3627  \begin{tabular}{|c|c|p{7cm}|}
  1.3628   \hline
  1.3629  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3630 -{\tt SR ref } & self & object instance \\ \hline 
  1.3631 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3632  
  1.3633  \end{tabular}
  1.3634  
  1.3635 @@ -7151,7 +7605,7 @@ value of the field
  1.3636  \subsubsection{RPC name:~get\_physical\_utilisation}
  1.3637  
  1.3638  {\bf Overview:} 
  1.3639 -get accessor message derived from field physical\_utilisation of object SR
  1.3640 +Get the physical\_utilisation field of the given SR.
  1.3641  
  1.3642   \noindent {\bf Signature:} 
  1.3643  \begin{verbatim} int get_physical_utilisation (session_id s, SR ref self)\end{verbatim}
  1.3644 @@ -7164,7 +7618,7 @@ get accessor message derived from field 
  1.3645  \begin{tabular}{|c|c|p{7cm}|}
  1.3646   \hline
  1.3647  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3648 -{\tt SR ref } & self & object instance \\ \hline 
  1.3649 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3650  
  1.3651  \end{tabular}
  1.3652  
  1.3653 @@ -7183,7 +7637,7 @@ value of the field
  1.3654  \subsubsection{RPC name:~get\_physical\_size}
  1.3655  
  1.3656  {\bf Overview:} 
  1.3657 -get accessor message derived from field physical\_size of object SR
  1.3658 +Get the physical\_size field of the given SR.
  1.3659  
  1.3660   \noindent {\bf Signature:} 
  1.3661  \begin{verbatim} int get_physical_size (session_id s, SR ref self)\end{verbatim}
  1.3662 @@ -7196,7 +7650,7 @@ get accessor message derived from field 
  1.3663  \begin{tabular}{|c|c|p{7cm}|}
  1.3664   \hline
  1.3665  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3666 -{\tt SR ref } & self & object instance \\ \hline 
  1.3667 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3668  
  1.3669  \end{tabular}
  1.3670  
  1.3671 @@ -7215,7 +7669,7 @@ value of the field
  1.3672  \subsubsection{RPC name:~get\_type}
  1.3673  
  1.3674  {\bf Overview:} 
  1.3675 -get accessor message derived from field type of object SR
  1.3676 +Get the type field of the given SR.
  1.3677  
  1.3678   \noindent {\bf Signature:} 
  1.3679  \begin{verbatim} string get_type (session_id s, SR ref self)\end{verbatim}
  1.3680 @@ -7228,7 +7682,7 @@ get accessor message derived from field 
  1.3681  \begin{tabular}{|c|c|p{7cm}|}
  1.3682   \hline
  1.3683  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3684 -{\tt SR ref } & self & object instance \\ \hline 
  1.3685 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3686  
  1.3687  \end{tabular}
  1.3688  
  1.3689 @@ -7247,7 +7701,7 @@ value of the field
  1.3690  \subsubsection{RPC name:~get\_location}
  1.3691  
  1.3692  {\bf Overview:} 
  1.3693 -get accessor message derived from field location of object SR
  1.3694 +Get the location field of the given SR.
  1.3695  
  1.3696   \noindent {\bf Signature:} 
  1.3697  \begin{verbatim} string get_location (session_id s, SR ref self)\end{verbatim}
  1.3698 @@ -7260,7 +7714,7 @@ get accessor message derived from field 
  1.3699  \begin{tabular}{|c|c|p{7cm}|}
  1.3700   \hline
  1.3701  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3702 -{\tt SR ref } & self & object instance \\ \hline 
  1.3703 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3704  
  1.3705  \end{tabular}
  1.3706  
  1.3707 @@ -7279,7 +7733,7 @@ value of the field
  1.3708  \subsubsection{RPC name:~create}
  1.3709  
  1.3710  {\bf Overview:} 
  1.3711 -constructor for class SR
  1.3712 +Create a new SR instance, and return its handle.
  1.3713  
  1.3714   \noindent {\bf Signature:} 
  1.3715  \begin{verbatim} (SR ref) create (session_id s, SR record args)\end{verbatim}
  1.3716 @@ -7311,7 +7765,7 @@ reference to the newly created object
  1.3717  \subsubsection{RPC name:~destroy}
  1.3718  
  1.3719  {\bf Overview:} 
  1.3720 -destructor for class SR
  1.3721 +Destroy the specified SR instance.
  1.3722  
  1.3723   \noindent {\bf Signature:} 
  1.3724  \begin{verbatim} void destroy (session_id s, SR ref self)\end{verbatim}
  1.3725 @@ -7324,7 +7778,7 @@ destructor for class SR
  1.3726  \begin{tabular}{|c|c|p{7cm}|}
  1.3727   \hline
  1.3728  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3729 -{\tt SR ref } & self & object instance \\ \hline 
  1.3730 +{\tt SR ref } & self & reference to the object \\ \hline 
  1.3731  
  1.3732  \end{tabular}
  1.3733  
  1.3734 @@ -7343,7 +7797,7 @@ void
  1.3735  \subsubsection{RPC name:~get\_by\_uuid}
  1.3736  
  1.3737  {\bf Overview:} 
  1.3738 -returns the SR instance with a particular uuid
  1.3739 +Get a reference to the SR instance with the specified UUID.
  1.3740  
  1.3741   \noindent {\bf Signature:} 
  1.3742  \begin{verbatim} (SR ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.3743 @@ -7375,7 +7829,7 @@ reference to the object
  1.3744  \subsubsection{RPC name:~get\_record}
  1.3745  
  1.3746  {\bf Overview:} 
  1.3747 -returns a record containing the state of an instance of class SR
  1.3748 +Get a record containing the current state of the given SR.
  1.3749  
  1.3750   \noindent {\bf Signature:} 
  1.3751  \begin{verbatim} (SR record) get_record (session_id s, SR ref self)\end{verbatim}
  1.3752 @@ -7407,7 +7861,7 @@ all fields from the object
  1.3753  \subsubsection{RPC name:~get\_by\_name\_label}
  1.3754  
  1.3755  {\bf Overview:} 
  1.3756 -returns the SR instance with a particular name label
  1.3757 +Get all the SR instances with the given label.
  1.3758  
  1.3759   \noindent {\bf Signature:} 
  1.3760  \begin{verbatim} ((SR ref) Set) get_by_name_label (session_id s, string label)\end{verbatim}
  1.3761 @@ -7533,7 +7987,7 @@ void
  1.3762  \subsubsection{RPC name:~get\_uuid}
  1.3763  
  1.3764  {\bf Overview:} 
  1.3765 -get accessor message derived from field uuid of object VDI
  1.3766 +Get the uuid field of the given VDI.
  1.3767  
  1.3768   \noindent {\bf Signature:} 
  1.3769  \begin{verbatim} string get_uuid (session_id s, VDI ref self)\end{verbatim}
  1.3770 @@ -7546,7 +8000,7 @@ get accessor message derived from field 
  1.3771  \begin{tabular}{|c|c|p{7cm}|}
  1.3772   \hline
  1.3773  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3774 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3775 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3776  
  1.3777  \end{tabular}
  1.3778  
  1.3779 @@ -7565,7 +8019,7 @@ value of the field
  1.3780  \subsubsection{RPC name:~get\_name\_label}
  1.3781  
  1.3782  {\bf Overview:} 
  1.3783 -get accessor message derived from field name/label of object VDI
  1.3784 +Get the name/label field of the given VDI.
  1.3785  
  1.3786   \noindent {\bf Signature:} 
  1.3787  \begin{verbatim} string get_name_label (session_id s, VDI ref self)\end{verbatim}
  1.3788 @@ -7578,7 +8032,7 @@ get accessor message derived from field 
  1.3789  \begin{tabular}{|c|c|p{7cm}|}
  1.3790   \hline
  1.3791  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3792 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3793 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3794  
  1.3795  \end{tabular}
  1.3796  
  1.3797 @@ -7597,7 +8051,7 @@ value of the field
  1.3798  \subsubsection{RPC name:~set\_name\_label}
  1.3799  
  1.3800  {\bf Overview:} 
  1.3801 -set accessor message derived from field name/label of object VDI
  1.3802 +Set the name/label field of the given VDI.
  1.3803  
  1.3804   \noindent {\bf Signature:} 
  1.3805  \begin{verbatim} void set_name_label (session_id s, VDI ref self, string value)\end{verbatim}
  1.3806 @@ -7610,7 +8064,7 @@ set accessor message derived from field 
  1.3807  \begin{tabular}{|c|c|p{7cm}|}
  1.3808   \hline
  1.3809  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3810 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3811 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3812  
  1.3813  {\tt string } & value & New value to set \\ \hline 
  1.3814  
  1.3815 @@ -7631,7 +8085,7 @@ void
  1.3816  \subsubsection{RPC name:~get\_name\_description}
  1.3817  
  1.3818  {\bf Overview:} 
  1.3819 -get accessor message derived from field name/description of object VDI
  1.3820 +Get the name/description field of the given VDI.
  1.3821  
  1.3822   \noindent {\bf Signature:} 
  1.3823  \begin{verbatim} string get_name_description (session_id s, VDI ref self)\end{verbatim}
  1.3824 @@ -7644,7 +8098,7 @@ get accessor message derived from field 
  1.3825  \begin{tabular}{|c|c|p{7cm}|}
  1.3826   \hline
  1.3827  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3828 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3829 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3830  
  1.3831  \end{tabular}
  1.3832  
  1.3833 @@ -7663,7 +8117,7 @@ value of the field
  1.3834  \subsubsection{RPC name:~set\_name\_description}
  1.3835  
  1.3836  {\bf Overview:} 
  1.3837 -set accessor message derived from field name/description of object VDI
  1.3838 +Set the name/description field of the given VDI.
  1.3839  
  1.3840   \noindent {\bf Signature:} 
  1.3841  \begin{verbatim} void set_name_description (session_id s, VDI ref self, string value)\end{verbatim}
  1.3842 @@ -7676,7 +8130,7 @@ set accessor message derived from field 
  1.3843  \begin{tabular}{|c|c|p{7cm}|}
  1.3844   \hline
  1.3845  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3846 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3847 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3848  
  1.3849  {\tt string } & value & New value to set \\ \hline 
  1.3850  
  1.3851 @@ -7697,7 +8151,7 @@ void
  1.3852  \subsubsection{RPC name:~get\_SR}
  1.3853  
  1.3854  {\bf Overview:} 
  1.3855 -get accessor message derived from field SR of object VDI
  1.3856 +Get the SR field of the given VDI.
  1.3857  
  1.3858   \noindent {\bf Signature:} 
  1.3859  \begin{verbatim} (SR ref) get_SR (session_id s, VDI ref self)\end{verbatim}
  1.3860 @@ -7710,7 +8164,7 @@ get accessor message derived from field 
  1.3861  \begin{tabular}{|c|c|p{7cm}|}
  1.3862   \hline
  1.3863  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3864 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3865 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3866  
  1.3867  \end{tabular}
  1.3868  
  1.3869 @@ -7729,7 +8183,7 @@ value of the field
  1.3870  \subsubsection{RPC name:~set\_SR}
  1.3871  
  1.3872  {\bf Overview:} 
  1.3873 -set accessor message derived from field SR of object VDI
  1.3874 +Set the SR field of the given VDI.
  1.3875  
  1.3876   \noindent {\bf Signature:} 
  1.3877  \begin{verbatim} void set_SR (session_id s, VDI ref self, SR ref value)\end{verbatim}
  1.3878 @@ -7742,7 +8196,7 @@ set accessor message derived from field 
  1.3879  \begin{tabular}{|c|c|p{7cm}|}
  1.3880   \hline
  1.3881  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3882 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3883 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3884  
  1.3885  {\tt SR ref } & value & New value to set \\ \hline 
  1.3886  
  1.3887 @@ -7763,7 +8217,7 @@ void
  1.3888  \subsubsection{RPC name:~get\_VBDs}
  1.3889  
  1.3890  {\bf Overview:} 
  1.3891 -get accessor message derived from field VBDs of object VDI
  1.3892 +Get the VBDs field of the given VDI.
  1.3893  
  1.3894   \noindent {\bf Signature:} 
  1.3895  \begin{verbatim} ((VBD ref) Set) get_VBDs (session_id s, VDI ref self)\end{verbatim}
  1.3896 @@ -7776,7 +8230,7 @@ get accessor message derived from field 
  1.3897  \begin{tabular}{|c|c|p{7cm}|}
  1.3898   \hline
  1.3899  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3900 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3901 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3902  
  1.3903  \end{tabular}
  1.3904  
  1.3905 @@ -7795,7 +8249,7 @@ value of the field
  1.3906  \subsubsection{RPC name:~get\_virtual\_size}
  1.3907  
  1.3908  {\bf Overview:} 
  1.3909 -get accessor message derived from field virtual\_size of object VDI
  1.3910 +Get the virtual\_size field of the given VDI.
  1.3911  
  1.3912   \noindent {\bf Signature:} 
  1.3913  \begin{verbatim} int get_virtual_size (session_id s, VDI ref self)\end{verbatim}
  1.3914 @@ -7808,7 +8262,7 @@ get accessor message derived from field 
  1.3915  \begin{tabular}{|c|c|p{7cm}|}
  1.3916   \hline
  1.3917  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3918 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3919 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3920  
  1.3921  \end{tabular}
  1.3922  
  1.3923 @@ -7827,7 +8281,7 @@ value of the field
  1.3924  \subsubsection{RPC name:~set\_virtual\_size}
  1.3925  
  1.3926  {\bf Overview:} 
  1.3927 -set accessor message derived from field virtual\_size of object VDI
  1.3928 +Set the virtual\_size field of the given VDI.
  1.3929  
  1.3930   \noindent {\bf Signature:} 
  1.3931  \begin{verbatim} void set_virtual_size (session_id s, VDI ref self, int value)\end{verbatim}
  1.3932 @@ -7840,7 +8294,7 @@ set accessor message derived from field 
  1.3933  \begin{tabular}{|c|c|p{7cm}|}
  1.3934   \hline
  1.3935  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3936 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3937 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3938  
  1.3939  {\tt int } & value & New value to set \\ \hline 
  1.3940  
  1.3941 @@ -7861,7 +8315,7 @@ void
  1.3942  \subsubsection{RPC name:~get\_physical\_utilisation}
  1.3943  
  1.3944  {\bf Overview:} 
  1.3945 -get accessor message derived from field physical\_utilisation of object VDI
  1.3946 +Get the physical\_utilisation field of the given VDI.
  1.3947  
  1.3948   \noindent {\bf Signature:} 
  1.3949  \begin{verbatim} int get_physical_utilisation (session_id s, VDI ref self)\end{verbatim}
  1.3950 @@ -7874,7 +8328,7 @@ get accessor message derived from field 
  1.3951  \begin{tabular}{|c|c|p{7cm}|}
  1.3952   \hline
  1.3953  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3954 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3955 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3956  
  1.3957  \end{tabular}
  1.3958  
  1.3959 @@ -7893,7 +8347,7 @@ value of the field
  1.3960  \subsubsection{RPC name:~get\_sector\_size}
  1.3961  
  1.3962  {\bf Overview:} 
  1.3963 -get accessor message derived from field sector\_size of object VDI
  1.3964 +Get the sector\_size field of the given VDI.
  1.3965  
  1.3966   \noindent {\bf Signature:} 
  1.3967  \begin{verbatim} int get_sector_size (session_id s, VDI ref self)\end{verbatim}
  1.3968 @@ -7906,7 +8360,7 @@ get accessor message derived from field 
  1.3969  \begin{tabular}{|c|c|p{7cm}|}
  1.3970   \hline
  1.3971  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3972 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3973 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3974  
  1.3975  \end{tabular}
  1.3976  
  1.3977 @@ -7925,7 +8379,7 @@ value of the field
  1.3978  \subsubsection{RPC name:~get\_type}
  1.3979  
  1.3980  {\bf Overview:} 
  1.3981 -get accessor message derived from field type of object VDI
  1.3982 +Get the type field of the given VDI.
  1.3983  
  1.3984   \noindent {\bf Signature:} 
  1.3985  \begin{verbatim} (vdi_type) get_type (session_id s, VDI ref self)\end{verbatim}
  1.3986 @@ -7938,7 +8392,7 @@ get accessor message derived from field 
  1.3987  \begin{tabular}{|c|c|p{7cm}|}
  1.3988   \hline
  1.3989  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.3990 -{\tt VDI ref } & self & object instance \\ \hline 
  1.3991 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.3992  
  1.3993  \end{tabular}
  1.3994  
  1.3995 @@ -7957,7 +8411,7 @@ value of the field
  1.3996  \subsubsection{RPC name:~get\_parent}
  1.3997  
  1.3998  {\bf Overview:} 
  1.3999 -get accessor message derived from field parent of object VDI
  1.4000 +Get the parent field of the given VDI.
  1.4001  
  1.4002   \noindent {\bf Signature:} 
  1.4003  \begin{verbatim} (VDI ref) get_parent (session_id s, VDI ref self)\end{verbatim}
  1.4004 @@ -7970,7 +8424,7 @@ get accessor message derived from field 
  1.4005  \begin{tabular}{|c|c|p{7cm}|}
  1.4006   \hline
  1.4007  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4008 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4009 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4010  
  1.4011  \end{tabular}
  1.4012  
  1.4013 @@ -7989,7 +8443,7 @@ value of the field
  1.4014  \subsubsection{RPC name:~get\_children}
  1.4015  
  1.4016  {\bf Overview:} 
  1.4017 -get accessor message derived from field children of object VDI
  1.4018 +Get the children field of the given VDI.
  1.4019  
  1.4020   \noindent {\bf Signature:} 
  1.4021  \begin{verbatim} ((VDI ref) Set) get_children (session_id s, VDI ref self)\end{verbatim}
  1.4022 @@ -8002,7 +8456,7 @@ get accessor message derived from field 
  1.4023  \begin{tabular}{|c|c|p{7cm}|}
  1.4024   \hline
  1.4025  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4026 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4027 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4028  
  1.4029  \end{tabular}
  1.4030  
  1.4031 @@ -8021,7 +8475,7 @@ value of the field
  1.4032  \subsubsection{RPC name:~get\_sharable}
  1.4033  
  1.4034  {\bf Overview:} 
  1.4035 -get accessor message derived from field sharable of object VDI
  1.4036 +Get the sharable field of the given VDI.
  1.4037  
  1.4038   \noindent {\bf Signature:} 
  1.4039  \begin{verbatim} bool get_sharable (session_id s, VDI ref self)\end{verbatim}
  1.4040 @@ -8034,7 +8488,7 @@ get accessor message derived from field 
  1.4041  \begin{tabular}{|c|c|p{7cm}|}
  1.4042   \hline
  1.4043  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4044 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4045 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4046  
  1.4047  \end{tabular}
  1.4048  
  1.4049 @@ -8053,7 +8507,7 @@ value of the field
  1.4050  \subsubsection{RPC name:~set\_sharable}
  1.4051  
  1.4052  {\bf Overview:} 
  1.4053 -set accessor message derived from field sharable of object VDI
  1.4054 +Set the sharable field of the given VDI.
  1.4055  
  1.4056   \noindent {\bf Signature:} 
  1.4057  \begin{verbatim} void set_sharable (session_id s, VDI ref self, bool value)\end{verbatim}
  1.4058 @@ -8066,7 +8520,7 @@ set accessor message derived from field 
  1.4059  \begin{tabular}{|c|c|p{7cm}|}
  1.4060   \hline
  1.4061  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4062 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4063 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4064  
  1.4065  {\tt bool } & value & New value to set \\ \hline 
  1.4066  
  1.4067 @@ -8087,7 +8541,7 @@ void
  1.4068  \subsubsection{RPC name:~get\_read\_only}
  1.4069  
  1.4070  {\bf Overview:} 
  1.4071 -get accessor message derived from field read\_only of object VDI
  1.4072 +Get the read\_only field of the given VDI.
  1.4073  
  1.4074   \noindent {\bf Signature:} 
  1.4075  \begin{verbatim} bool get_read_only (session_id s, VDI ref self)\end{verbatim}
  1.4076 @@ -8100,7 +8554,7 @@ get accessor message derived from field 
  1.4077  \begin{tabular}{|c|c|p{7cm}|}
  1.4078   \hline
  1.4079  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4080 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4081 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4082  
  1.4083  \end{tabular}
  1.4084  
  1.4085 @@ -8119,7 +8573,7 @@ value of the field
  1.4086  \subsubsection{RPC name:~set\_read\_only}
  1.4087  
  1.4088  {\bf Overview:} 
  1.4089 -set accessor message derived from field read\_only of object VDI
  1.4090 +Set the read\_only field of the given VDI.
  1.4091  
  1.4092   \noindent {\bf Signature:} 
  1.4093  \begin{verbatim} void set_read_only (session_id s, VDI ref self, bool value)\end{verbatim}
  1.4094 @@ -8132,7 +8586,7 @@ set accessor message derived from field 
  1.4095  \begin{tabular}{|c|c|p{7cm}|}
  1.4096   \hline
  1.4097  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4098 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4099 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4100  
  1.4101  {\tt bool } & value & New value to set \\ \hline 
  1.4102  
  1.4103 @@ -8153,7 +8607,7 @@ void
  1.4104  \subsubsection{RPC name:~create}
  1.4105  
  1.4106  {\bf Overview:} 
  1.4107 -constructor for class VDI
  1.4108 +Create a new VDI instance, and return its handle.
  1.4109  
  1.4110   \noindent {\bf Signature:} 
  1.4111  \begin{verbatim} (VDI ref) create (session_id s, VDI record args)\end{verbatim}
  1.4112 @@ -8185,7 +8639,7 @@ reference to the newly created object
  1.4113  \subsubsection{RPC name:~destroy}
  1.4114  
  1.4115  {\bf Overview:} 
  1.4116 -destructor for class VDI
  1.4117 +Destroy the specified VDI instance.
  1.4118  
  1.4119   \noindent {\bf Signature:} 
  1.4120  \begin{verbatim} void destroy (session_id s, VDI ref self)\end{verbatim}
  1.4121 @@ -8198,7 +8652,7 @@ destructor for class VDI
  1.4122  \begin{tabular}{|c|c|p{7cm}|}
  1.4123   \hline
  1.4124  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4125 -{\tt VDI ref } & self & object instance \\ \hline 
  1.4126 +{\tt VDI ref } & self & reference to the object \\ \hline 
  1.4127  
  1.4128  \end{tabular}
  1.4129  
  1.4130 @@ -8217,7 +8671,7 @@ void
  1.4131  \subsubsection{RPC name:~get\_by\_uuid}
  1.4132  
  1.4133  {\bf Overview:} 
  1.4134 -returns the VDI instance with a particular uuid
  1.4135 +Get a reference to the VDI instance with the specified UUID.
  1.4136  
  1.4137   \noindent {\bf Signature:} 
  1.4138  \begin{verbatim} (VDI ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.4139 @@ -8249,7 +8703,7 @@ reference to the object
  1.4140  \subsubsection{RPC name:~get\_record}
  1.4141  
  1.4142  {\bf Overview:} 
  1.4143 -returns a record containing the state of an instance of class VDI
  1.4144 +Get a record containing the current state of the given VDI.
  1.4145  
  1.4146   \noindent {\bf Signature:} 
  1.4147  \begin{verbatim} (VDI record) get_record (session_id s, VDI ref self)\end{verbatim}
  1.4148 @@ -8281,7 +8735,7 @@ all fields from the object
  1.4149  \subsubsection{RPC name:~get\_by\_name\_label}
  1.4150  
  1.4151  {\bf Overview:} 
  1.4152 -returns the VDI instance with a particular name label
  1.4153 +Get all the VDI instances with the given label.
  1.4154  
  1.4155   \noindent {\bf Signature:} 
  1.4156  \begin{verbatim} ((VDI ref) Set) get_by_name_label (session_id s, string label)\end{verbatim}
  1.4157 @@ -8327,6 +8781,7 @@ Quals & Field & Type & Description \\
  1.4158  $\mathit{RW}$ &  {\tt VDI} & VDI ref & the virtual disk \\
  1.4159  $\mathit{RW}$ &  {\tt device} & string & device seen by the guest e.g. hda1 \\
  1.4160  $\mathit{RW}$ &  {\tt mode} & vbd\_mode & the mode the disk should be mounted with \\
  1.4161 +$\mathit{RW}$ &  {\tt type} & vbd\_type & how the VBD will appear to the guest (e.g. disk or CD) \\
  1.4162  $\mathit{RW}$ &  {\tt driver} & driver\_type & the style of driver \\
  1.4163  $\mathit{RO}_\mathit{run}$ &  {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
  1.4164  $\mathit{RO}_\mathit{run}$ &  {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
  1.4165 @@ -8370,7 +8825,7 @@ void
  1.4166  \subsubsection{RPC name:~get\_uuid}
  1.4167  
  1.4168  {\bf Overview:} 
  1.4169 -get accessor message derived from field uuid of object VBD
  1.4170 +Get the uuid field of the given VBD.
  1.4171  
  1.4172   \noindent {\bf Signature:} 
  1.4173  \begin{verbatim} string get_uuid (session_id s, VBD ref self)\end{verbatim}
  1.4174 @@ -8383,7 +8838,7 @@ get accessor message derived from field 
  1.4175  \begin{tabular}{|c|c|p{7cm}|}
  1.4176   \hline
  1.4177  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4178 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4179 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4180  
  1.4181  \end{tabular}
  1.4182  
  1.4183 @@ -8402,7 +8857,7 @@ value of the field
  1.4184  \subsubsection{RPC name:~get\_VM}
  1.4185  
  1.4186  {\bf Overview:} 
  1.4187 -get accessor message derived from field VM of object VBD
  1.4188 +Get the VM field of the given VBD.
  1.4189  
  1.4190   \noindent {\bf Signature:} 
  1.4191  \begin{verbatim} (VM ref) get_VM (session_id s, VBD ref self)\end{verbatim}
  1.4192 @@ -8415,7 +8870,7 @@ get accessor message derived from field 
  1.4193  \begin{tabular}{|c|c|p{7cm}|}
  1.4194   \hline
  1.4195  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4196 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4197 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4198  
  1.4199  \end{tabular}
  1.4200  
  1.4201 @@ -8434,7 +8889,7 @@ value of the field
  1.4202  \subsubsection{RPC name:~set\_VM}
  1.4203  
  1.4204  {\bf Overview:} 
  1.4205 -set accessor message derived from field VM of object VBD
  1.4206 +Set the VM field of the given VBD.
  1.4207  
  1.4208   \noindent {\bf Signature:} 
  1.4209  \begin{verbatim} void set_VM (session_id s, VBD ref self, VM ref value)\end{verbatim}
  1.4210 @@ -8447,7 +8902,7 @@ set accessor message derived from field 
  1.4211  \begin{tabular}{|c|c|p{7cm}|}
  1.4212   \hline
  1.4213  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4214 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4215 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4216  
  1.4217  {\tt VM ref } & value & New value to set \\ \hline 
  1.4218  
  1.4219 @@ -8468,7 +8923,7 @@ void
  1.4220  \subsubsection{RPC name:~get\_VDI}
  1.4221  
  1.4222  {\bf Overview:} 
  1.4223 -get accessor message derived from field VDI of object VBD
  1.4224 +Get the VDI field of the given VBD.
  1.4225  
  1.4226   \noindent {\bf Signature:} 
  1.4227  \begin{verbatim} (VDI ref) get_VDI (session_id s, VBD ref self)\end{verbatim}
  1.4228 @@ -8481,7 +8936,7 @@ get accessor message derived from field 
  1.4229  \begin{tabular}{|c|c|p{7cm}|}
  1.4230   \hline
  1.4231  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4232 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4233 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4234  
  1.4235  \end{tabular}
  1.4236  
  1.4237 @@ -8500,7 +8955,7 @@ value of the field
  1.4238  \subsubsection{RPC name:~set\_VDI}
  1.4239  
  1.4240  {\bf Overview:} 
  1.4241 -set accessor message derived from field VDI of object VBD
  1.4242 +Set the VDI field of the given VBD.
  1.4243  
  1.4244   \noindent {\bf Signature:} 
  1.4245  \begin{verbatim} void set_VDI (session_id s, VBD ref self, VDI ref value)\end{verbatim}
  1.4246 @@ -8513,7 +8968,7 @@ set accessor message derived from field 
  1.4247  \begin{tabular}{|c|c|p{7cm}|}
  1.4248   \hline
  1.4249  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4250 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4251 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4252  
  1.4253  {\tt VDI ref } & value & New value to set \\ \hline 
  1.4254  
  1.4255 @@ -8534,7 +8989,7 @@ void
  1.4256  \subsubsection{RPC name:~get\_device}
  1.4257  
  1.4258  {\bf Overview:} 
  1.4259 -get accessor message derived from field device of object VBD
  1.4260 +Get the device field of the given VBD.
  1.4261  
  1.4262   \noindent {\bf Signature:} 
  1.4263  \begin{verbatim} string get_device (session_id s, VBD ref self)\end{verbatim}
  1.4264 @@ -8547,7 +9002,7 @@ get accessor message derived from field 
  1.4265  \begin{tabular}{|c|c|p{7cm}|}
  1.4266   \hline
  1.4267  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4268 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4269 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4270  
  1.4271  \end{tabular}
  1.4272  
  1.4273 @@ -8566,7 +9021,7 @@ value of the field
  1.4274  \subsubsection{RPC name:~set\_device}
  1.4275  
  1.4276  {\bf Overview:} 
  1.4277 -set accessor message derived from field device of object VBD
  1.4278 +Set the device field of the given VBD.
  1.4279  
  1.4280   \noindent {\bf Signature:} 
  1.4281  \begin{verbatim} void set_device (session_id s, VBD ref self, string value)\end{verbatim}
  1.4282 @@ -8579,7 +9034,7 @@ set accessor message derived from field 
  1.4283  \begin{tabular}{|c|c|p{7cm}|}
  1.4284   \hline
  1.4285  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4286 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4287 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4288  
  1.4289  {\tt string } & value & New value to set \\ \hline 
  1.4290  
  1.4291 @@ -8600,7 +9055,7 @@ void
  1.4292  \subsubsection{RPC name:~get\_mode}
  1.4293  
  1.4294  {\bf Overview:} 
  1.4295 -get accessor message derived from field mode of object VBD
  1.4296 +Get the mode field of the given VBD.
  1.4297  
  1.4298   \noindent {\bf Signature:} 
  1.4299  \begin{verbatim} (vbd_mode) get_mode (session_id s, VBD ref self)\end{verbatim}
  1.4300 @@ -8613,7 +9068,7 @@ get accessor message derived from field 
  1.4301  \begin{tabular}{|c|c|p{7cm}|}
  1.4302   \hline
  1.4303  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4304 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4305 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4306  
  1.4307  \end{tabular}
  1.4308  
  1.4309 @@ -8632,7 +9087,7 @@ value of the field
  1.4310  \subsubsection{RPC name:~set\_mode}
  1.4311  
  1.4312  {\bf Overview:} 
  1.4313 -set accessor message derived from field mode of object VBD
  1.4314 +Set the mode field of the given VBD.
  1.4315  
  1.4316   \noindent {\bf Signature:} 
  1.4317  \begin{verbatim} void set_mode (session_id s, VBD ref self, vbd_mode value)\end{verbatim}
  1.4318 @@ -8645,7 +9100,7 @@ set accessor message derived from field 
  1.4319  \begin{tabular}{|c|c|p{7cm}|}
  1.4320   \hline
  1.4321  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4322 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4323 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4324  
  1.4325  {\tt vbd\_mode } & value & New value to set \\ \hline 
  1.4326  
  1.4327 @@ -8663,10 +9118,76 @@ void
  1.4328  \vspace{0.3cm}
  1.4329  \vspace{0.3cm}
  1.4330  \vspace{0.3cm}
  1.4331 +\subsubsection{RPC name:~get\_type}
  1.4332 +
  1.4333 +{\bf Overview:} 
  1.4334 +Get the type field of the given VBD.
  1.4335 +
  1.4336 + \noindent {\bf Signature:} 
  1.4337 +\begin{verbatim} (vbd_type) get_type (session_id s, VBD ref self)\end{verbatim}
  1.4338 +
  1.4339 +
  1.4340 +\noindent{\bf Arguments:}
  1.4341 +
  1.4342 + 
  1.4343 +\vspace{0.3cm}
  1.4344 +\begin{tabular}{|c|c|p{7cm}|}
  1.4345 + \hline
  1.4346 +{\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4347 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4348 +
  1.4349 +\end{tabular}
  1.4350 +
  1.4351 +\vspace{0.3cm}
  1.4352 +
  1.4353 + \noindent {\bf Return Type:} 
  1.4354 +{\tt 
  1.4355 +vbd\_type
  1.4356 +}
  1.4357 +
  1.4358 +
  1.4359 +value of the field
  1.4360 +\vspace{0.3cm}
  1.4361 +\vspace{0.3cm}
  1.4362 +\vspace{0.3cm}
  1.4363 +\subsubsection{RPC name:~set\_type}
  1.4364 +
  1.4365 +{\bf Overview:} 
  1.4366 +Set the type field of the given VBD.
  1.4367 +
  1.4368 + \noindent {\bf Signature:} 
  1.4369 +\begin{verbatim} void set_type (session_id s, VBD ref self, vbd_type value)\end{verbatim}
  1.4370 +
  1.4371 +
  1.4372 +\noindent{\bf Arguments:}
  1.4373 +
  1.4374 + 
  1.4375 +\vspace{0.3cm}
  1.4376 +\begin{tabular}{|c|c|p{7cm}|}
  1.4377 + \hline
  1.4378 +{\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4379 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4380 +
  1.4381 +{\tt vbd\_type } & value & New value to set \\ \hline 
  1.4382 +
  1.4383 +\end{tabular}
  1.4384 +
  1.4385 +\vspace{0.3cm}
  1.4386 +
  1.4387 + \noindent {\bf Return Type:} 
  1.4388 +{\tt 
  1.4389 +void
  1.4390 +}
  1.4391 +
  1.4392 +
  1.4393 +
  1.4394 +\vspace{0.3cm}
  1.4395 +\vspace{0.3cm}
  1.4396 +\vspace{0.3cm}
  1.4397  \subsubsection{RPC name:~get\_driver}
  1.4398  
  1.4399  {\bf Overview:} 
  1.4400 -get accessor message derived from field driver of object VBD
  1.4401 +Get the driver field of the given VBD.
  1.4402  
  1.4403   \noindent {\bf Signature:} 
  1.4404  \begin{verbatim} (driver_type) get_driver (session_id s, VBD ref self)\end{verbatim}
  1.4405 @@ -8679,7 +9200,7 @@ get accessor message derived from field 
  1.4406  \begin{tabular}{|c|c|p{7cm}|}
  1.4407   \hline
  1.4408  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4409 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4410 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4411  
  1.4412  \end{tabular}
  1.4413  
  1.4414 @@ -8698,7 +9219,7 @@ value of the field
  1.4415  \subsubsection{RPC name:~set\_driver}
  1.4416  
  1.4417  {\bf Overview:} 
  1.4418 -set accessor message derived from field driver of object VBD
  1.4419 +Set the driver field of the given VBD.
  1.4420  
  1.4421   \noindent {\bf Signature:} 
  1.4422  \begin{verbatim} void set_driver (session_id s, VBD ref self, driver_type value)\end{verbatim}
  1.4423 @@ -8711,7 +9232,7 @@ set accessor message derived from field 
  1.4424  \begin{tabular}{|c|c|p{7cm}|}
  1.4425   \hline
  1.4426  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4427 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4428 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4429  
  1.4430  {\tt driver\_type } & value & New value to set \\ \hline 
  1.4431  
  1.4432 @@ -8732,7 +9253,7 @@ void
  1.4433  \subsubsection{RPC name:~get\_io\_read\_kbs}
  1.4434  
  1.4435  {\bf Overview:} 
  1.4436 -get accessor message derived from field io/read\_kbs of object VBD
  1.4437 +Get the io/read\_kbs field of the given VBD.
  1.4438  
  1.4439   \noindent {\bf Signature:} 
  1.4440  \begin{verbatim} float get_io_read_kbs (session_id s, VBD ref self)\end{verbatim}
  1.4441 @@ -8745,7 +9266,7 @@ get accessor message derived from field 
  1.4442  \begin{tabular}{|c|c|p{7cm}|}
  1.4443   \hline
  1.4444  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4445 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4446 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4447  
  1.4448  \end{tabular}
  1.4449  
  1.4450 @@ -8764,7 +9285,7 @@ value of the field
  1.4451  \subsubsection{RPC name:~get\_io\_write\_kbs}
  1.4452  
  1.4453  {\bf Overview:} 
  1.4454 -get accessor message derived from field io/write\_kbs of object VBD
  1.4455 +Get the io/write\_kbs field of the given VBD.
  1.4456  
  1.4457   \noindent {\bf Signature:} 
  1.4458  \begin{verbatim} float get_io_write_kbs (session_id s, VBD ref self)\end{verbatim}
  1.4459 @@ -8777,7 +9298,7 @@ get accessor message derived from field 
  1.4460  \begin{tabular}{|c|c|p{7cm}|}
  1.4461   \hline
  1.4462  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4463 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4464 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4465  
  1.4466  \end{tabular}
  1.4467  
  1.4468 @@ -8796,7 +9317,7 @@ value of the field
  1.4469  \subsubsection{RPC name:~create}
  1.4470  
  1.4471  {\bf Overview:} 
  1.4472 -constructor for class VBD
  1.4473 +Create a new VBD instance, and return its handle.
  1.4474  
  1.4475   \noindent {\bf Signature:} 
  1.4476  \begin{verbatim} (VBD ref) create (session_id s, VBD record args)\end{verbatim}
  1.4477 @@ -8828,7 +9349,7 @@ reference to the newly created object
  1.4478  \subsubsection{RPC name:~destroy}
  1.4479  
  1.4480  {\bf Overview:} 
  1.4481 -destructor for class VBD
  1.4482 +Destroy the specified VBD instance.
  1.4483  
  1.4484   \noindent {\bf Signature:} 
  1.4485  \begin{verbatim} void destroy (session_id s, VBD ref self)\end{verbatim}
  1.4486 @@ -8841,7 +9362,7 @@ destructor for class VBD
  1.4487  \begin{tabular}{|c|c|p{7cm}|}
  1.4488   \hline
  1.4489  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4490 -{\tt VBD ref } & self & object instance \\ \hline 
  1.4491 +{\tt VBD ref } & self & reference to the object \\ \hline 
  1.4492  
  1.4493  \end{tabular}
  1.4494  
  1.4495 @@ -8860,7 +9381,7 @@ void
  1.4496  \subsubsection{RPC name:~get\_by\_uuid}
  1.4497  
  1.4498  {\bf Overview:} 
  1.4499 -returns the VBD instance with a particular uuid
  1.4500 +Get a reference to the VBD instance with the specified UUID.
  1.4501  
  1.4502   \noindent {\bf Signature:} 
  1.4503  \begin{verbatim} (VBD ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.4504 @@ -8892,7 +9413,7 @@ reference to the object
  1.4505  \subsubsection{RPC name:~get\_record}
  1.4506  
  1.4507  {\bf Overview:} 
  1.4508 -returns a record containing the state of an instance of class VBD
  1.4509 +Get a record containing the current state of the given VBD.
  1.4510  
  1.4511   \noindent {\bf Signature:} 
  1.4512  \begin{verbatim} (VBD record) get_record (session_id s, VBD ref self)\end{verbatim}
  1.4513 @@ -8944,7 +9465,7 @@ Quals & Field & Type & Description \\
  1.4514  \subsubsection{RPC name:~get\_uuid}
  1.4515  
  1.4516  {\bf Overview:} 
  1.4517 -get accessor message derived from field uuid of object VTPM
  1.4518 +Get the uuid field of the given VTPM.
  1.4519  
  1.4520   \noindent {\bf Signature:} 
  1.4521  \begin{verbatim} string get_uuid (session_id s, VTPM ref self)\end{verbatim}
  1.4522 @@ -8957,7 +9478,7 @@ get accessor message derived from field 
  1.4523  \begin{tabular}{|c|c|p{7cm}|}
  1.4524   \hline
  1.4525  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4526 -{\tt VTPM ref } & self & object instance \\ \hline 
  1.4527 +{\tt VTPM ref } & self & reference to the object \\ \hline 
  1.4528  
  1.4529  \end{tabular}
  1.4530  
  1.4531 @@ -8976,7 +9497,7 @@ value of the field
  1.4532  \subsubsection{RPC name:~get\_VM}
  1.4533  
  1.4534  {\bf Overview:} 
  1.4535 -get accessor message derived from field VM of object VTPM
  1.4536 +Get the VM field of the given VTPM.
  1.4537  
  1.4538   \noindent {\bf Signature:} 
  1.4539  \begin{verbatim} (VM ref) get_VM (session_id s, VTPM ref self)\end{verbatim}
  1.4540 @@ -8989,7 +9510,7 @@ get accessor message derived from field 
  1.4541  \begin{tabular}{|c|c|p{7cm}|}
  1.4542   \hline
  1.4543  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4544 -{\tt VTPM ref } & self & object instance \\ \hline 
  1.4545 +{\tt VTPM ref } & self & reference to the object \\ \hline 
  1.4546  
  1.4547  \end{tabular}
  1.4548  
  1.4549 @@ -9008,7 +9529,7 @@ value of the field
  1.4550  \subsubsection{RPC name:~get\_backend}
  1.4551  
  1.4552  {\bf Overview:} 
  1.4553 -get accessor message derived from field backend of object VTPM
  1.4554 +Get the backend field of the given VTPM.
  1.4555  
  1.4556   \noindent {\bf Signature:} 
  1.4557  \begin{verbatim} (VM ref) get_backend (session_id s, VTPM ref self)\end{verbatim}
  1.4558 @@ -9021,7 +9542,7 @@ get accessor message derived from field 
  1.4559  \begin{tabular}{|c|c|p{7cm}|}
  1.4560   \hline
  1.4561  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4562 -{\tt VTPM ref } & self & object instance \\ \hline 
  1.4563 +{\tt VTPM ref } & self & reference to the object \\ \hline 
  1.4564  
  1.4565  \end{tabular}
  1.4566  
  1.4567 @@ -9040,7 +9561,7 @@ value of the field
  1.4568  \subsubsection{RPC name:~get\_driver}
  1.4569  
  1.4570  {\bf Overview:} 
  1.4571 -get accessor message derived from field driver of object VTPM
  1.4572 +Get the driver field of the given VTPM.
  1.4573  
  1.4574   \noindent {\bf Signature:} 
  1.4575  \begin{verbatim} (driver_type) get_driver (session_id s, VTPM ref self)\end{verbatim}
  1.4576 @@ -9053,7 +9574,7 @@ get accessor message derived from field 
  1.4577  \begin{tabular}{|c|c|p{7cm}|}
  1.4578   \hline
  1.4579  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4580 -{\tt VTPM ref } & self & object instance \\ \hline 
  1.4581 +{\tt VTPM ref } & self & reference to the object \\ \hline 
  1.4582  
  1.4583  \end{tabular}
  1.4584  
  1.4585 @@ -9072,7 +9593,7 @@ value of the field
  1.4586  \subsubsection{RPC name:~get\_instance}
  1.4587  
  1.4588  {\bf Overview:} 
  1.4589 -get accessor message derived from field instance of object VTPM
  1.4590 +Get the instance field of the given VTPM.
  1.4591  
  1.4592   \noindent {\bf Signature:} 
  1.4593  \begin{verbatim} int get_instance (session_id s, VTPM ref self)\end{verbatim}
  1.4594 @@ -9085,7 +9606,7 @@ get accessor message derived from field 
  1.4595  \begin{tabular}{|c|c|p{7cm}|}
  1.4596   \hline
  1.4597  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4598 -{\tt VTPM ref } & self & object instance \\ \hline 
  1.4599 +{\tt VTPM ref } & self & reference to the object \\ \hline 
  1.4600  
  1.4601  \end{tabular}
  1.4602  
  1.4603 @@ -9104,7 +9625,7 @@ value of the field
  1.4604  \subsubsection{RPC name:~create}
  1.4605  
  1.4606  {\bf Overview:} 
  1.4607 -constructor for class VTPM
  1.4608 +Create a new VTPM instance, and return its handle.
  1.4609  
  1.4610   \noindent {\bf Signature:} 
  1.4611  \begin{verbatim} (VTPM ref) create (session_id s, VTPM record args)\end{verbatim}
  1.4612 @@ -9136,7 +9657,7 @@ reference to the newly created object
  1.4613  \subsubsection{RPC name:~destroy}
  1.4614  
  1.4615  {\bf Overview:} 
  1.4616 -destructor for class VTPM
  1.4617 +Destroy the specified VTPM instance.
  1.4618  
  1.4619   \noindent {\bf Signature:} 
  1.4620  \begin{verbatim} void destroy (session_id s, VTPM ref self)\end{verbatim}
  1.4621 @@ -9149,7 +9670,7 @@ destructor for class VTPM
  1.4622  \begin{tabular}{|c|c|p{7cm}|}
  1.4623   \hline
  1.4624  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4625 -{\tt VTPM ref } & self & object instance \\ \hline 
  1.4626 +{\tt VTPM ref } & self & reference to the object \\ \hline 
  1.4627  
  1.4628  \end{tabular}
  1.4629  
  1.4630 @@ -9168,7 +9689,7 @@ void
  1.4631  \subsubsection{RPC name:~get\_by\_uuid}
  1.4632  
  1.4633  {\bf Overview:} 
  1.4634 -returns the VTPM instance with a particular uuid
  1.4635 +Get a reference to the VTPM instance with the specified UUID.
  1.4636  
  1.4637   \noindent {\bf Signature:} 
  1.4638  \begin{verbatim} (VTPM ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.4639 @@ -9200,7 +9721,7 @@ reference to the object
  1.4640  \subsubsection{RPC name:~get\_record}
  1.4641  
  1.4642  {\bf Overview:} 
  1.4643 -returns a record containing the state of an instance of class VTPM
  1.4644 +Get a record containing the current state of the given VTPM.
  1.4645  
  1.4646   \noindent {\bf Signature:} 
  1.4647  \begin{verbatim} (VTPM record) get_record (session_id s, VTPM ref self)\end{verbatim}
  1.4648 @@ -9360,7 +9881,7 @@ Destroy the specified console instance.
  1.4649  \begin{tabular}{|c|c|p{7cm}|}
  1.4650   \hline
  1.4651  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4652 -{\tt console ref } & self & object instance \\ \hline 
  1.4653 +{\tt console ref } & self & reference to the object \\ \hline 
  1.4654  
  1.4655  \end{tabular}
  1.4656  
  1.4657 @@ -9392,7 +9913,7 @@ Get the uuid field of the given console.
  1.4658  \begin{tabular}{|c|c|p{7cm}|}
  1.4659   \hline
  1.4660  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4661 -{\tt console ref } & self & object instance \\ \hline 
  1.4662 +{\tt console ref } & self & reference to the object \\ \hline 
  1.4663  
  1.4664  \end{tabular}
  1.4665  
  1.4666 @@ -9424,7 +9945,7 @@ Get the protocol field of the given cons
  1.4667  \begin{tabular}{|c|c|p{7cm}|}
  1.4668   \hline
  1.4669  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4670 -{\tt console ref } & self & object instance \\ \hline 
  1.4671 +{\tt console ref } & self & reference to the object \\ \hline 
  1.4672  
  1.4673  \end{tabular}
  1.4674  
  1.4675 @@ -9456,7 +9977,7 @@ Get the uri field of the given console.
  1.4676  \begin{tabular}{|c|c|p{7cm}|}
  1.4677   \hline
  1.4678  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4679 -{\tt console ref } & self & object instance \\ \hline 
  1.4680 +{\tt console ref } & self & reference to the object \\ \hline 
  1.4681  
  1.4682  \end{tabular}
  1.4683  
  1.4684 @@ -9488,7 +10009,7 @@ Get the VM field of the given console.
  1.4685  \begin{tabular}{|c|c|p{7cm}|}
  1.4686   \hline
  1.4687  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4688 -{\tt console ref } & self & object instance \\ \hline 
  1.4689 +{\tt console ref } & self & reference to the object \\ \hline 
  1.4690  
  1.4691  \end{tabular}
  1.4692  
  1.4693 @@ -9525,7 +10046,7 @@ Quals & Field & Type & Description \\
  1.4694  \subsubsection{RPC name:~get\_uuid}
  1.4695  
  1.4696  {\bf Overview:} 
  1.4697 -get accessor message derived from field uuid of object user
  1.4698 +Get the uuid field of the given user.
  1.4699  
  1.4700   \noindent {\bf Signature:} 
  1.4701  \begin{verbatim} string get_uuid (session_id s, user ref self)\end{verbatim}
  1.4702 @@ -9538,7 +10059,7 @@ get accessor message derived from field 
  1.4703  \begin{tabular}{|c|c|p{7cm}|}
  1.4704   \hline
  1.4705  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4706 -{\tt user ref } & self & object instance \\ \hline 
  1.4707 +{\tt user ref } & self & reference to the object \\ \hline 
  1.4708  
  1.4709  \end{tabular}
  1.4710  
  1.4711 @@ -9557,7 +10078,7 @@ value of the field
  1.4712  \subsubsection{RPC name:~get\_short\_name}
  1.4713  
  1.4714  {\bf Overview:} 
  1.4715 -get accessor message derived from field short\_name of object user
  1.4716 +Get the short\_name field of the given user.
  1.4717  
  1.4718   \noindent {\bf Signature:} 
  1.4719  \begin{verbatim} string get_short_name (session_id s, user ref self)\end{verbatim}
  1.4720 @@ -9570,7 +10091,7 @@ get accessor message derived from field 
  1.4721  \begin{tabular}{|c|c|p{7cm}|}
  1.4722   \hline
  1.4723  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4724 -{\tt user ref } & self & object instance \\ \hline 
  1.4725 +{\tt user ref } & self & reference to the object \\ \hline 
  1.4726  
  1.4727  \end{tabular}
  1.4728  
  1.4729 @@ -9589,7 +10110,7 @@ value of the field
  1.4730  \subsubsection{RPC name:~get\_fullname}
  1.4731  
  1.4732  {\bf Overview:} 
  1.4733 -get accessor message derived from field fullname of object user
  1.4734 +Get the fullname field of the given user.
  1.4735  
  1.4736   \noindent {\bf Signature:} 
  1.4737  \begin{verbatim} string get_fullname (session_id s, user ref self)\end{verbatim}
  1.4738 @@ -9602,7 +10123,7 @@ get accessor message derived from field 
  1.4739  \begin{tabular}{|c|c|p{7cm}|}
  1.4740   \hline
  1.4741  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4742 -{\tt user ref } & self & object instance \\ \hline 
  1.4743 +{\tt user ref } & self & reference to the object \\ \hline 
  1.4744  
  1.4745  \end{tabular}
  1.4746  
  1.4747 @@ -9621,7 +10142,7 @@ value of the field
  1.4748  \subsubsection{RPC name:~set\_fullname}
  1.4749  
  1.4750  {\bf Overview:} 
  1.4751 -set accessor message derived from field fullname of object user
  1.4752 +Set the fullname field of the given user.
  1.4753  
  1.4754   \noindent {\bf Signature:} 
  1.4755  \begin{verbatim} void set_fullname (session_id s, user ref self, string value)\end{verbatim}
  1.4756 @@ -9634,7 +10155,7 @@ set accessor message derived from field 
  1.4757  \begin{tabular}{|c|c|p{7cm}|}
  1.4758   \hline
  1.4759  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4760 -{\tt user ref } & self & object instance \\ \hline 
  1.4761 +{\tt user ref } & self & reference to the object \\ \hline 
  1.4762  
  1.4763  {\tt string } & value & New value to set \\ \hline 
  1.4764  
  1.4765 @@ -9655,7 +10176,7 @@ void
  1.4766  \subsubsection{RPC name:~create}
  1.4767  
  1.4768  {\bf Overview:} 
  1.4769 -constructor for class user
  1.4770 +Create a new user instance, and return its handle.
  1.4771  
  1.4772   \noindent {\bf Signature:} 
  1.4773  \begin{verbatim} (user ref) create (session_id s, user record args)\end{verbatim}
  1.4774 @@ -9687,7 +10208,7 @@ reference to the newly created object
  1.4775  \subsubsection{RPC name:~destroy}
  1.4776  
  1.4777  {\bf Overview:} 
  1.4778 -destructor for class user
  1.4779 +Destroy the specified user instance.
  1.4780  
  1.4781   \noindent {\bf Signature:} 
  1.4782  \begin{verbatim} void destroy (session_id s, user ref self)\end{verbatim}
  1.4783 @@ -9700,7 +10221,7 @@ destructor for class user
  1.4784  \begin{tabular}{|c|c|p{7cm}|}
  1.4785   \hline
  1.4786  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4787 -{\tt user ref } & self & object instance \\ \hline 
  1.4788 +{\tt user ref } & self & reference to the object \\ \hline 
  1.4789  
  1.4790  \end{tabular}
  1.4791  
  1.4792 @@ -9719,7 +10240,7 @@ void
  1.4793  \subsubsection{RPC name:~get\_by\_uuid}
  1.4794  
  1.4795  {\bf Overview:} 
  1.4796 -returns the user instance with a particular uuid
  1.4797 +Get a reference to the user instance with the specified UUID.
  1.4798  
  1.4799   \noindent {\bf Signature:} 
  1.4800  \begin{verbatim} (user ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.4801 @@ -9751,7 +10272,7 @@ reference to the object
  1.4802  \subsubsection{RPC name:~get\_record}
  1.4803  
  1.4804  {\bf Overview:} 
  1.4805 -returns a record containing the state of an instance of class user
  1.4806 +Get a record containing the current state of the given user.
  1.4807  
  1.4808   \noindent {\bf Signature:} 
  1.4809  \begin{verbatim} (user record) get_record (session_id s, user ref self)\end{verbatim}
  1.4810 @@ -9832,7 +10353,7 @@ void
  1.4811  \subsubsection{RPC name:~create}
  1.4812  
  1.4813  {\bf Overview:} 
  1.4814 -constructor for class debug
  1.4815 +Create a new debug instance, and return its handle.
  1.4816  
  1.4817   \noindent {\bf Signature:} 
  1.4818  \begin{verbatim} (debug ref) create (session_id s, debug record args)\end{verbatim}
  1.4819 @@ -9864,7 +10385,7 @@ reference to the newly created object
  1.4820  \subsubsection{RPC name:~destroy}
  1.4821  
  1.4822  {\bf Overview:} 
  1.4823 -destructor for class debug
  1.4824 +Destroy the specified debug instance.
  1.4825  
  1.4826   \noindent {\bf Signature:} 
  1.4827  \begin{verbatim} void destroy (session_id s, debug ref self)\end{verbatim}
  1.4828 @@ -9877,7 +10398,7 @@ destructor for class debug
  1.4829  \begin{tabular}{|c|c|p{7cm}|}
  1.4830   \hline
  1.4831  {\bf type} & {\bf name} & {\bf description} \\ \hline
  1.4832 -{\tt debug ref } & self & object instance \\ \hline 
  1.4833 +{\tt debug ref } & self & reference to the object \\ \hline 
  1.4834  
  1.4835  \end{tabular}
  1.4836  
  1.4837 @@ -9896,7 +10417,7 @@ void
  1.4838  \subsubsection{RPC name:~get\_by\_uuid}
  1.4839  
  1.4840  {\bf Overview:} 
  1.4841 -returns the debug instance with a particular uuid
  1.4842 +Get a reference to the debug instance with the specified UUID.
  1.4843  
  1.4844   \noindent {\bf Signature:} 
  1.4845  \begin{verbatim} (debug ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
  1.4846 @@ -9928,7 +10449,7 @@ reference to the object
  1.4847  \subsubsection{RPC name:~get\_record}
  1.4848  
  1.4849  {\bf Overview:} 
  1.4850 -returns a record containing the state of an instance of class debug
  1.4851 +Get a record containing the current state of the given debug.
  1.4852  
  1.4853   \noindent {\bf Signature:} 
  1.4854  \begin{verbatim} (debug record) get_record (session_id s, debug ref self)\end{verbatim}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/crash.c	Fri Dec 08 09:09:18 2006 -0700
     2.3 @@ -0,0 +1,187 @@
     2.4 +/*
     2.5 + * Architecture specific (i386) functions for kexec based crash dumps.
     2.6 + *
     2.7 + * Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
     2.8 + *
     2.9 + * Copyright (C) IBM Corporation, 2004. All rights reserved.
    2.10 + *
    2.11 + */
    2.12 +
    2.13 +#include <linux/init.h>
    2.14 +#include <linux/types.h>
    2.15 +#include <linux/kernel.h>
    2.16 +#include <linux/smp.h>
    2.17 +#include <linux/reboot.h>
    2.18 +#include <linux/kexec.h>
    2.19 +#include <linux/delay.h>
    2.20 +#include <linux/elf.h>
    2.21 +#include <linux/elfcore.h>
    2.22 +
    2.23 +#include <asm/processor.h>
    2.24 +#include <asm/hardirq.h>
    2.25 +#include <asm/nmi.h>
    2.26 +#include <asm/hw_irq.h>
    2.27 +#include <asm/apic.h>
    2.28 +#include <mach_ipi.h>
    2.29 +
    2.30 +
    2.31 +/* This keeps a track of which one is crashing cpu. */
    2.32 +static int crashing_cpu;
    2.33 +
    2.34 +static u32 *append_elf_note(u32 *buf, char *name, unsigned type, void *data,
    2.35 +							       size_t data_len)
    2.36 +{
    2.37 +	struct elf_note note;
    2.38 +
    2.39 +	note.n_namesz = strlen(name) + 1;
    2.40 +	note.n_descsz = data_len;
    2.41 +	note.n_type   = type;
    2.42 +	memcpy(buf, &note, sizeof(note));
    2.43 +	buf += (sizeof(note) +3)/4;
    2.44 +	memcpy(buf, name, note.n_namesz);
    2.45 +	buf += (note.n_namesz + 3)/4;
    2.46 +	memcpy(buf, data, note.n_descsz);
    2.47 +	buf += (note.n_descsz + 3)/4;
    2.48 +
    2.49 +	return buf;
    2.50 +}
    2.51 +
    2.52 +static void final_note(u32 *buf)
    2.53 +{
    2.54 +	struct elf_note note;
    2.55 +
    2.56 +	note.n_namesz = 0;
    2.57 +	note.n_descsz = 0;
    2.58 +	note.n_type   = 0;
    2.59 +	memcpy(buf, &note, sizeof(note));
    2.60 +}
    2.61 +
    2.62 +static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
    2.63 +{
    2.64 +	struct elf_prstatus prstatus;
    2.65 +	u32 *buf;
    2.66 +
    2.67 +	if ((cpu < 0) || (cpu >= NR_CPUS))
    2.68 +		return;
    2.69 +
    2.70 +	/* Using ELF notes here is opportunistic.
    2.71 +	 * I need a well defined structure format
    2.72 +	 * for the data I pass, and I need tags
    2.73 +	 * on the data to indicate what information I have
    2.74 +	 * squirrelled away.  ELF notes happen to provide
    2.75 +	 * all of that that no need to invent something new.
    2.76 +	 */
    2.77 +	buf = (u32*)per_cpu_ptr(crash_notes, cpu);
    2.78 +	if (!buf)
    2.79 +		return;
    2.80 +	memset(&prstatus, 0, sizeof(prstatus));
    2.81 +	prstatus.pr_pid = current->pid;
    2.82 +	elf_core_copy_regs(&prstatus.pr_reg, regs);
    2.83 +	buf = append_elf_note(buf, "CORE", NT_PRSTATUS, &prstatus,
    2.84 +				sizeof(prstatus));
    2.85 +	final_note(buf);
    2.86 +}
    2.87 +
    2.88 +static void crash_save_self(struct pt_regs *regs)
    2.89 +{
    2.90 +	int cpu;
    2.91 +
    2.92 +	cpu = smp_processor_id();
    2.93 +	crash_save_this_cpu(regs, cpu);
    2.94 +}
    2.95 +
    2.96 +#ifndef CONFIG_XEN
    2.97 +#ifdef CONFIG_SMP
    2.98 +static atomic_t waiting_for_crash_ipi;
    2.99 +
   2.100 +static int crash_nmi_callback(struct pt_regs *regs, int cpu)
   2.101 +{
   2.102 +	struct pt_regs fixed_regs;
   2.103 +
   2.104 +	/* Don't do anything if this handler is invoked on crashing cpu.
   2.105 +	 * Otherwise, system will completely hang. Crashing cpu can get
   2.106 +	 * an NMI if system was initially booted with nmi_watchdog parameter.
   2.107 +	 */
   2.108 +	if (cpu == crashing_cpu)
   2.109 +		return 1;
   2.110 +	local_irq_disable();
   2.111 +
   2.112 +	if (!user_mode(regs)) {
   2.113 +		crash_fixup_ss_esp(&fixed_regs, regs);
   2.114 +		regs = &fixed_regs;
   2.115 +	}
   2.116 +	crash_save_this_cpu(regs, cpu);
   2.117 +	disable_local_APIC();
   2.118 +	atomic_dec(&waiting_for_crash_ipi);
   2.119 +	/* Assume hlt works */
   2.120 +	halt();
   2.121 +	for(;;);
   2.122 +
   2.123 +	return 1;
   2.124 +}
   2.125 +
   2.126 +/*
   2.127 + * By using the NMI code instead of a vector we just sneak thru the
   2.128 + * word generator coming out with just what we want.  AND it does
   2.129 + * not matter if clustered_apic_mode is set or not.
   2.130 + */
   2.131 +static void smp_send_nmi_allbutself(void)
   2.132 +{
   2.133 +	send_IPI_allbutself(APIC_DM_NMI);
   2.134 +}
   2.135 +
   2.136 +static void nmi_shootdown_cpus(void)
   2.137 +{
   2.138 +	unsigned long msecs;
   2.139 +
   2.140 +	atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
   2.141 +	/* Would it be better to replace the trap vector here? */
   2.142 +	set_nmi_callback(crash_nmi_callback);
   2.143 +	/* Ensure the new callback function is set before sending
   2.144 +	 * out the NMI
   2.145 +	 */
   2.146 +	wmb();
   2.147 +
   2.148 +	smp_send_nmi_allbutself();
   2.149 +
   2.150 +	msecs = 1000; /* Wait at most a second for the other cpus to stop */
   2.151 +	while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
   2.152 +		mdelay(1);
   2.153 +		msecs--;
   2.154 +	}
   2.155 +
   2.156 +	/* Leave the nmi callback set */
   2.157 +	disable_local_APIC();
   2.158 +}
   2.159 +#else
   2.160 +static void nmi_shootdown_cpus(void)
   2.161 +{
   2.162 +	/* There are no cpus to shootdown */
   2.163 +}
   2.164 +#endif
   2.165 +#endif /* CONFIG_XEN */
   2.166 +
   2.167 +void machine_crash_shutdown(struct pt_regs *regs)
   2.168 +{
   2.169 +	/* This function is only called after the system
   2.170 +	 * has paniced or is otherwise in a critical state.
   2.171 +	 * The minimum amount of code to allow a kexec'd kernel
   2.172 +	 * to run successfully needs to happen here.
   2.173 +	 *
   2.174 +	 * In practice this means shooting down the other cpus in
   2.175 +	 * an SMP system.
   2.176 +	 */
   2.177 +	/* The kernel is broken so disable interrupts */
   2.178 +	local_irq_disable();
   2.179 +
   2.180 +	/* Make a note of crashing cpu. Will be used in NMI callback.*/
   2.181 +	crashing_cpu = smp_processor_id();
   2.182 +#ifndef CONFIG_XEN
   2.183 +	nmi_shootdown_cpus();
   2.184 +	lapic_shutdown();
   2.185 +#if defined(CONFIG_X86_IO_APIC)
   2.186 +	disable_IO_APIC();
   2.187 +#endif
   2.188 +#endif /* CONFIG_XEN */
   2.189 +	crash_save_self(regs);
   2.190 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/machine_kexec.c	Fri Dec 08 09:09:18 2006 -0700
     3.3 @@ -0,0 +1,129 @@
     3.4 +/*
     3.5 + * machine_kexec.c - handle transition of Linux booting another kernel
     3.6 + * Copyright (C) 2002-2005 Eric Biederman  <ebiederm@xmission.com>
     3.7 + *
     3.8 + * This source code is licensed under the GNU General Public License,
     3.9 + * Version 2.  See the file COPYING for more details.
    3.10 + */
    3.11 +
    3.12 +#include <linux/mm.h>
    3.13 +#include <linux/kexec.h>
    3.14 +#include <linux/delay.h>
    3.15 +#include <asm/pgtable.h>
    3.16 +#include <asm/pgalloc.h>
    3.17 +#include <asm/tlbflush.h>
    3.18 +#include <asm/mmu_context.h>
    3.19 +#include <asm/io.h>
    3.20 +#include <asm/apic.h>
    3.21 +#include <asm/cpufeature.h>
    3.22 +#include <asm/desc.h>
    3.23 +#include <asm/system.h>
    3.24 +
    3.25 +#ifdef CONFIG_XEN
    3.26 +#include <xen/interface/kexec.h>
    3.27 +#endif
    3.28 +
    3.29 +#define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
    3.30 +static u32 kexec_pgd[1024] PAGE_ALIGNED;
    3.31 +#ifdef CONFIG_X86_PAE
    3.32 +static u32 kexec_pmd0[1024] PAGE_ALIGNED;
    3.33 +static u32 kexec_pmd1[1024] PAGE_ALIGNED;
    3.34 +#endif
    3.35 +static u32 kexec_pte0[1024] PAGE_ALIGNED;
    3.36 +static u32 kexec_pte1[1024] PAGE_ALIGNED;
    3.37 +
    3.38 +#ifdef CONFIG_XEN
    3.39 +
    3.40 +#define __ma(x) (pfn_to_mfn(__pa((x)) >> PAGE_SHIFT) << PAGE_SHIFT)
    3.41 +
    3.42 +#if PAGES_NR > KEXEC_XEN_NO_PAGES
    3.43 +#error PAGES_NR is greater than KEXEC_XEN_NO_PAGES - Xen support will break
    3.44 +#endif
    3.45 +
    3.46 +#if PA_CONTROL_PAGE != 0
    3.47 +#error PA_CONTROL_PAGE is non zero - Xen support will break
    3.48 +#endif
    3.49 +
    3.50 +void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, struct kimage *image)
    3.51 +{
    3.52 +	void *control_page;
    3.53 +
    3.54 +	memset(xki->page_list, 0, sizeof(xki->page_list));
    3.55 +
    3.56 +	control_page = page_address(image->control_code_page);
    3.57 +	memcpy(control_page, relocate_kernel, PAGE_SIZE);
    3.58 +
    3.59 +	xki->page_list[PA_CONTROL_PAGE] = __ma(control_page);
    3.60 +	xki->page_list[PA_PGD] = __ma(kexec_pgd);
    3.61 +#ifdef CONFIG_X86_PAE
    3.62 +	xki->page_list[PA_PMD_0] = __ma(kexec_pmd0);
    3.63 +	xki->page_list[PA_PMD_1] = __ma(kexec_pmd1);
    3.64 +#endif
    3.65 +	xki->page_list[PA_PTE_0] = __ma(kexec_pte0);
    3.66 +	xki->page_list[PA_PTE_1] = __ma(kexec_pte1);
    3.67 +
    3.68 +}
    3.69 +
    3.70 +#endif /* CONFIG_XEN */
    3.71 +
    3.72 +/*
    3.73 + * A architecture hook called to validate the
    3.74 + * proposed image and prepare the control pages
    3.75 + * as needed.  The pages for KEXEC_CONTROL_CODE_SIZE
    3.76 + * have been allocated, but the segments have yet
    3.77 + * been copied into the kernel.
    3.78 + *
    3.79 + * Do what every setup is needed on image and the
    3.80 + * reboot code buffer to allow us to avoid allocations
    3.81 + * later.
    3.82 + *
    3.83 + * Currently nothing.
    3.84 + */
    3.85 +int machine_kexec_prepare(struct kimage *image)
    3.86 +{
    3.87 +	return 0;
    3.88 +}
    3.89 +
    3.90 +/*
    3.91 + * Undo anything leftover by machine_kexec_prepare
    3.92 + * when an image is freed.
    3.93 + */
    3.94 +void machine_kexec_cleanup(struct kimage *image)
    3.95 +{
    3.96 +}
    3.97 +
    3.98 +#ifndef CONFIG_XEN
    3.99 +/*
   3.100 + * Do not allocate memory (or fail in any way) in machine_kexec().
   3.101 + * We are past the point of no return, committed to rebooting now.
   3.102 + */
   3.103 +NORET_TYPE void machine_kexec(struct kimage *image)
   3.104 +{
   3.105 +	unsigned long page_list[PAGES_NR];
   3.106 +	void *control_page;
   3.107 +
   3.108 +	/* Interrupts aren't acceptable while we reboot */
   3.109 +	local_irq_disable();
   3.110 +
   3.111 +	control_page = page_address(image->control_code_page);
   3.112 +	memcpy(control_page, relocate_kernel, PAGE_SIZE);
   3.113 +
   3.114 +	page_list[PA_CONTROL_PAGE] = __pa(control_page);
   3.115 +	page_list[VA_CONTROL_PAGE] = (unsigned long)relocate_kernel;
   3.116 +	page_list[PA_PGD] = __pa(kexec_pgd);
   3.117 +	page_list[VA_PGD] = (unsigned long)kexec_pgd;
   3.118 +#ifdef CONFIG_X86_PAE
   3.119 +	page_list[PA_PMD_0] = __pa(kexec_pmd0);
   3.120 +	page_list[VA_PMD_0] = (unsigned long)kexec_pmd0;
   3.121 +	page_list[PA_PMD_1] = __pa(kexec_pmd1);
   3.122 +	page_list[VA_PMD_1] = (unsigned long)kexec_pmd1;
   3.123 +#endif
   3.124 +	page_list[PA_PTE_0] = __pa(kexec_pte0);
   3.125 +	page_list[VA_PTE_0] = (unsigned long)kexec_pte0;
   3.126 +	page_list[PA_PTE_1] = __pa(kexec_pte1);
   3.127 +	page_list[VA_PTE_1] = (unsigned long)kexec_pte1;
   3.128 +
   3.129 +	relocate_kernel((unsigned long)image->head, (unsigned long)page_list,
   3.130 +			image->start, cpu_has_pae);
   3.131 +}
   3.132 +#endif
     4.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Thu Dec 07 16:18:55 2006 -0700
     4.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Fri Dec 08 09:09:18 2006 -0700
     4.3 @@ -1047,9 +1047,9 @@ void time_resume(void)
     4.4  #ifdef CONFIG_SMP
     4.5  static char timer_name[NR_CPUS][15];
     4.6  
     4.7 -void local_setup_timer(unsigned int cpu)
     4.8 +int local_setup_timer(unsigned int cpu)
     4.9  {
    4.10 -	int seq;
    4.11 +	int seq, irq;
    4.12  
    4.13  	BUG_ON(cpu == 0);
    4.14  
    4.15 @@ -1062,15 +1062,17 @@ void local_setup_timer(unsigned int cpu)
    4.16  	} while (read_seqretry(&xtime_lock, seq));
    4.17  
    4.18  	sprintf(timer_name[cpu], "timer%d", cpu);
    4.19 -	per_cpu(timer_irq, cpu) =
    4.20 -		bind_virq_to_irqhandler(
    4.21 -			VIRQ_TIMER,
    4.22 -			cpu,
    4.23 -			timer_interrupt,
    4.24 -			SA_INTERRUPT,
    4.25 -			timer_name[cpu],
    4.26 -			NULL);
    4.27 -	BUG_ON(per_cpu(timer_irq, cpu) < 0);
    4.28 +	irq = bind_virq_to_irqhandler(VIRQ_TIMER,
    4.29 +				      cpu,
    4.30 +				      timer_interrupt,
    4.31 +				      SA_INTERRUPT,
    4.32 +				      timer_name[cpu],
    4.33 +				      NULL);
    4.34 +	if (irq < 0)
    4.35 +		return irq;
    4.36 +	per_cpu(timer_irq, cpu) = irq;
    4.37 +
    4.38 +	return 0;
    4.39  }
    4.40  
    4.41  void local_teardown_timer(unsigned int cpu)
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/crash.c	Fri Dec 08 09:09:18 2006 -0700
     5.3 @@ -0,0 +1,190 @@
     5.4 +/*
     5.5 + * Architecture specific (x86_64) functions for kexec based crash dumps.
     5.6 + *
     5.7 + * Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
     5.8 + *
     5.9 + * Copyright (C) IBM Corporation, 2004. All rights reserved.
    5.10 + *
    5.11 + */
    5.12 +
    5.13 +#include <linux/init.h>
    5.14 +#include <linux/types.h>
    5.15 +#include <linux/kernel.h>
    5.16 +#include <linux/smp.h>
    5.17 +#include <linux/irq.h>
    5.18 +#include <linux/reboot.h>
    5.19 +#include <linux/kexec.h>
    5.20 +#include <linux/delay.h>
    5.21 +#include <linux/elf.h>
    5.22 +#include <linux/elfcore.h>
    5.23 +
    5.24 +#include <asm/processor.h>
    5.25 +#include <asm/hardirq.h>
    5.26 +#include <asm/nmi.h>
    5.27 +#include <asm/hw_irq.h>
    5.28 +#include <asm/mach_apic.h>
    5.29 +
    5.30 +/* This keeps a track of which one is crashing cpu. */
    5.31 +static int crashing_cpu;
    5.32 +
    5.33 +static u32 *append_elf_note(u32 *buf, char *name, unsigned type,
    5.34 +						void *data, size_t data_len)
    5.35 +{
    5.36 +	struct elf_note note;
    5.37 +
    5.38 +	note.n_namesz = strlen(name) + 1;
    5.39 +	note.n_descsz = data_len;
    5.40 +	note.n_type   = type;
    5.41 +	memcpy(buf, &note, sizeof(note));
    5.42 +	buf += (sizeof(note) +3)/4;
    5.43 +	memcpy(buf, name, note.n_namesz);
    5.44 +	buf += (note.n_namesz + 3)/4;
    5.45 +	memcpy(buf, data, note.n_descsz);
    5.46 +	buf += (note.n_descsz + 3)/4;
    5.47 +
    5.48 +	return buf;
    5.49 +}
    5.50 +
    5.51 +static void final_note(u32 *buf)
    5.52 +{
    5.53 +	struct elf_note note;
    5.54 +
    5.55 +	note.n_namesz = 0;
    5.56 +	note.n_descsz = 0;
    5.57 +	note.n_type   = 0;
    5.58 +	memcpy(buf, &note, sizeof(note));
    5.59 +}
    5.60 +
    5.61 +static void crash_save_this_cpu(struct pt_regs *regs, int cpu)
    5.62 +{
    5.63 +	struct elf_prstatus prstatus;
    5.64 +	u32 *buf;
    5.65 +
    5.66 +	if ((cpu < 0) || (cpu >= NR_CPUS))
    5.67 +		return;
    5.68 +
    5.69 +	/* Using ELF notes here is opportunistic.
    5.70 +	 * I need a well defined structure format
    5.71 +	 * for the data I pass, and I need tags
    5.72 +	 * on the data to indicate what information I have
    5.73 +	 * squirrelled away.  ELF notes happen to provide
    5.74 +	 * all of that that no need to invent something new.
    5.75 +	 */
    5.76 +
    5.77 +	buf = (u32*)per_cpu_ptr(crash_notes, cpu);
    5.78 +
    5.79 +	if (!buf)
    5.80 +		return;
    5.81 +
    5.82 +	memset(&prstatus, 0, sizeof(prstatus));
    5.83 +	prstatus.pr_pid = current->pid;
    5.84 +	elf_core_copy_regs(&prstatus.pr_reg, regs);
    5.85 +	buf = append_elf_note(buf, "CORE", NT_PRSTATUS, &prstatus,
    5.86 +					sizeof(prstatus));
    5.87 +	final_note(buf);
    5.88 +}
    5.89 +
    5.90 +static void crash_save_self(struct pt_regs *regs)
    5.91 +{
    5.92 +	int cpu;
    5.93 +
    5.94 +	cpu = smp_processor_id();
    5.95 +	crash_save_this_cpu(regs, cpu);
    5.96 +}
    5.97 +
    5.98 +#ifndef CONFIG_XEN
    5.99 +#ifdef CONFIG_SMP
   5.100 +static atomic_t waiting_for_crash_ipi;
   5.101 +
   5.102 +static int crash_nmi_callback(struct pt_regs *regs, int cpu)
   5.103 +{
   5.104 +	/*
   5.105 +	 * Don't do anything if this handler is invoked on crashing cpu.
   5.106 +	 * Otherwise, system will completely hang. Crashing cpu can get
   5.107 +	 * an NMI if system was initially booted with nmi_watchdog parameter.
   5.108 +	 */
   5.109 +	if (cpu == crashing_cpu)
   5.110 +		return 1;
   5.111 +	local_irq_disable();
   5.112 +
   5.113 +	crash_save_this_cpu(regs, cpu);
   5.114 +	disable_local_APIC();
   5.115 +	atomic_dec(&waiting_for_crash_ipi);
   5.116 +	/* Assume hlt works */
   5.117 +	for(;;)
   5.118 +		asm("hlt");
   5.119 +
   5.120 +	return 1;
   5.121 +}
   5.122 +
   5.123 +static void smp_send_nmi_allbutself(void)
   5.124 +{
   5.125 +	send_IPI_allbutself(APIC_DM_NMI);
   5.126 +}
   5.127 +
   5.128 +/*
   5.129 + * This code is a best effort heuristic to get the
   5.130 + * other cpus to stop executing. So races with
   5.131 + * cpu hotplug shouldn't matter.
   5.132 + */
   5.133 +
   5.134 +static void nmi_shootdown_cpus(void)
   5.135 +{
   5.136 +	unsigned long msecs;
   5.137 +
   5.138 +	atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
   5.139 +	set_nmi_callback(crash_nmi_callback);
   5.140 +
   5.141 +	/*
   5.142 +	 * Ensure the new callback function is set before sending
   5.143 +	 * out the NMI
   5.144 +	 */
   5.145 +	wmb();
   5.146 +
   5.147 +	smp_send_nmi_allbutself();
   5.148 +
   5.149 +	msecs = 1000; /* Wait at most a second for the other cpus to stop */
   5.150 +	while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
   5.151 +		mdelay(1);
   5.152 +		msecs--;
   5.153 +	}
   5.154 +	/* Leave the nmi callback set */
   5.155 +	disable_local_APIC();
   5.156 +}
   5.157 +#else
   5.158 +static void nmi_shootdown_cpus(void)
   5.159 +{
   5.160 +	/* There are no cpus to shootdown */
   5.161 +}
   5.162 +#endif
   5.163 +#endif /* CONFIG_XEN */
   5.164 +
   5.165 +void machine_crash_shutdown(struct pt_regs *regs)
   5.166 +{
   5.167 +	/*
   5.168 +	 * This function is only called after the system
   5.169 +	 * has paniced or is otherwise in a critical state.
   5.170 +	 * The minimum amount of code to allow a kexec'd kernel
   5.171 +	 * to run successfully needs to happen here.
   5.172 +	 *
   5.173 +	 * In practice this means shooting down the other cpus in
   5.174 +	 * an SMP system.
   5.175 +	 */
   5.176 +	/* The kernel is broken so disable interrupts */
   5.177 +	local_irq_disable();
   5.178 +
   5.179 +	/* Make a note of crashing cpu. Will be used in NMI callback.*/
   5.180 +	crashing_cpu = smp_processor_id();
   5.181 +
   5.182 +#ifndef CONFIG_XEN
   5.183 +	nmi_shootdown_cpus();
   5.184 +
   5.185 +	if(cpu_has_apic)
   5.186 +		 disable_local_APIC();
   5.187 +
   5.188 +#if defined(CONFIG_X86_IO_APIC)
   5.189 +	disable_IO_APIC();
   5.190 +#endif
   5.191 +#endif /* CONFIG_XEN */
   5.192 +	crash_save_self(regs);
   5.193 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/machine_kexec.c	Fri Dec 08 09:09:18 2006 -0700
     6.3 @@ -0,0 +1,279 @@
     6.4 +/*
     6.5 + * machine_kexec.c - handle transition of Linux booting another kernel
     6.6 + * Copyright (C) 2002-2005 Eric Biederman  <ebiederm@xmission.com>
     6.7 + *
     6.8 + * This source code is licensed under the GNU General Public License,
     6.9 + * Version 2.  See the file COPYING for more details.
    6.10 + */
    6.11 +
    6.12 +#include <linux/mm.h>
    6.13 +#include <linux/kexec.h>
    6.14 +#include <linux/string.h>
    6.15 +#include <linux/reboot.h>
    6.16 +#include <asm/pgtable.h>
    6.17 +#include <asm/tlbflush.h>
    6.18 +#include <asm/mmu_context.h>
    6.19 +#include <asm/io.h>
    6.20 +
    6.21 +#define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
    6.22 +static u64 kexec_pgd[512] PAGE_ALIGNED;
    6.23 +static u64 kexec_pud0[512] PAGE_ALIGNED;
    6.24 +static u64 kexec_pmd0[512] PAGE_ALIGNED;
    6.25 +static u64 kexec_pte0[512] PAGE_ALIGNED;
    6.26 +static u64 kexec_pud1[512] PAGE_ALIGNED;
    6.27 +static u64 kexec_pmd1[512] PAGE_ALIGNED;
    6.28 +static u64 kexec_pte1[512] PAGE_ALIGNED;
    6.29 +
    6.30 +#ifdef CONFIG_XEN
    6.31 +
    6.32 +/* In the case of Xen, override hypervisor functions to be able to create
    6.33 + * a regular identity mapping page table...
    6.34 + */
    6.35 +
    6.36 +#include <xen/interface/kexec.h>
    6.37 +#include <xen/interface/memory.h>
    6.38 +
    6.39 +#define x__pmd(x) ((pmd_t) { (x) } )
    6.40 +#define x__pud(x) ((pud_t) { (x) } )
    6.41 +#define x__pgd(x) ((pgd_t) { (x) } )
    6.42 +
    6.43 +#define x_pmd_val(x)   ((x).pmd)
    6.44 +#define x_pud_val(x)   ((x).pud)
    6.45 +#define x_pgd_val(x)   ((x).pgd)
    6.46 +
    6.47 +static inline void x_set_pmd(pmd_t *dst, pmd_t val)
    6.48 +{
    6.49 +	x_pmd_val(*dst) = x_pmd_val(val);
    6.50 +}
    6.51 +
    6.52 +static inline void x_set_pud(pud_t *dst, pud_t val)
    6.53 +{
    6.54 +	x_pud_val(*dst) = phys_to_machine(x_pud_val(val));
    6.55 +}
    6.56 +
    6.57 +static inline void x_pud_clear (pud_t *pud)
    6.58 +{
    6.59 +	x_pud_val(*pud) = 0;
    6.60 +}
    6.61 +
    6.62 +static inline void x_set_pgd(pgd_t *dst, pgd_t val)
    6.63 +{
    6.64 +	x_pgd_val(*dst) = phys_to_machine(x_pgd_val(val));
    6.65 +}
    6.66 +
    6.67 +static inline void x_pgd_clear (pgd_t * pgd)
    6.68 +{
    6.69 +	x_pgd_val(*pgd) = 0;
    6.70 +}
    6.71 +
    6.72 +#define X__PAGE_KERNEL_LARGE_EXEC \
    6.73 +         _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_PSE
    6.74 +#define X_KERNPG_TABLE _PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY
    6.75 +
    6.76 +#define __ma(x) (pfn_to_mfn(__pa((x)) >> PAGE_SHIFT) << PAGE_SHIFT)
    6.77 +
    6.78 +#if PAGES_NR > KEXEC_XEN_NO_PAGES
    6.79 +#error PAGES_NR is greater than KEXEC_XEN_NO_PAGES - Xen support will break
    6.80 +#endif
    6.81 +
    6.82 +#if PA_CONTROL_PAGE != 0
    6.83 +#error PA_CONTROL_PAGE is non zero - Xen support will break
    6.84 +#endif
    6.85 +
    6.86 +void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, struct kimage *image)
    6.87 +{
    6.88 +	void *control_page;
    6.89 +	void *table_page;
    6.90 +
    6.91 +	memset(xki->page_list, 0, sizeof(xki->page_list));
    6.92 +
    6.93 +	control_page = page_address(image->control_code_page) + PAGE_SIZE;
    6.94 +	memcpy(control_page, relocate_kernel, PAGE_SIZE);
    6.95 +
    6.96 +	table_page = page_address(image->control_code_page);
    6.97 +
    6.98 +	xki->page_list[PA_CONTROL_PAGE] = __ma(control_page);
    6.99 +	xki->page_list[PA_TABLE_PAGE] = __ma(table_page);
   6.100 +
   6.101 +	xki->page_list[PA_PGD] = __ma(kexec_pgd);
   6.102 +	xki->page_list[PA_PUD_0] = __ma(kexec_pud0);
   6.103 +	xki->page_list[PA_PUD_1] = __ma(kexec_pud1);
   6.104 +	xki->page_list[PA_PMD_0] = __ma(kexec_pmd0);
   6.105 +	xki->page_list[PA_PMD_1] = __ma(kexec_pmd1);
   6.106 +	xki->page_list[PA_PTE_0] = __ma(kexec_pte0);
   6.107 +	xki->page_list[PA_PTE_1] = __ma(kexec_pte1);
   6.108 +}
   6.109 +
   6.110 +#else /* CONFIG_XEN */
   6.111 +
   6.112 +#define x__pmd(x) __pmd(x)
   6.113 +#define x__pud(x) __pud(x)
   6.114 +#define x__pgd(x) __pgd(x)
   6.115 +
   6.116 +#define x_set_pmd(x, y) set_pmd(x, y)
   6.117 +#define x_set_pud(x, y) set_pud(x, y)
   6.118 +#define x_set_pgd(x, y) set_pgd(x, y)
   6.119 +
   6.120 +#define x_pud_clear(x) pud_clear(x)
   6.121 +#define x_pgd_clear(x) pgd_clear(x)
   6.122 +
   6.123 +#define X__PAGE_KERNEL_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
   6.124 +#define X_KERNPG_TABLE _KERNPG_TABLE
   6.125 +
   6.126 +#endif /* CONFIG_XEN */
   6.127 +
   6.128 +static void init_level2_page(pmd_t *level2p, unsigned long addr)
   6.129 +{
   6.130 +	unsigned long end_addr;
   6.131 +
   6.132 +	addr &= PAGE_MASK;
   6.133 +	end_addr = addr + PUD_SIZE;
   6.134 +	while (addr < end_addr) {
   6.135 +		x_set_pmd(level2p++, x__pmd(addr | X__PAGE_KERNEL_LARGE_EXEC));
   6.136 +		addr += PMD_SIZE;
   6.137 +	}
   6.138 +}
   6.139 +
   6.140 +static int init_level3_page(struct kimage *image, pud_t *level3p,
   6.141 +				unsigned long addr, unsigned long last_addr)
   6.142 +{
   6.143 +	unsigned long end_addr;
   6.144 +	int result;
   6.145 +
   6.146 +	result = 0;
   6.147 +	addr &= PAGE_MASK;
   6.148 +	end_addr = addr + PGDIR_SIZE;
   6.149 +	while ((addr < last_addr) && (addr < end_addr)) {
   6.150 +		struct page *page;
   6.151 +		pmd_t *level2p;
   6.152 +
   6.153 +		page = kimage_alloc_control_pages(image, 0);
   6.154 +		if (!page) {
   6.155 +			result = -ENOMEM;
   6.156 +			goto out;
   6.157 +		}
   6.158 +		level2p = (pmd_t *)page_address(page);
   6.159 +		init_level2_page(level2p, addr);
   6.160 +		x_set_pud(level3p++, x__pud(__pa(level2p) | X_KERNPG_TABLE));
   6.161 +		addr += PUD_SIZE;
   6.162 +	}
   6.163 +	/* clear the unused entries */
   6.164 +	while (addr < end_addr) {
   6.165 +		x_pud_clear(level3p++);
   6.166 +		addr += PUD_SIZE;
   6.167 +	}
   6.168 +out:
   6.169 +	return result;
   6.170 +}
   6.171 +
   6.172 +
   6.173 +static int init_level4_page(struct kimage *image, pgd_t *level4p,
   6.174 +				unsigned long addr, unsigned long last_addr)
   6.175 +{
   6.176 +	unsigned long end_addr;
   6.177 +	int result;
   6.178 +
   6.179 +	result = 0;
   6.180 +	addr &= PAGE_MASK;
   6.181 +	end_addr = addr + (PTRS_PER_PGD * PGDIR_SIZE);
   6.182 +	while ((addr < last_addr) && (addr < end_addr)) {
   6.183 +		struct page *page;
   6.184 +		pud_t *level3p;
   6.185 +
   6.186 +		page = kimage_alloc_control_pages(image, 0);
   6.187 +		if (!page) {
   6.188 +			result = -ENOMEM;
   6.189 +			goto out;
   6.190 +		}
   6.191 +		level3p = (pud_t *)page_address(page);
   6.192 +		result = init_level3_page(image, level3p, addr, last_addr);
   6.193 +		if (result) {
   6.194 +			goto out;
   6.195 +		}
   6.196 +		x_set_pgd(level4p++, x__pgd(__pa(level3p) | X_KERNPG_TABLE));
   6.197 +		addr += PGDIR_SIZE;
   6.198 +	}
   6.199 +	/* clear the unused entries */
   6.200 +	while (addr < end_addr) {
   6.201 +		x_pgd_clear(level4p++);
   6.202 +		addr += PGDIR_SIZE;
   6.203 +	}
   6.204 +out:
   6.205 +	return result;
   6.206 +}
   6.207 +
   6.208 +
   6.209 +static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
   6.210 +{
   6.211 +	pgd_t *level4p;
   6.212 +	unsigned long x_end_pfn = end_pfn;
   6.213 +
   6.214 +#ifdef CONFIG_XEN
   6.215 +	x_end_pfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
   6.216 +#endif
   6.217 +
   6.218 +	level4p = (pgd_t *)__va(start_pgtable);
   6.219 + 	return init_level4_page(image, level4p, 0, x_end_pfn << PAGE_SHIFT);
   6.220 +}
   6.221 +
   6.222 +int machine_kexec_prepare(struct kimage *image)
   6.223 +{
   6.224 +	unsigned long start_pgtable;
   6.225 +	int result;
   6.226 +
   6.227 +	/* Calculate the offsets */
   6.228 +	start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT;
   6.229 +
   6.230 +	/* Setup the identity mapped 64bit page table */
   6.231 +	result = init_pgtable(image, start_pgtable);
   6.232 +	if (result)
   6.233 +		return result;
   6.234 +
   6.235 +	return 0;
   6.236 +}
   6.237 +
   6.238 +void machine_kexec_cleanup(struct kimage *image)
   6.239 +{
   6.240 +	return;
   6.241 +}
   6.242 +
   6.243 +#ifndef CONFIG_XEN
   6.244 +/*
   6.245 + * Do not allocate memory (or fail in any way) in machine_kexec().
   6.246 + * We are past the point of no return, committed to rebooting now.
   6.247 + */
   6.248 +NORET_TYPE void machine_kexec(struct kimage *image)
   6.249 +{
   6.250 +	unsigned long page_list[PAGES_NR];
   6.251 +	void *control_page;
   6.252 +
   6.253 +	/* Interrupts aren't acceptable while we reboot */
   6.254 +	local_irq_disable();
   6.255 +
   6.256 +	control_page = page_address(image->control_code_page) + PAGE_SIZE;
   6.257 +	memcpy(control_page, relocate_kernel, PAGE_SIZE);
   6.258 +
   6.259 +	page_list[PA_CONTROL_PAGE] = __pa(control_page);
   6.260 +	page_list[VA_CONTROL_PAGE] = (unsigned long)relocate_kernel;
   6.261 +	page_list[PA_PGD] = __pa(kexec_pgd);
   6.262 +	page_list[VA_PGD] = (unsigned long)kexec_pgd;
   6.263 +	page_list[PA_PUD_0] = __pa(kexec_pud0);
   6.264 +	page_list[VA_PUD_0] = (unsigned long)kexec_pud0;
   6.265 +	page_list[PA_PMD_0] = __pa(kexec_pmd0);
   6.266 +	page_list[VA_PMD_0] = (unsigned long)kexec_pmd0;
   6.267 +	page_list[PA_PTE_0] = __pa(kexec_pte0);
   6.268 +	page_list[VA_PTE_0] = (unsigned long)kexec_pte0;
   6.269 +	page_list[PA_PUD_1] = __pa(kexec_pud1);
   6.270 +	page_list[VA_PUD_1] = (unsigned long)kexec_pud1;
   6.271 +	page_list[PA_PMD_1] = __pa(kexec_pmd1);
   6.272 +	page_list[VA_PMD_1] = (unsigned long)kexec_pmd1;
   6.273 +	page_list[PA_PTE_1] = __pa(kexec_pte1);
   6.274 +	page_list[VA_PTE_1] = (unsigned long)kexec_pte1;
   6.275 +
   6.276 +	page_list[PA_TABLE_PAGE] =
   6.277 +	  (unsigned long)__pa(page_address(image->control_code_page));
   6.278 +
   6.279 +	relocate_kernel((unsigned long)image->head, (unsigned long)page_list,
   6.280 +			image->start);
   6.281 +}
   6.282 +#endif
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Thu Dec 07 16:18:55 2006 -0700
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Fri Dec 08 09:09:18 2006 -0700
     7.3 @@ -244,17 +244,22 @@ asmlinkage void evtchn_do_upcall(struct 
     7.4  
     7.5  static int find_unbound_irq(void)
     7.6  {
     7.7 -	int irq;
     7.8 +	static int warned;
     7.9 +	int dynirq, irq;
    7.10  
    7.11 -	/* Only allocate from dynirq range */
    7.12 -	for (irq = DYNIRQ_BASE; irq < NR_IRQS; irq++)
    7.13 +	for (dynirq = 0; dynirq < NR_DYNIRQS; dynirq++) {
    7.14 +		irq = dynirq_to_irq(dynirq);
    7.15  		if (irq_bindcount[irq] == 0)
    7.16 -			break;
    7.17 +			return irq;
    7.18 +	}
    7.19  
    7.20 -	if (irq == NR_IRQS)
    7.21 -		panic("No available IRQ to bind to: increase NR_IRQS!\n");
    7.22 +	if (!warned) {
    7.23 +		warned = 1;
    7.24 +		printk(KERN_WARNING "No available IRQ to bind to: "
    7.25 +		       "increase NR_DYNIRQS.\n");
    7.26 +	}
    7.27  
    7.28 -	return irq;
    7.29 +	return -ENOSPC;
    7.30  }
    7.31  
    7.32  static int bind_evtchn_to_irq(unsigned int evtchn)
    7.33 @@ -264,15 +269,17 @@ static int bind_evtchn_to_irq(unsigned i
    7.34  	spin_lock(&irq_mapping_update_lock);
    7.35  
    7.36  	if ((irq = evtchn_to_irq[evtchn]) == -1) {
    7.37 -		irq = find_unbound_irq();
    7.38 +		if ((irq = find_unbound_irq()) < 0)
    7.39 +			goto out;
    7.40 +
    7.41  		evtchn_to_irq[evtchn] = irq;
    7.42  		irq_info[irq] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
    7.43  	}
    7.44  
    7.45  	irq_bindcount[irq]++;
    7.46  
    7.47 + out:
    7.48  	spin_unlock(&irq_mapping_update_lock);
    7.49 -
    7.50  	return irq;
    7.51  }
    7.52  
    7.53 @@ -284,6 +291,9 @@ static int bind_virq_to_irq(unsigned int
    7.54  	spin_lock(&irq_mapping_update_lock);
    7.55  
    7.56  	if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1) {
    7.57 +		if ((irq = find_unbound_irq()) < 0)
    7.58 +			goto out;
    7.59 +
    7.60  		bind_virq.virq = virq;
    7.61  		bind_virq.vcpu = cpu;
    7.62  		if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
    7.63 @@ -291,7 +301,6 @@ static int bind_virq_to_irq(unsigned int
    7.64  			BUG();
    7.65  		evtchn = bind_virq.port;
    7.66  
    7.67 -		irq = find_unbound_irq();
    7.68  		evtchn_to_irq[evtchn] = irq;
    7.69  		irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
    7.70  
    7.71 @@ -302,8 +311,8 @@ static int bind_virq_to_irq(unsigned int
    7.72  
    7.73  	irq_bindcount[irq]++;
    7.74  
    7.75 + out:
    7.76  	spin_unlock(&irq_mapping_update_lock);
    7.77 -
    7.78  	return irq;
    7.79  }
    7.80  
    7.81 @@ -315,13 +324,15 @@ static int bind_ipi_to_irq(unsigned int 
    7.82  	spin_lock(&irq_mapping_update_lock);
    7.83  
    7.84  	if ((irq = per_cpu(ipi_to_irq, cpu)[ipi]) == -1) {
    7.85 +		if ((irq = find_unbound_irq()) < 0)
    7.86 +			goto out;
    7.87 +
    7.88  		bind_ipi.vcpu = cpu;
    7.89  		if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
    7.90  						&bind_ipi) != 0)
    7.91  			BUG();
    7.92  		evtchn = bind_ipi.port;
    7.93  
    7.94 -		irq = find_unbound_irq();
    7.95  		evtchn_to_irq[evtchn] = irq;
    7.96  		irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
    7.97  
    7.98 @@ -332,8 +343,8 @@ static int bind_ipi_to_irq(unsigned int 
    7.99  
   7.100  	irq_bindcount[irq]++;
   7.101  
   7.102 + out:
   7.103  	spin_unlock(&irq_mapping_update_lock);
   7.104 -
   7.105  	return irq;
   7.106  }
   7.107  
   7.108 @@ -383,6 +394,9 @@ int bind_evtchn_to_irqhandler(
   7.109  	int retval;
   7.110  
   7.111  	irq = bind_evtchn_to_irq(evtchn);
   7.112 +	if (irq < 0)
   7.113 +		return irq;
   7.114 +
   7.115  	retval = request_irq(irq, handler, irqflags, devname, dev_id);
   7.116  	if (retval != 0) {
   7.117  		unbind_from_irq(irq);
   7.118 @@ -405,6 +419,9 @@ int bind_virq_to_irqhandler(
   7.119  	int retval;
   7.120  
   7.121  	irq = bind_virq_to_irq(virq, cpu);
   7.122 +	if (irq < 0)
   7.123 +		return irq;
   7.124 +
   7.125  	retval = request_irq(irq, handler, irqflags, devname, dev_id);
   7.126  	if (retval != 0) {
   7.127  		unbind_from_irq(irq);
   7.128 @@ -427,6 +444,9 @@ int bind_ipi_to_irqhandler(
   7.129  	int retval;
   7.130  
   7.131  	irq = bind_ipi_to_irq(ipi, cpu);
   7.132 +	if (irq < 0)
   7.133 +		return irq;
   7.134 +
   7.135  	retval = request_irq(irq, handler, irqflags, devname, dev_id);
   7.136  	if (retval != 0) {
   7.137  		unbind_from_irq(irq);
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	Thu Dec 07 16:18:55 2006 -0700
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_kexec.c	Fri Dec 08 09:09:18 2006 -0700
     8.3 @@ -20,7 +20,7 @@ void xen_machine_kexec_setup_resources(v
     8.4  {
     8.5  	xen_kexec_range_t range;
     8.6  	struct resource *res;
     8.7 -	int err, k = 0;
     8.8 +	int k = 0;
     8.9  
    8.10  	if (!is_initial_xendomain())
    8.11  		return;
    8.12 @@ -32,26 +32,21 @@ void xen_machine_kexec_setup_resources(v
    8.13  		range.range = KEXEC_RANGE_MA_CPU;
    8.14  		range.nr = k;
    8.15  
    8.16 -		/*
    8.17 -		 * Anything other than EINVAL or success indictates
    8.18 -		 * that we are not running on a hypervisor which
    8.19 -		 * supports kexec.
    8.20 -		 */
    8.21 -		err = HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range);
    8.22 -		if (err == -EINVAL)
    8.23 +		if(HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range))
    8.24  			break;
    8.25 -		else if (err)
    8.26 -			return;
    8.27  
    8.28  		k++;
    8.29  	}
    8.30  
    8.31 +	if (k == 0)
    8.32 +		return;
    8.33 +
    8.34  	xen_max_nr_phys_cpus = k;
    8.35  
    8.36  	/* allocate xen_phys_cpus */
    8.37  
    8.38  	xen_phys_cpus = alloc_bootmem_low(k * sizeof(struct resource));
    8.39 -	BUG_ON(!xen_phys_cpus);
    8.40 +	BUG_ON(xen_phys_cpus == NULL);
    8.41  
    8.42  	/* fill in xen_phys_cpus with per-cpu crash note information */
    8.43  
    8.44 @@ -61,7 +56,7 @@ void xen_machine_kexec_setup_resources(v
    8.45  		range.nr = k;
    8.46  
    8.47  		if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range))
    8.48 -			BUG();
    8.49 +			goto err;
    8.50  
    8.51  		res = xen_phys_cpus + k;
    8.52  
    8.53 @@ -78,7 +73,7 @@ void xen_machine_kexec_setup_resources(v
    8.54  	range.range = KEXEC_RANGE_MA_XEN;
    8.55  
    8.56  	if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range))
    8.57 -		BUG();
    8.58 +		goto err;
    8.59  
    8.60  	xen_hypervisor_res.name = "Hypervisor code and data";
    8.61  	xen_hypervisor_res.start = range.start;
    8.62 @@ -91,12 +86,23 @@ void xen_machine_kexec_setup_resources(v
    8.63  	range.range = KEXEC_RANGE_MA_CRASH;
    8.64  
    8.65  	if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range))
    8.66 -		BUG();
    8.67 +		return;
    8.68  
    8.69  	if (range.size) {
    8.70  		crashk_res.start = range.start;
    8.71  		crashk_res.end = range.start + range.size - 1;
    8.72  	}
    8.73 +
    8.74 +	return;
    8.75 +
    8.76 + err:
    8.77 +	/*
    8.78 +	 * It isn't possible to free xen_phys_cpus this early in the
    8.79 +	 * boot. Since failure at this stage is unexpected and the
    8.80 +	 * amount is small we leak the memory.
    8.81 +         */
    8.82 +	xen_max_nr_phys_cpus = 0;
    8.83 +	return;
    8.84  }
    8.85  
    8.86  void xen_machine_kexec_register_resources(struct resource *res)
    8.87 @@ -106,7 +112,7 @@ void xen_machine_kexec_register_resource
    8.88  	request_resource(res, &xen_hypervisor_res);
    8.89  
    8.90  	for (k = 0; k < xen_max_nr_phys_cpus; k++)
    8.91 -		request_resource(res, xen_phys_cpus + k);
    8.92 +		request_resource(&xen_hypervisor_res, xen_phys_cpus + k);
    8.93  
    8.94  }
    8.95  
    8.96 @@ -157,7 +163,7 @@ void xen_machine_kexec_unload(struct kim
    8.97   * stop all CPUs and kexec. That is it combines machine_shutdown()
    8.98   * and machine_kexec() in Linux kexec terms.
    8.99   */
   8.100 -NORET_TYPE void xen_machine_kexec(struct kimage *image)
   8.101 +NORET_TYPE void machine_kexec(struct kimage *image)
   8.102  {
   8.103  	xen_kexec_exec_t xke;
   8.104  
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Thu Dec 07 16:18:55 2006 -0700
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Fri Dec 08 09:09:18 2006 -0700
     9.3 @@ -33,7 +33,7 @@
     9.4  extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
     9.5  extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
     9.6  
     9.7 -extern void local_setup_timer(unsigned int cpu);
     9.8 +extern int local_setup_timer(unsigned int cpu);
     9.9  extern void local_teardown_timer(unsigned int cpu);
    9.10  
    9.11  extern void hypervisor_callback(void);
    9.12 @@ -110,32 +110,45 @@ set_cpu_sibling_map(int cpu)
    9.13  	cpu_data[cpu].booted_cores = 1;
    9.14  }
    9.15  
    9.16 -static void xen_smp_intr_init(unsigned int cpu)
    9.17 +static int xen_smp_intr_init(unsigned int cpu)
    9.18  {
    9.19 +	int rc;
    9.20 +
    9.21 +	per_cpu(resched_irq, cpu) = per_cpu(callfunc_irq, cpu) = -1;
    9.22 +
    9.23  	sprintf(resched_name[cpu], "resched%d", cpu);
    9.24 -	per_cpu(resched_irq, cpu) =
    9.25 -		bind_ipi_to_irqhandler(
    9.26 -			RESCHEDULE_VECTOR,
    9.27 -			cpu,
    9.28 -			smp_reschedule_interrupt,
    9.29 -			SA_INTERRUPT,
    9.30 -			resched_name[cpu],
    9.31 -			NULL);
    9.32 -	BUG_ON(per_cpu(resched_irq, cpu) < 0);
    9.33 +	rc = bind_ipi_to_irqhandler(RESCHEDULE_VECTOR,
    9.34 +				    cpu,
    9.35 +				    smp_reschedule_interrupt,
    9.36 +				    SA_INTERRUPT,
    9.37 +				    resched_name[cpu],
    9.38 +				    NULL);
    9.39 +	if (rc < 0)
    9.40 +		goto fail;
    9.41 +	per_cpu(resched_irq, cpu) = rc;
    9.42  
    9.43  	sprintf(callfunc_name[cpu], "callfunc%d", cpu);
    9.44 -	per_cpu(callfunc_irq, cpu) =
    9.45 -		bind_ipi_to_irqhandler(
    9.46 -			CALL_FUNCTION_VECTOR,
    9.47 -			cpu,
    9.48 -			smp_call_function_interrupt,
    9.49 -			SA_INTERRUPT,
    9.50 -			callfunc_name[cpu],
    9.51 -			NULL);
    9.52 -	BUG_ON(per_cpu(callfunc_irq, cpu) < 0);
    9.53 +	rc = bind_ipi_to_irqhandler(CALL_FUNCTION_VECTOR,
    9.54 +				    cpu,
    9.55 +				    smp_call_function_interrupt,
    9.56 +				    SA_INTERRUPT,
    9.57 +				    callfunc_name[cpu],
    9.58 +				    NULL);
    9.59 +	if (rc < 0)
    9.60 +		goto fail;
    9.61 +	per_cpu(callfunc_irq, cpu) = rc;
    9.62  
    9.63 -	if (cpu != 0)
    9.64 -		local_setup_timer(cpu);
    9.65 +	if ((cpu != 0) && ((rc = local_setup_timer(cpu)) != 0))
    9.66 +		goto fail;
    9.67 +
    9.68 +	return 0;
    9.69 +
    9.70 + fail:
    9.71 +	if (per_cpu(resched_irq, cpu) >= 0)
    9.72 +		unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL);
    9.73 +	if (per_cpu(callfunc_irq, cpu) >= 0)
    9.74 +		unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL);
    9.75 +	return rc;
    9.76  }
    9.77  
    9.78  #ifdef CONFIG_HOTPLUG_CPU
    9.79 @@ -253,7 +266,8 @@ void __init smp_prepare_cpus(unsigned in
    9.80  
    9.81  	set_cpu_sibling_map(0);
    9.82  
    9.83 -	xen_smp_intr_init(0);
    9.84 +	if (xen_smp_intr_init(0))
    9.85 +		BUG();
    9.86  
    9.87  	/* Restrict the possible_map according to max_cpus. */
    9.88  	while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) {
    9.89 @@ -419,7 +433,13 @@ int __devinit __cpu_up(unsigned int cpu)
    9.90  	set_cpu_sibling_map(cpu);
    9.91  	wmb();
    9.92  
    9.93 -	xen_smp_intr_init(cpu);
    9.94 +
    9.95 +	rc = xen_smp_intr_init(cpu);
    9.96 +	if (rc) {
    9.97 +		remove_siblinginfo(cpu);
    9.98 +		return rc;
    9.99 +	}
   9.100 +
   9.101  	cpu_set(cpu, cpu_online_map);
   9.102  
   9.103  	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Dec 07 16:18:55 2006 -0700
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Fri Dec 08 09:09:18 2006 -0700
    10.3 @@ -1506,13 +1506,12 @@ static int __init netback_init(void)
    10.4  	netif_xenbus_init();
    10.5  
    10.6  #ifdef NETBE_DEBUG_INTERRUPT
    10.7 -	(void)bind_virq_to_irqhandler(
    10.8 -		VIRQ_DEBUG,
    10.9 -		0,
   10.10 -		netif_be_dbg,
   10.11 -		SA_SHIRQ, 
   10.12 -		"net-be-dbg",
   10.13 -		&netif_be_dbg);
   10.14 +	(void)bind_virq_to_irqhandler(VIRQ_DEBUG,
   10.15 +				      0,
   10.16 +				      netif_be_dbg,
   10.17 +				      SA_SHIRQ, 
   10.18 +				      "net-be-dbg",
   10.19 +				      &netif_be_dbg);
   10.20  #endif
   10.21  
   10.22  	return 0;
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile	Thu Dec 07 16:18:55 2006 -0700
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile	Fri Dec 08 09:09:18 2006 -0700
    11.3 @@ -1,13 +1,9 @@
    11.4 -obj-y	+= xenbus.o
    11.5 +obj-y += xenbus_client.o xenbus_comms.o xenbus_xs.o xenbus_probe.o
    11.6  obj-$(CONFIG_XEN_BACKEND) += xenbus_be.o
    11.7  
    11.8  xenbus_be-objs =
    11.9  xenbus_be-objs += xenbus_backend_client.o
   11.10  
   11.11 -xenbus-objs =
   11.12 -xenbus-objs += xenbus_client.o
   11.13 -xenbus-objs += xenbus_comms.o
   11.14 -xenbus-objs += xenbus_xs.o
   11.15 -xenbus-objs += xenbus_probe.o
   11.16 -obj-$(CONFIG_XEN_BACKEND) += xenbus_probe_backend.o
   11.17 +xenbus-$(CONFIG_XEN_BACKEND) += xenbus_probe_backend.o
   11.18 +obj-y += $(xenbus-y) $(xenbus-m)
   11.19  obj-$(CONFIG_XEN_XENBUS_DEV) += xenbus_dev.o
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Thu Dec 07 16:18:55 2006 -0700
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c	Fri Dec 08 09:09:18 2006 -0700
    12.3 @@ -289,6 +289,7 @@ int xenbus_free_evtchn(struct xenbus_dev
    12.4  
    12.5  	return err;
    12.6  }
    12.7 +EXPORT_SYMBOL_GPL(xenbus_free_evtchn);
    12.8  
    12.9  
   12.10  enum xenbus_state xenbus_read_driver_state(const char *path)
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Thu Dec 07 16:18:55 2006 -0700
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Fri Dec 08 09:09:18 2006 -0700
    13.3 @@ -52,7 +52,7 @@ extern void xenbus_probe(void *);
    13.4  extern int xenstored_ready;
    13.5  static DECLARE_WORK(probe_work, xenbus_probe, NULL);
    13.6  
    13.7 -DECLARE_WAIT_QUEUE_HEAD(xb_waitq);
    13.8 +static DECLARE_WAIT_QUEUE_HEAD(xb_waitq);
    13.9  
   13.10  static irqreturn_t wake_waiting(int irq, void *unused, struct pt_regs *regs)
   13.11  {
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.h	Thu Dec 07 16:18:55 2006 -0700
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.h	Fri Dec 08 09:09:18 2006 -0700
    14.3 @@ -38,7 +38,6 @@ int xb_init_comms(void);
    14.4  int xb_write(const void *data, unsigned len);
    14.5  int xb_read(void *data, unsigned len);
    14.6  int xs_input_avail(void);
    14.7 -extern wait_queue_head_t xb_waitq;
    14.8  extern struct xenstore_domain_interface *xen_store_interface;
    14.9  extern int xen_store_evtchn;
   14.10  
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.h	Thu Dec 07 16:18:55 2006 -0700
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.h	Fri Dec 08 09:09:18 2006 -0700
    15.3 @@ -34,7 +34,7 @@
    15.4  #ifndef _XENBUS_PROBE_H
    15.5  #define _XENBUS_PROBE_H
    15.6  
    15.7 -#ifdef CONFIG_XEN_BACKEND
    15.8 +#if defined(CONFIG_XEN_BACKEND) || defined(CONFIG_XEN_BACKEND_MODULE)
    15.9  extern void xenbus_backend_suspend(int (*fn)(struct device *, void *));
   15.10  extern void xenbus_backend_resume(int (*fn)(struct device *, void *));
   15.11  extern void xenbus_backend_probe_and_watch(void);
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/kexec.h	Fri Dec 08 09:09:18 2006 -0700
    16.3 @@ -0,0 +1,117 @@
    16.4 +#ifndef _I386_KEXEC_H
    16.5 +#define _I386_KEXEC_H
    16.6 +
    16.7 +#define PA_CONTROL_PAGE  0
    16.8 +#define VA_CONTROL_PAGE  1
    16.9 +#define PA_PGD           2
   16.10 +#define VA_PGD           3
   16.11 +#define PA_PTE_0         4
   16.12 +#define VA_PTE_0         5
   16.13 +#define PA_PTE_1         6
   16.14 +#define VA_PTE_1         7
   16.15 +#ifdef CONFIG_X86_PAE
   16.16 +#define PA_PMD_0         8
   16.17 +#define VA_PMD_0         9
   16.18 +#define PA_PMD_1         10
   16.19 +#define VA_PMD_1         11
   16.20 +#define PAGES_NR         12
   16.21 +#else
   16.22 +#define PAGES_NR         8
   16.23 +#endif
   16.24 +
   16.25 +#ifndef __ASSEMBLY__
   16.26 +
   16.27 +#include <asm/fixmap.h>
   16.28 +#include <asm/ptrace.h>
   16.29 +#include <asm/string.h>
   16.30 +
   16.31 +/*
   16.32 + * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
   16.33 + * I.e. Maximum page that is mapped directly into kernel memory,
   16.34 + * and kmap is not required.
   16.35 + *
   16.36 + * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
   16.37 + * calculation for the amount of memory directly mappable into the
   16.38 + * kernel memory space.
   16.39 + */
   16.40 +
   16.41 +/* Maximum physical address we can use pages from */
   16.42 +#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
   16.43 +/* Maximum address we can reach in physical address mode */
   16.44 +#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
   16.45 +/* Maximum address we can use for the control code buffer */
   16.46 +#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
   16.47 +
   16.48 +#define KEXEC_CONTROL_CODE_SIZE	4096
   16.49 +
   16.50 +/* The native architecture */
   16.51 +#define KEXEC_ARCH KEXEC_ARCH_386
   16.52 +
   16.53 +#define MAX_NOTE_BYTES 1024
   16.54 +
   16.55 +/* CPU does not save ss and esp on stack if execution is already
   16.56 + * running in kernel mode at the time of NMI occurrence. This code
   16.57 + * fixes it.
   16.58 + */
   16.59 +static inline void crash_fixup_ss_esp(struct pt_regs *newregs,
   16.60 +					struct pt_regs *oldregs)
   16.61 +{
   16.62 +	memcpy(newregs, oldregs, sizeof(*newregs));
   16.63 +	newregs->esp = (unsigned long)&(oldregs->esp);
   16.64 +	__asm__ __volatile__(
   16.65 +			"xorl %%eax, %%eax\n\t"
   16.66 +			"movw %%ss, %%ax\n\t"
   16.67 +			:"=a"(newregs->xss));
   16.68 +}
   16.69 +
   16.70 +/*
   16.71 + * This function is responsible for capturing register states if coming
   16.72 + * via panic otherwise just fix up the ss and esp if coming via kernel
   16.73 + * mode exception.
   16.74 + */
   16.75 +static inline void crash_setup_regs(struct pt_regs *newregs,
   16.76 +                                       struct pt_regs *oldregs)
   16.77 +{
   16.78 +       if (oldregs)
   16.79 +               crash_fixup_ss_esp(newregs, oldregs);
   16.80 +       else {
   16.81 +               __asm__ __volatile__("movl %%ebx,%0" : "=m"(newregs->ebx));
   16.82 +               __asm__ __volatile__("movl %%ecx,%0" : "=m"(newregs->ecx));
   16.83 +               __asm__ __volatile__("movl %%edx,%0" : "=m"(newregs->edx));
   16.84 +               __asm__ __volatile__("movl %%esi,%0" : "=m"(newregs->esi));
   16.85 +               __asm__ __volatile__("movl %%edi,%0" : "=m"(newregs->edi));
   16.86 +               __asm__ __volatile__("movl %%ebp,%0" : "=m"(newregs->ebp));
   16.87 +               __asm__ __volatile__("movl %%eax,%0" : "=m"(newregs->eax));
   16.88 +               __asm__ __volatile__("movl %%esp,%0" : "=m"(newregs->esp));
   16.89 +               __asm__ __volatile__("movw %%ss, %%ax;" :"=a"(newregs->xss));
   16.90 +               __asm__ __volatile__("movw %%cs, %%ax;" :"=a"(newregs->xcs));
   16.91 +               __asm__ __volatile__("movw %%ds, %%ax;" :"=a"(newregs->xds));
   16.92 +               __asm__ __volatile__("movw %%es, %%ax;" :"=a"(newregs->xes));
   16.93 +               __asm__ __volatile__("pushfl; popl %0" :"=m"(newregs->eflags));
   16.94 +
   16.95 +               newregs->eip = (unsigned long)current_text_addr();
   16.96 +       }
   16.97 +}
   16.98 +asmlinkage NORET_TYPE void
   16.99 +relocate_kernel(unsigned long indirection_page,
  16.100 +		unsigned long control_page,
  16.101 +		unsigned long start_address,
  16.102 +		unsigned int has_pae) ATTRIB_NORET;
  16.103 +
  16.104 +
  16.105 +/* Under Xen we need to work with machine addresses. These macros give the
  16.106 + * machine address of a certain page to the generic kexec code instead of 
  16.107 + * the pseudo physical address which would be given by the default macros.
  16.108 + */
  16.109 +
  16.110 +#ifdef CONFIG_XEN
  16.111 +#define KEXEC_ARCH_HAS_PAGE_MACROS
  16.112 +#define kexec_page_to_pfn(page)  pfn_to_mfn(page_to_pfn(page))
  16.113 +#define kexec_pfn_to_page(pfn)   pfn_to_page(mfn_to_pfn(pfn))
  16.114 +#define kexec_virt_to_phys(addr) virt_to_machine(addr)
  16.115 +#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
  16.116 +#endif
  16.117 +
  16.118 +#endif /* __ASSEMBLY__ */
  16.119 +
  16.120 +#endif /* _I386_KEXEC_H */
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/kexec.h	Fri Dec 08 09:09:18 2006 -0700
    17.3 @@ -0,0 +1,109 @@
    17.4 +#ifndef _X86_64_KEXEC_H
    17.5 +#define _X86_64_KEXEC_H
    17.6 +
    17.7 +#define PA_CONTROL_PAGE  0
    17.8 +#define VA_CONTROL_PAGE  1
    17.9 +#define PA_PGD           2
   17.10 +#define VA_PGD           3
   17.11 +#define PA_PUD_0         4
   17.12 +#define VA_PUD_0         5
   17.13 +#define PA_PMD_0         6
   17.14 +#define VA_PMD_0         7
   17.15 +#define PA_PTE_0         8
   17.16 +#define VA_PTE_0         9
   17.17 +#define PA_PUD_1         10
   17.18 +#define VA_PUD_1         11
   17.19 +#define PA_PMD_1         12
   17.20 +#define VA_PMD_1         13
   17.21 +#define PA_PTE_1         14
   17.22 +#define VA_PTE_1         15
   17.23 +#define PA_TABLE_PAGE    16
   17.24 +#define PAGES_NR         17
   17.25 +
   17.26 +#ifndef __ASSEMBLY__
   17.27 +
   17.28 +#include <linux/string.h>
   17.29 +
   17.30 +#include <asm/page.h>
   17.31 +#include <asm/ptrace.h>
   17.32 +
   17.33 +/*
   17.34 + * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
   17.35 + * I.e. Maximum page that is mapped directly into kernel memory,
   17.36 + * and kmap is not required.
   17.37 + *
   17.38 + * So far x86_64 is limited to 40 physical address bits.
   17.39 + */
   17.40 +
   17.41 +/* Maximum physical address we can use pages from */
   17.42 +#define KEXEC_SOURCE_MEMORY_LIMIT      (0xFFFFFFFFFFUL)
   17.43 +/* Maximum address we can reach in physical address mode */
   17.44 +#define KEXEC_DESTINATION_MEMORY_LIMIT (0xFFFFFFFFFFUL)
   17.45 +/* Maximum address we can use for the control pages */
   17.46 +#define KEXEC_CONTROL_MEMORY_LIMIT     (0xFFFFFFFFFFUL)
   17.47 +
   17.48 +/* Allocate one page for the pdp and the second for the code */
   17.49 +#define KEXEC_CONTROL_CODE_SIZE  (4096UL + 4096UL)
   17.50 +
   17.51 +/* The native architecture */
   17.52 +#define KEXEC_ARCH KEXEC_ARCH_X86_64
   17.53 +
   17.54 +#define MAX_NOTE_BYTES 1024
   17.55 +
   17.56 +/*
   17.57 + * Saving the registers of the cpu on which panic occured in
   17.58 + * crash_kexec to save a valid sp. The registers of other cpus
   17.59 + * will be saved in machine_crash_shutdown while shooting down them.
   17.60 + */
   17.61 +
   17.62 +static inline void crash_setup_regs(struct pt_regs *newregs,
   17.63 +						struct pt_regs *oldregs)
   17.64 +{
   17.65 +	if (oldregs)
   17.66 +		memcpy(newregs, oldregs, sizeof(*newregs));
   17.67 +	else {
   17.68 +		__asm__ __volatile__("movq %%rbx,%0" : "=m"(newregs->rbx));
   17.69 +		__asm__ __volatile__("movq %%rcx,%0" : "=m"(newregs->rcx));
   17.70 +		__asm__ __volatile__("movq %%rdx,%0" : "=m"(newregs->rdx));
   17.71 +		__asm__ __volatile__("movq %%rsi,%0" : "=m"(newregs->rsi));
   17.72 +		__asm__ __volatile__("movq %%rdi,%0" : "=m"(newregs->rdi));
   17.73 +		__asm__ __volatile__("movq %%rbp,%0" : "=m"(newregs->rbp));
   17.74 +		__asm__ __volatile__("movq %%rax,%0" : "=m"(newregs->rax));
   17.75 +		__asm__ __volatile__("movq %%rsp,%0" : "=m"(newregs->rsp));
   17.76 +		__asm__ __volatile__("movq %%r8,%0" : "=m"(newregs->r8));
   17.77 +		__asm__ __volatile__("movq %%r9,%0" : "=m"(newregs->r9));
   17.78 +		__asm__ __volatile__("movq %%r10,%0" : "=m"(newregs->r10));
   17.79 +		__asm__ __volatile__("movq %%r11,%0" : "=m"(newregs->r11));
   17.80 +		__asm__ __volatile__("movq %%r12,%0" : "=m"(newregs->r12));
   17.81 +		__asm__ __volatile__("movq %%r13,%0" : "=m"(newregs->r13));
   17.82 +		__asm__ __volatile__("movq %%r14,%0" : "=m"(newregs->r14));
   17.83 +		__asm__ __volatile__("movq %%r15,%0" : "=m"(newregs->r15));
   17.84 +		__asm__ __volatile__("movl %%ss, %%eax;" :"=a"(newregs->ss));
   17.85 +		__asm__ __volatile__("movl %%cs, %%eax;" :"=a"(newregs->cs));
   17.86 +		__asm__ __volatile__("pushfq; popq %0" :"=m"(newregs->eflags));
   17.87 +
   17.88 +		newregs->rip = (unsigned long)current_text_addr();
   17.89 +	}
   17.90 +}
   17.91 +
   17.92 +NORET_TYPE void
   17.93 +relocate_kernel(unsigned long indirection_page,
   17.94 +		unsigned long page_list,
   17.95 +		unsigned long start_address) ATTRIB_NORET;
   17.96 +
   17.97 +/* Under Xen we need to work with machine addresses. These macros give the
   17.98 + * machine address of a certain page to the generic kexec code instead of 
   17.99 + * the pseudo physical address which would be given by the default macros.
  17.100 + */
  17.101 +
  17.102 +#ifdef CONFIG_XEN
  17.103 +#define KEXEC_ARCH_HAS_PAGE_MACROS
  17.104 +#define kexec_page_to_pfn(page)  pfn_to_mfn(page_to_pfn(page))
  17.105 +#define kexec_pfn_to_page(pfn)   pfn_to_page(mfn_to_pfn(pfn))
  17.106 +#define kexec_virt_to_phys(addr) virt_to_machine(addr)
  17.107 +#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
  17.108 +#endif
  17.109 +
  17.110 +#endif /* __ASSEMBLY__ */
  17.111 +
  17.112 +#endif /* _X86_64_KEXEC_H */
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/linux-2.6-xen-sparse/include/linux/kexec.h	Fri Dec 08 09:09:18 2006 -0700
    18.3 @@ -0,0 +1,152 @@
    18.4 +#ifndef LINUX_KEXEC_H
    18.5 +#define LINUX_KEXEC_H
    18.6 +
    18.7 +#ifdef CONFIG_KEXEC
    18.8 +#include <linux/types.h>
    18.9 +#include <linux/list.h>
   18.10 +#include <linux/linkage.h>
   18.11 +#include <linux/compat.h>
   18.12 +#include <linux/ioport.h>
   18.13 +#include <asm/kexec.h>
   18.14 +
   18.15 +/* Verify architecture specific macros are defined */
   18.16 +
   18.17 +#ifndef KEXEC_SOURCE_MEMORY_LIMIT
   18.18 +#error KEXEC_SOURCE_MEMORY_LIMIT not defined
   18.19 +#endif
   18.20 +
   18.21 +#ifndef KEXEC_DESTINATION_MEMORY_LIMIT
   18.22 +#error KEXEC_DESTINATION_MEMORY_LIMIT not defined
   18.23 +#endif
   18.24 +
   18.25 +#ifndef KEXEC_CONTROL_MEMORY_LIMIT
   18.26 +#error KEXEC_CONTROL_MEMORY_LIMIT not defined
   18.27 +#endif
   18.28 +
   18.29 +#ifndef KEXEC_CONTROL_CODE_SIZE
   18.30 +#error KEXEC_CONTROL_CODE_SIZE not defined
   18.31 +#endif
   18.32 +
   18.33 +#ifndef KEXEC_ARCH
   18.34 +#error KEXEC_ARCH not defined
   18.35 +#endif
   18.36 +
   18.37 +#ifndef KEXEC_ARCH_HAS_PAGE_MACROS
   18.38 +#define kexec_page_to_pfn(page)  page_to_pfn(page)
   18.39 +#define kexec_pfn_to_page(pfn)   pfn_to_page(pfn)
   18.40 +#define kexec_virt_to_phys(addr) virt_to_phys(addr)
   18.41 +#define kexec_phys_to_virt(addr) phys_to_virt(addr)
   18.42 +#endif
   18.43 +
   18.44 +/*
   18.45 + * This structure is used to hold the arguments that are used when loading
   18.46 + * kernel binaries.
   18.47 + */
   18.48 +
   18.49 +typedef unsigned long kimage_entry_t;
   18.50 +#define IND_DESTINATION  0x1
   18.51 +#define IND_INDIRECTION  0x2
   18.52 +#define IND_DONE         0x4
   18.53 +#define IND_SOURCE       0x8
   18.54 +
   18.55 +#define KEXEC_SEGMENT_MAX 16
   18.56 +struct kexec_segment {
   18.57 +	void __user *buf;
   18.58 +	size_t bufsz;
   18.59 +	unsigned long mem;	/* User space sees this as a (void *) ... */
   18.60 +	size_t memsz;
   18.61 +};
   18.62 +
   18.63 +#ifdef CONFIG_COMPAT
   18.64 +struct compat_kexec_segment {
   18.65 +	compat_uptr_t buf;
   18.66 +	compat_size_t bufsz;
   18.67 +	compat_ulong_t mem;	/* User space sees this as a (void *) ... */
   18.68 +	compat_size_t memsz;
   18.69 +};
   18.70 +#endif
   18.71 +
   18.72 +struct kimage {
   18.73 +	kimage_entry_t head;
   18.74 +	kimage_entry_t *entry;
   18.75 +	kimage_entry_t *last_entry;
   18.76 +
   18.77 +	unsigned long destination;
   18.78 +
   18.79 +	unsigned long start;
   18.80 +	struct page *control_code_page;
   18.81 +
   18.82 +	unsigned long nr_segments;
   18.83 +	struct kexec_segment segment[KEXEC_SEGMENT_MAX];
   18.84 +
   18.85 +	struct list_head control_pages;
   18.86 +	struct list_head dest_pages;
   18.87 +	struct list_head unuseable_pages;
   18.88 +
   18.89 +	/* Address of next control page to allocate for crash kernels. */
   18.90 +	unsigned long control_page;
   18.91 +
   18.92 +	/* Flags to indicate special processing */
   18.93 +	unsigned int type : 1;
   18.94 +#define KEXEC_TYPE_DEFAULT 0
   18.95 +#define KEXEC_TYPE_CRASH   1
   18.96 +};
   18.97 +
   18.98 +
   18.99 +
  18.100 +/* kexec interface functions */
  18.101 +extern NORET_TYPE void machine_kexec(struct kimage *image) ATTRIB_NORET;
  18.102 +extern int machine_kexec_prepare(struct kimage *image);
  18.103 +extern void machine_kexec_cleanup(struct kimage *image);
  18.104 +#ifdef CONFIG_XEN
  18.105 +extern int xen_machine_kexec_load(struct kimage *image);
  18.106 +extern void xen_machine_kexec_unload(struct kimage *image);
  18.107 +extern void xen_machine_kexec_setup_resources(void);
  18.108 +extern void xen_machine_kexec_register_resources(struct resource *res);
  18.109 +#endif
  18.110 +extern asmlinkage long sys_kexec_load(unsigned long entry,
  18.111 +					unsigned long nr_segments,
  18.112 +					struct kexec_segment __user *segments,
  18.113 +					unsigned long flags);
  18.114 +#ifdef CONFIG_COMPAT
  18.115 +extern asmlinkage long compat_sys_kexec_load(unsigned long entry,
  18.116 +				unsigned long nr_segments,
  18.117 +				struct compat_kexec_segment __user *segments,
  18.118 +				unsigned long flags);
  18.119 +#endif
  18.120 +extern struct page *kimage_alloc_control_pages(struct kimage *image,
  18.121 +						unsigned int order);
  18.122 +extern void crash_kexec(struct pt_regs *);
  18.123 +int kexec_should_crash(struct task_struct *);
  18.124 +extern struct kimage *kexec_image;
  18.125 +
  18.126 +#define KEXEC_ON_CRASH  0x00000001
  18.127 +#define KEXEC_ARCH_MASK 0xffff0000
  18.128 +
  18.129 +/* These values match the ELF architecture values.
  18.130 + * Unless there is a good reason that should continue to be the case.
  18.131 + */
  18.132 +#define KEXEC_ARCH_DEFAULT ( 0 << 16)
  18.133 +#define KEXEC_ARCH_386     ( 3 << 16)
  18.134 +#define KEXEC_ARCH_X86_64  (62 << 16)
  18.135 +#define KEXEC_ARCH_PPC     (20 << 16)
  18.136 +#define KEXEC_ARCH_PPC64   (21 << 16)
  18.137 +#define KEXEC_ARCH_IA_64   (50 << 16)
  18.138 +#define KEXEC_ARCH_S390    (22 << 16)
  18.139 +#define KEXEC_ARCH_SH      (42 << 16)
  18.140 +
  18.141 +#define KEXEC_FLAGS    (KEXEC_ON_CRASH)  /* List of defined/legal kexec flags */
  18.142 +
  18.143 +/* Location of a reserved region to hold the crash kernel.
  18.144 + */
  18.145 +extern struct resource crashk_res;
  18.146 +typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
  18.147 +extern note_buf_t *crash_notes;
  18.148 +
  18.149 +#else /* !CONFIG_KEXEC */
  18.150 +struct pt_regs;
  18.151 +struct task_struct;
  18.152 +static inline void crash_kexec(struct pt_regs *regs) { }
  18.153 +static inline int kexec_should_crash(struct task_struct *p) { return 0; }
  18.154 +#endif /* CONFIG_KEXEC */
  18.155 +#endif /* LINUX_KEXEC_H */
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/linux-2.6-xen-sparse/kernel/kexec.c	Fri Dec 08 09:09:18 2006 -0700
    19.3 @@ -0,0 +1,1105 @@
    19.4 +/*
    19.5 + * kexec.c - kexec system call
    19.6 + * Copyright (C) 2002-2004 Eric Biederman  <ebiederm@xmission.com>
    19.7 + *
    19.8 + * This source code is licensed under the GNU General Public License,
    19.9 + * Version 2.  See the file COPYING for more details.
   19.10 + */
   19.11 +
   19.12 +#include <linux/capability.h>
   19.13 +#include <linux/mm.h>
   19.14 +#include <linux/file.h>
   19.15 +#include <linux/slab.h>
   19.16 +#include <linux/fs.h>
   19.17 +#include <linux/kexec.h>
   19.18 +#include <linux/spinlock.h>
   19.19 +#include <linux/list.h>
   19.20 +#include <linux/highmem.h>
   19.21 +#include <linux/syscalls.h>
   19.22 +#include <linux/reboot.h>
   19.23 +#include <linux/syscalls.h>
   19.24 +#include <linux/ioport.h>
   19.25 +#include <linux/hardirq.h>
   19.26 +
   19.27 +#include <asm/page.h>
   19.28 +#include <asm/uaccess.h>
   19.29 +#include <asm/io.h>
   19.30 +#include <asm/system.h>
   19.31 +#include <asm/semaphore.h>
   19.32 +
   19.33 +/* Per cpu memory for storing cpu states in case of system crash. */
   19.34 +note_buf_t* crash_notes;
   19.35 +
   19.36 +/* Location of the reserved area for the crash kernel */
   19.37 +struct resource crashk_res = {
   19.38 +	.name  = "Crash kernel",
   19.39 +	.start = 0,
   19.40 +	.end   = 0,
   19.41 +	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
   19.42 +};
   19.43 +
   19.44 +int kexec_should_crash(struct task_struct *p)
   19.45 +{
   19.46 +	if (in_interrupt() || !p->pid || p->pid == 1 || panic_on_oops)
   19.47 +		return 1;
   19.48 +	return 0;
   19.49 +}
   19.50 +
   19.51 +/*
   19.52 + * When kexec transitions to the new kernel there is a one-to-one
   19.53 + * mapping between physical and virtual addresses.  On processors
   19.54 + * where you can disable the MMU this is trivial, and easy.  For
   19.55 + * others it is still a simple predictable page table to setup.
   19.56 + *
   19.57 + * In that environment kexec copies the new kernel to its final
   19.58 + * resting place.  This means I can only support memory whose
   19.59 + * physical address can fit in an unsigned long.  In particular
   19.60 + * addresses where (pfn << PAGE_SHIFT) > ULONG_MAX cannot be handled.
   19.61 + * If the assembly stub has more restrictive requirements
   19.62 + * KEXEC_SOURCE_MEMORY_LIMIT and KEXEC_DEST_MEMORY_LIMIT can be
   19.63 + * defined more restrictively in <asm/kexec.h>.
   19.64 + *
   19.65 + * The code for the transition from the current kernel to the
   19.66 + * the new kernel is placed in the control_code_buffer, whose size
   19.67 + * is given by KEXEC_CONTROL_CODE_SIZE.  In the best case only a single
   19.68 + * page of memory is necessary, but some architectures require more.
   19.69 + * Because this memory must be identity mapped in the transition from
   19.70 + * virtual to physical addresses it must live in the range
   19.71 + * 0 - TASK_SIZE, as only the user space mappings are arbitrarily
   19.72 + * modifiable.
   19.73 + *
   19.74 + * The assembly stub in the control code buffer is passed a linked list
   19.75 + * of descriptor pages detailing the source pages of the new kernel,
   19.76 + * and the destination addresses of those source pages.  As this data
   19.77 + * structure is not used in the context of the current OS, it must
   19.78 + * be self-contained.
   19.79 + *
   19.80 + * The code has been made to work with highmem pages and will use a
   19.81 + * destination page in its final resting place (if it happens
   19.82 + * to allocate it).  The end product of this is that most of the
   19.83 + * physical address space, and most of RAM can be used.
   19.84 + *
   19.85 + * Future directions include:
   19.86 + *  - allocating a page table with the control code buffer identity
   19.87 + *    mapped, to simplify machine_kexec and make kexec_on_panic more
   19.88 + *    reliable.
   19.89 + */
   19.90 +
   19.91 +/*
   19.92 + * KIMAGE_NO_DEST is an impossible destination address..., for
   19.93 + * allocating pages whose destination address we do not care about.
   19.94 + */
   19.95 +#define KIMAGE_NO_DEST (-1UL)
   19.96 +
   19.97 +static int kimage_is_destination_range(struct kimage *image,
   19.98 +				       unsigned long start, unsigned long end);
   19.99 +static struct page *kimage_alloc_page(struct kimage *image,
  19.100 +				       gfp_t gfp_mask,
  19.101 +				       unsigned long dest);
  19.102 +
  19.103 +static int do_kimage_alloc(struct kimage **rimage, unsigned long entry,
  19.104 +	                    unsigned long nr_segments,
  19.105 +                            struct kexec_segment __user *segments)
  19.106 +{
  19.107 +	size_t segment_bytes;
  19.108 +	struct kimage *image;
  19.109 +	unsigned long i;
  19.110 +	int result;
  19.111 +
  19.112 +	/* Allocate a controlling structure */
  19.113 +	result = -ENOMEM;
  19.114 +	image = kmalloc(sizeof(*image), GFP_KERNEL);
  19.115 +	if (!image)
  19.116 +		goto out;
  19.117 +
  19.118 +	memset(image, 0, sizeof(*image));
  19.119 +	image->head = 0;
  19.120 +	image->entry = &image->head;
  19.121 +	image->last_entry = &image->head;
  19.122 +	image->control_page = ~0; /* By default this does not apply */
  19.123 +	image->start = entry;
  19.124 +	image->type = KEXEC_TYPE_DEFAULT;
  19.125 +
  19.126 +	/* Initialize the list of control pages */
  19.127 +	INIT_LIST_HEAD(&image->control_pages);
  19.128 +
  19.129 +	/* Initialize the list of destination pages */
  19.130 +	INIT_LIST_HEAD(&image->dest_pages);
  19.131 +
  19.132 +	/* Initialize the list of unuseable pages */
  19.133 +	INIT_LIST_HEAD(&image->unuseable_pages);
  19.134 +
  19.135 +	/* Read in the segments */
  19.136 +	image->nr_segments = nr_segments;
  19.137 +	segment_bytes = nr_segments * sizeof(*segments);
  19.138 +	result = copy_from_user(image->segment, segments, segment_bytes);
  19.139 +	if (result)
  19.140 +		goto out;
  19.141 +
  19.142 +	/*
  19.143 +	 * Verify we have good destination addresses.  The caller is
  19.144 +	 * responsible for making certain we don't attempt to load
  19.145 +	 * the new image into invalid or reserved areas of RAM.  This
  19.146 +	 * just verifies it is an address we can use.
  19.147 +	 *
  19.148 +	 * Since the kernel does everything in page size chunks ensure
  19.149 +	 * the destination addreses are page aligned.  Too many
  19.150 +	 * special cases crop of when we don't do this.  The most
  19.151 +	 * insidious is getting overlapping destination addresses
  19.152 +	 * simply because addresses are changed to page size
  19.153 +	 * granularity.
  19.154 +	 */
  19.155 +	result = -EADDRNOTAVAIL;
  19.156 +	for (i = 0; i < nr_segments; i++) {
  19.157 +		unsigned long mstart, mend;
  19.158 +
  19.159 +		mstart = image->segment[i].mem;
  19.160 +		mend   = mstart + image->segment[i].memsz;
  19.161 +		if ((mstart & ~PAGE_MASK) || (mend & ~PAGE_MASK))
  19.162 +			goto out;
  19.163 +		if (mend >= KEXEC_DESTINATION_MEMORY_LIMIT)
  19.164 +			goto out;
  19.165 +	}
  19.166 +
  19.167 +	/* Verify our destination addresses do not overlap.
  19.168 +	 * If we alloed overlapping destination addresses
  19.169 +	 * through very weird things can happen with no
  19.170 +	 * easy explanation as one segment stops on another.
  19.171 +	 */
  19.172 +	result = -EINVAL;
  19.173 +	for (i = 0; i < nr_segments; i++) {
  19.174 +		unsigned long mstart, mend;
  19.175 +		unsigned long j;
  19.176 +
  19.177 +		mstart = image->segment[i].mem;
  19.178 +		mend   = mstart + image->segment[i].memsz;
  19.179 +		for (j = 0; j < i; j++) {
  19.180 +			unsigned long pstart, pend;
  19.181 +			pstart = image->segment[j].mem;
  19.182 +			pend   = pstart + image->segment[j].memsz;
  19.183 +			/* Do the segments overlap ? */
  19.184 +			if ((mend > pstart) && (mstart < pend))
  19.185 +				goto out;
  19.186 +		}
  19.187 +	}
  19.188 +
  19.189 +	/* Ensure our buffer sizes are strictly less than
  19.190 +	 * our memory sizes.  This should always be the case,
  19.191 +	 * and it is easier to check up front than to be surprised
  19.192 +	 * later on.
  19.193 +	 */
  19.194 +	result = -EINVAL;
  19.195 +	for (i = 0; i < nr_segments; i++) {
  19.196 +		if (image->segment[i].bufsz > image->segment[i].memsz)
  19.197 +			goto out;
  19.198 +	}
  19.199 +
  19.200 +	result = 0;
  19.201 +out:
  19.202 +	if (result == 0)
  19.203 +		*rimage = image;
  19.204 +	else
  19.205 +		kfree(image);
  19.206 +
  19.207 +	return result;
  19.208 +
  19.209 +}
  19.210 +
  19.211 +static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry,
  19.212 +				unsigned long nr_segments,
  19.213 +				struct kexec_segment __user *segments)
  19.214 +{
  19.215 +	int result;
  19.216 +	struct kimage *image;
  19.217 +
  19.218 +	/* Allocate and initialize a controlling structure */
  19.219 +	image = NULL;
  19.220 +	result = do_kimage_alloc(&image, entry, nr_segments, segments);
  19.221 +	if (result)
  19.222 +		goto out;
  19.223 +
  19.224 +	*rimage = image;
  19.225 +
  19.226 +	/*
  19.227 +	 * Find a location for the control code buffer, and add it
  19.228 +	 * the vector of segments so that it's pages will also be
  19.229 +	 * counted as destination pages.
  19.230 +	 */
  19.231 +	result = -ENOMEM;
  19.232 +	image->control_code_page = kimage_alloc_control_pages(image,
  19.233 +					   get_order(KEXEC_CONTROL_CODE_SIZE));
  19.234 +	if (!image->control_code_page) {
  19.235 +		printk(KERN_ERR "Could not allocate control_code_buffer\n");
  19.236 +		goto out;
  19.237 +	}
  19.238 +
  19.239 +	result = 0;
  19.240 + out:
  19.241 +	if (result == 0)
  19.242 +		*rimage = image;
  19.243 +	else
  19.244 +		kfree(image);
  19.245 +
  19.246 +	return result;
  19.247 +}
  19.248 +
  19.249 +static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry,
  19.250 +				unsigned long nr_segments,
  19.251 +				struct kexec_segment __user *segments)
  19.252 +{
  19.253 +	int result;
  19.254 +	struct kimage *image;
  19.255 +	unsigned long i;
  19.256 +
  19.257 +	image = NULL;
  19.258 +	/* Verify we have a valid entry point */
  19.259 +	if ((entry < crashk_res.start) || (entry > crashk_res.end)) {
  19.260 +		result = -EADDRNOTAVAIL;
  19.261 +		goto out;
  19.262 +	}
  19.263 +
  19.264 +	/* Allocate and initialize a controlling structure */
  19.265 +	result = do_kimage_alloc(&image, entry, nr_segments, segments);
  19.266 +	if (result)
  19.267 +		goto out;
  19.268 +
  19.269 +	/* Enable the special crash kernel control page
  19.270 +	 * allocation policy.
  19.271 +	 */
  19.272 +	image->control_page = crashk_res.start;
  19.273 +	image->type = KEXEC_TYPE_CRASH;
  19.274 +
  19.275 +	/*
  19.276 +	 * Verify we have good destination addresses.  Normally
  19.277 +	 * the caller is responsible for making certain we don't
  19.278 +	 * attempt to load the new image into invalid or reserved
  19.279 +	 * areas of RAM.  But crash kernels are preloaded into a
  19.280 +	 * reserved area of ram.  We must ensure the addresses
  19.281 +	 * are in the reserved area otherwise preloading the
  19.282 +	 * kernel could corrupt things.
  19.283 +	 */
  19.284 +	result = -EADDRNOTAVAIL;
  19.285 +	for (i = 0; i < nr_segments; i++) {
  19.286 +		unsigned long mstart, mend;
  19.287 +
  19.288 +		mstart = image->segment[i].mem;
  19.289 +		mend = mstart + image->segment[i].memsz - 1;
  19.290 +		/* Ensure we are within the crash kernel limits */
  19.291 +		if ((mstart < crashk_res.start) || (mend > crashk_res.end))
  19.292 +			goto out;
  19.293 +	}
  19.294 +
  19.295 +	/*
  19.296 +	 * Find a location for the control code buffer, and add
  19.297 +	 * the vector of segments so that it's pages will also be
  19.298 +	 * counted as destination pages.
  19.299 +	 */
  19.300 +	result = -ENOMEM;
  19.301 +	image->control_code_page = kimage_alloc_control_pages(image,
  19.302 +					   get_order(KEXEC_CONTROL_CODE_SIZE));
  19.303 +	if (!image->control_code_page) {
  19.304 +		printk(KERN_ERR "Could not allocate control_code_buffer\n");
  19.305 +		goto out;
  19.306 +	}
  19.307 +
  19.308 +	result = 0;
  19.309 +out:
  19.310 +	if (result == 0)
  19.311 +		*rimage = image;
  19.312 +	else
  19.313 +		kfree(image);
  19.314 +
  19.315 +	return result;
  19.316 +}
  19.317 +
  19.318 +static int kimage_is_destination_range(struct kimage *image,
  19.319 +					unsigned long start,
  19.320 +					unsigned long end)
  19.321 +{
  19.322 +	unsigned long i;
  19.323 +
  19.324 +	for (i = 0; i < image->nr_segments; i++) {
  19.325 +		unsigned long mstart, mend;
  19.326 +
  19.327 +		mstart = image->segment[i].mem;
  19.328 +		mend = mstart + image->segment[i].memsz;
  19.329 +		if ((end > mstart) && (start < mend))
  19.330 +			return 1;
  19.331 +	}
  19.332 +
  19.333 +	return 0;
  19.334 +}
  19.335 +
  19.336 +static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order)
  19.337 +{
  19.338 +	struct page *pages;
  19.339 +
  19.340 +	pages = alloc_pages(gfp_mask, order);
  19.341 +	if (pages) {
  19.342 +		unsigned int count, i;
  19.343 +		pages->mapping = NULL;
  19.344 +		set_page_private(pages, order);
  19.345 +		count = 1 << order;
  19.346 +		for (i = 0; i < count; i++)
  19.347 +			SetPageReserved(pages + i);
  19.348 +	}
  19.349 +
  19.350 +	return pages;
  19.351 +}
  19.352 +
  19.353 +static void kimage_free_pages(struct page *page)
  19.354 +{
  19.355 +	unsigned int order, count, i;
  19.356 +
  19.357 +	order = page_private(page);
  19.358 +	count = 1 << order;
  19.359 +	for (i = 0; i < count; i++)
  19.360 +		ClearPageReserved(page + i);
  19.361 +	__free_pages(page, order);
  19.362 +}
  19.363 +
  19.364 +static void kimage_free_page_list(struct list_head *list)
  19.365 +{
  19.366 +	struct list_head *pos, *next;
  19.367 +
  19.368 +	list_for_each_safe(pos, next, list) {
  19.369 +		struct page *page;
  19.370 +
  19.371 +		page = list_entry(pos, struct page, lru);
  19.372 +		list_del(&page->lru);
  19.373 +		kimage_free_pages(page);
  19.374 +	}
  19.375 +}
  19.376 +
  19.377 +static struct page *kimage_alloc_normal_control_pages(struct kimage *image,
  19.378 +							unsigned int order)
  19.379 +{
  19.380 +	/* Control pages are special, they are the intermediaries
  19.381 +	 * that are needed while we copy the rest of the pages
  19.382 +	 * to their final resting place.  As such they must
  19.383 +	 * not conflict with either the destination addresses
  19.384 +	 * or memory the kernel is already using.
  19.385 +	 *
  19.386 +	 * The only case where we really need more than one of
  19.387 +	 * these are for architectures where we cannot disable
  19.388 +	 * the MMU and must instead generate an identity mapped
  19.389 +	 * page table for all of the memory.
  19.390 +	 *
  19.391 +	 * At worst this runs in O(N) of the image size.
  19.392 +	 */
  19.393 +	struct list_head extra_pages;
  19.394 +	struct page *pages;
  19.395 +	unsigned int count;
  19.396 +
  19.397 +	count = 1 << order;
  19.398 +	INIT_LIST_HEAD(&extra_pages);
  19.399 +
  19.400 +	/* Loop while I can allocate a page and the page allocated
  19.401 +	 * is a destination page.
  19.402 +	 */
  19.403 +	do {
  19.404 +		unsigned long pfn, epfn, addr, eaddr;
  19.405 +
  19.406 +		pages = kimage_alloc_pages(GFP_KERNEL, order);
  19.407 +		if (!pages)
  19.408 +			break;
  19.409 +		pfn   = kexec_page_to_pfn(pages);
  19.410 +		epfn  = pfn + count;
  19.411 +		addr  = pfn << PAGE_SHIFT;
  19.412 +		eaddr = epfn << PAGE_SHIFT;
  19.413 +		if ((epfn >= (KEXEC_CONTROL_MEMORY_LIMIT >> PAGE_SHIFT)) ||
  19.414 +			      kimage_is_destination_range(image, addr, eaddr)) {
  19.415 +			list_add(&pages->lru, &extra_pages);
  19.416 +			pages = NULL;
  19.417 +		}
  19.418 +	} while (!pages);
  19.419 +
  19.420 +	if (pages) {
  19.421 +		/* Remember the allocated page... */
  19.422 +		list_add(&pages->lru, &image->control_pages);
  19.423 +
  19.424 +		/* Because the page is already in it's destination
  19.425 +		 * location we will never allocate another page at
  19.426 +		 * that address.  Therefore kimage_alloc_pages
  19.427 +		 * will not return it (again) and we don't need
  19.428 +		 * to give it an entry in image->segment[].
  19.429 +		 */
  19.430 +	}
  19.431 +	/* Deal with the destination pages I have inadvertently allocated.
  19.432 +	 *
  19.433 +	 * Ideally I would convert multi-page allocations into single
  19.434 +	 * page allocations, and add everyting to image->dest_pages.
  19.435 +	 *
  19.436 +	 * For now it is simpler to just free the pages.
  19.437 +	 */
  19.438 +	kimage_free_page_list(&extra_pages);
  19.439 +
  19.440 +	return pages;
  19.441 +}
  19.442 +
  19.443 +#ifndef CONFIG_XEN
  19.444 +static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
  19.445 +						      unsigned int order)
  19.446 +{
  19.447 +	/* Control pages are special, they are the intermediaries
  19.448 +	 * that are needed while we copy the rest of the pages
  19.449 +	 * to their final resting place.  As such they must
  19.450 +	 * not conflict with either the destination addresses
  19.451 +	 * or memory the kernel is already using.
  19.452 +	 *
  19.453 +	 * Control pages are also the only pags we must allocate
  19.454 +	 * when loading a crash kernel.  All of the other pages
  19.455 +	 * are specified by the segments and we just memcpy
  19.456 +	 * into them directly.
  19.457 +	 *
  19.458 +	 * The only case where we really need more than one of
  19.459 +	 * these are for architectures where we cannot disable
  19.460 +	 * the MMU and must instead generate an identity mapped
  19.461 +	 * page table for all of the memory.
  19.462 +	 *
  19.463 +	 * Given the low demand this implements a very simple
  19.464 +	 * allocator that finds the first hole of the appropriate
  19.465 +	 * size in the reserved memory region, and allocates all
  19.466 +	 * of the memory up to and including the hole.
  19.467 +	 */
  19.468 +	unsigned long hole_start, hole_end, size;
  19.469 +	struct page *pages;
  19.470 +
  19.471 +	pages = NULL;
  19.472 +	size = (1 << order) << PAGE_SHIFT;
  19.473 +	hole_start = (image->control_page + (size - 1)) & ~(size - 1);
  19.474 +	hole_end   = hole_start + size - 1;
  19.475 +	while (hole_end <= crashk_res.end) {
  19.476 +		unsigned long i;
  19.477 +
  19.478 +		if (hole_end > KEXEC_CONTROL_MEMORY_LIMIT)
  19.479 +			break;
  19.480 +		if (hole_end > crashk_res.end)
  19.481 +			break;
  19.482 +		/* See if I overlap any of the segments */
  19.483 +		for (i = 0; i < image->nr_segments; i++) {
  19.484 +			unsigned long mstart, mend;
  19.485 +
  19.486 +			mstart = image->segment[i].mem;
  19.487 +			mend   = mstart + image->segment[i].memsz - 1;
  19.488 +			if ((hole_end >= mstart) && (hole_start <= mend)) {
  19.489 +				/* Advance the hole to the end of the segment */
  19.490 +				hole_start = (mend + (size - 1)) & ~(size - 1);
  19.491 +				hole_end   = hole_start + size - 1;
  19.492 +				break;
  19.493 +			}
  19.494 +		}
  19.495 +		/* If I don't overlap any segments I have found my hole! */
  19.496 +		if (i == image->nr_segments) {
  19.497 +			pages = kexec_pfn_to_page(hole_start >> PAGE_SHIFT);
  19.498 +			break;
  19.499 +		}
  19.500 +	}
  19.501 +	if (pages)
  19.502 +		image->control_page = hole_end;
  19.503 +
  19.504 +	return pages;
  19.505 +}
  19.506 +
  19.507 +
  19.508 +struct page *kimage_alloc_control_pages(struct kimage *image,
  19.509 +					 unsigned int order)
  19.510 +{
  19.511 +	struct page *pages = NULL;
  19.512 +
  19.513 +	switch (image->type) {
  19.514 +	case KEXEC_TYPE_DEFAULT:
  19.515 +		pages = kimage_alloc_normal_control_pages(image, order);
  19.516 +		break;
  19.517 +	case KEXEC_TYPE_CRASH:
  19.518 +		pages = kimage_alloc_crash_control_pages(image, order);
  19.519 +		break;
  19.520 +	}
  19.521 +
  19.522 +	return pages;
  19.523 +}
  19.524 +#else /* !CONFIG_XEN */
  19.525 +struct page *kimage_alloc_control_pages(struct kimage *image,
  19.526 +					 unsigned int order)
  19.527 +{
  19.528 +	return kimage_alloc_normal_control_pages(image, order);
  19.529 +}
  19.530 +#endif
  19.531 +
  19.532 +static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
  19.533 +{
  19.534 +	if (*image->entry != 0)
  19.535 +		image->entry++;
  19.536 +
  19.537 +	if (image->entry == image->last_entry) {
  19.538 +		kimage_entry_t *ind_page;
  19.539 +		struct page *page;
  19.540 +
  19.541 +		page = kimage_alloc_page(image, GFP_KERNEL, KIMAGE_NO_DEST);
  19.542 +		if (!page)
  19.543 +			return -ENOMEM;
  19.544 +
  19.545 +		ind_page = page_address(page);
  19.546 +		*image->entry = kexec_virt_to_phys(ind_page) | IND_INDIRECTION;
  19.547 +		image->entry = ind_page;
  19.548 +		image->last_entry = ind_page +
  19.549 +				      ((PAGE_SIZE/sizeof(kimage_entry_t)) - 1);
  19.550 +	}
  19.551 +	*image->entry = entry;
  19.552 +	image->entry++;
  19.553 +	*image->entry = 0;
  19.554 +
  19.555 +	return 0;
  19.556 +}
  19.557 +
  19.558 +static int kimage_set_destination(struct kimage *image,
  19.559 +				   unsigned long destination)
  19.560 +{
  19.561 +	int result;
  19.562 +
  19.563 +	destination &= PAGE_MASK;
  19.564 +	result = kimage_add_entry(image, destination | IND_DESTINATION);
  19.565 +	if (result == 0)
  19.566 +		image->destination = destination;
  19.567 +
  19.568 +	return result;
  19.569 +}
  19.570 +
  19.571 +
  19.572 +static int kimage_add_page(struct kimage *image, unsigned long page)
  19.573 +{
  19.574 +	int result;
  19.575 +
  19.576 +	page &= PAGE_MASK;
  19.577 +	result = kimage_add_entry(image, page | IND_SOURCE);
  19.578 +	if (result == 0)
  19.579 +		image->destination += PAGE_SIZE;
  19.580 +
  19.581 +	return result;
  19.582 +}
  19.583 +
  19.584 +
  19.585 +static void kimage_free_extra_pages(struct kimage *image)
  19.586 +{
  19.587 +	/* Walk through and free any extra destination pages I may have */
  19.588 +	kimage_free_page_list(&image->dest_pages);
  19.589 +
  19.590 +	/* Walk through and free any unuseable pages I have cached */
  19.591 +	kimage_free_page_list(&image->unuseable_pages);
  19.592 +
  19.593 +}
  19.594 +static int kimage_terminate(struct kimage *image)
  19.595 +{
  19.596 +	if (*image->entry != 0)
  19.597 +		image->entry++;
  19.598 +
  19.599 +	*image->entry = IND_DONE;
  19.600 +
  19.601 +	return 0;
  19.602 +}
  19.603 +
  19.604 +#define for_each_kimage_entry(image, ptr, entry) \
  19.605 +	for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); \
  19.606 +		ptr = (entry & IND_INDIRECTION)? \
  19.607 +			kexec_phys_to_virt((entry & PAGE_MASK)): ptr +1)
  19.608 +
  19.609 +static void kimage_free_entry(kimage_entry_t entry)
  19.610 +{
  19.611 +	struct page *page;
  19.612 +
  19.613 +	page = kexec_pfn_to_page(entry >> PAGE_SHIFT);
  19.614 +	kimage_free_pages(page);
  19.615 +}
  19.616 +
  19.617 +static void kimage_free(struct kimage *image)
  19.618 +{
  19.619 +	kimage_entry_t *ptr, entry;
  19.620 +	kimage_entry_t ind = 0;
  19.621 +
  19.622 +	if (!image)
  19.623 +		return;
  19.624 +
  19.625 +#ifdef CONFIG_XEN
  19.626 +	xen_machine_kexec_unload(image);
  19.627 +#endif
  19.628 +
  19.629 +	kimage_free_extra_pages(image);
  19.630 +	for_each_kimage_entry(image, ptr, entry) {
  19.631 +		if (entry & IND_INDIRECTION) {
  19.632 +			/* Free the previous indirection page */
  19.633 +			if (ind & IND_INDIRECTION)
  19.634 +				kimage_free_entry(ind);
  19.635 +			/* Save this indirection page until we are
  19.636 +			 * done with it.
  19.637 +			 */
  19.638 +			ind = entry;
  19.639 +		}
  19.640 +		else if (entry & IND_SOURCE)
  19.641 +			kimage_free_entry(entry);
  19.642 +	}
  19.643 +	/* Free the final indirection page */
  19.644 +	if (ind & IND_INDIRECTION)
  19.645 +		kimage_free_entry(ind);
  19.646 +
  19.647 +	/* Handle any machine specific cleanup */
  19.648 +	machine_kexec_cleanup(image);
  19.649 +
  19.650 +	/* Free the kexec control pages... */
  19.651 +	kimage_free_page_list(&image->control_pages);
  19.652 +	kfree(image);
  19.653 +}
  19.654 +
  19.655 +static kimage_entry_t *kimage_dst_used(struct kimage *image,
  19.656 +					unsigned long page)
  19.657 +{
  19.658 +	kimage_entry_t *ptr, entry;
  19.659 +	unsigned long destination = 0;
  19.660 +
  19.661 +	for_each_kimage_entry(image, ptr, entry) {
  19.662 +		if (entry & IND_DESTINATION)
  19.663 +			destination = entry & PAGE_MASK;
  19.664 +		else if (entry & IND_SOURCE) {
  19.665 +			if (page == destination)
  19.666 +				return ptr;
  19.667 +			destination += PAGE_SIZE;
  19.668 +		}
  19.669 +	}
  19.670 +
  19.671 +	return NULL;
  19.672 +}
  19.673 +
  19.674 +static struct page *kimage_alloc_page(struct kimage *image,
  19.675 +					gfp_t gfp_mask,
  19.676 +					unsigned long destination)
  19.677 +{
  19.678 +	/*
  19.679 +	 * Here we implement safeguards to ensure that a source page
  19.680 +	 * is not copied to its destination page before the data on
  19.681 +	 * the destination page is no longer useful.
  19.682 +	 *
  19.683 +	 * To do this we maintain the invariant that a source page is
  19.684 +	 * either its own destination page, or it is not a
  19.685 +	 * destination page at all.
  19.686 +	 *
  19.687 +	 * That is slightly stronger than required, but the proof
  19.688 +	 * that no problems will not occur is trivial, and the
  19.689 +	 * implementation is simply to verify.
  19.690 +	 *
  19.691 +	 * When allocating all pages normally this algorithm will run
  19.692 +	 * in O(N) time, but in the worst case it will run in O(N^2)
  19.693 +	 * time.   If the runtime is a problem the data structures can
  19.694 +	 * be fixed.
  19.695 +	 */
  19.696 +	struct page *page;
  19.697 +	unsigned long addr;
  19.698 +
  19.699 +	/*
  19.700 +	 * Walk through the list of destination pages, and see if I
  19.701 +	 * have a match.
  19.702 +	 */
  19.703 +	list_for_each_entry(page, &image->dest_pages, lru) {
  19.704 +		addr = kexec_page_to_pfn(page) << PAGE_SHIFT;
  19.705 +		if (addr == destination) {
  19.706 +			list_del(&page->lru);
  19.707 +			return page;
  19.708 +		}
  19.709 +	}
  19.710 +	page = NULL;
  19.711 +	while (1) {
  19.712 +		kimage_entry_t *old;
  19.713 +
  19.714 +		/* Allocate a page, if we run out of memory give up */
  19.715 +		page = kimage_alloc_pages(gfp_mask, 0);
  19.716 +		if (!page)
  19.717 +			return NULL;
  19.718 +		/* If the page cannot be used file it away */
  19.719 +		if (kexec_page_to_pfn(page) >
  19.720 +				(KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
  19.721 +			list_add(&page->lru, &image->unuseable_pages);
  19.722 +			continue;
  19.723 +		}
  19.724 +		addr = kexec_page_to_pfn(page) << PAGE_SHIFT;
  19.725 +
  19.726 +		/* If it is the destination page we want use it */
  19.727 +		if (addr == destination)
  19.728 +			break;
  19.729 +
  19.730 +		/* If the page is not a destination page use it */
  19.731 +		if (!kimage_is_destination_range(image, addr,
  19.732 +						  addr + PAGE_SIZE))
  19.733 +			break;
  19.734 +
  19.735 +		/*
  19.736 +		 * I know that the page is someones destination page.
  19.737 +		 * See if there is already a source page for this
  19.738 +		 * destination page.  And if so swap the source pages.
  19.739 +		 */
  19.740 +		old = kimage_dst_used(image, addr);
  19.741 +		if (old) {
  19.742 +			/* If so move it */
  19.743 +			unsigned long old_addr;
  19.744 +			struct page *old_page;
  19.745 +
  19.746 +			old_addr = *old & PAGE_MASK;
  19.747 +			old_page = kexec_pfn_to_page(old_addr >> PAGE_SHIFT);
  19.748 +			copy_highpage(page, old_page);
  19.749 +			*old = addr | (*old & ~PAGE_MASK);
  19.750 +
  19.751 +			/* The old page I have found cannot be a
  19.752 +			 * destination page, so return it.
  19.753 +			 */
  19.754 +			addr = old_addr;
  19.755 +			page = old_page;
  19.756 +			break;
  19.757 +		}
  19.758 +		else {
  19.759 +			/* Place the page on the destination list I
  19.760 +			 * will use it later.
  19.761 +			 */
  19.762 +			list_add(&page->lru, &image->dest_pages);
  19.763 +		}
  19.764 +	}
  19.765 +
  19.766 +	return page;
  19.767 +}
  19.768 +
  19.769 +static int kimage_load_normal_segment(struct kimage *image,
  19.770 +					 struct kexec_segment *segment)
  19.771 +{
  19.772 +	unsigned long maddr;
  19.773 +	unsigned long ubytes, mbytes;
  19.774 +	int result;
  19.775 +	unsigned char __user *buf;
  19.776 +
  19.777 +	result = 0;
  19.778 +	buf = segment->buf;
  19.779 +	ubytes = segment->bufsz;
  19.780 +	mbytes = segment->memsz;
  19.781 +	maddr = segment->mem;
  19.782 +
  19.783 +	result = kimage_set_destination(image, maddr);
  19.784 +	if (result < 0)
  19.785 +		goto out;
  19.786 +
  19.787 +	while (mbytes) {
  19.788 +		struct page *page;
  19.789 +		char *ptr;
  19.790 +		size_t uchunk, mchunk;
  19.791 +
  19.792 +		page = kimage_alloc_page(image, GFP_HIGHUSER, maddr);
  19.793 +		if (page == 0) {
  19.794 +			result  = -ENOMEM;
  19.795 +			goto out;
  19.796 +		}
  19.797 +		result = kimage_add_page(image, kexec_page_to_pfn(page)
  19.798 +								<< PAGE_SHIFT);
  19.799 +		if (result < 0)
  19.800 +			goto out;
  19.801 +
  19.802 +		ptr = kmap(page);
  19.803 +		/* Start with a clear page */
  19.804 +		memset(ptr, 0, PAGE_SIZE);
  19.805 +		ptr += maddr & ~PAGE_MASK;
  19.806 +		mchunk = PAGE_SIZE - (maddr & ~PAGE_MASK);
  19.807 +		if (mchunk > mbytes)
  19.808 +			mchunk = mbytes;
  19.809 +
  19.810 +		uchunk = mchunk;
  19.811 +		if (uchunk > ubytes)
  19.812 +			uchunk = ubytes;
  19.813 +
  19.814 +		result = copy_from_user(ptr, buf, uchunk);
  19.815 +		kunmap(page);
  19.816 +		if (result) {
  19.817 +			result = (result < 0) ? result : -EIO;
  19.818 +			goto out;
  19.819 +		}
  19.820 +		ubytes -= uchunk;
  19.821 +		maddr  += mchunk;
  19.822 +		buf    += mchunk;
  19.823 +		mbytes -= mchunk;
  19.824 +	}
  19.825 +out:
  19.826 +	return result;
  19.827 +}
  19.828 +
  19.829 +#ifndef CONFIG_XEN
  19.830 +static int kimage_load_crash_segment(struct kimage *image,
  19.831 +					struct kexec_segment *segment)
  19.832 +{
  19.833 +	/* For crash dumps kernels we simply copy the data from
  19.834 +	 * user space to it's destination.
  19.835 +	 * We do things a page at a time for the sake of kmap.
  19.836 +	 */
  19.837 +	unsigned long maddr;
  19.838 +	unsigned long ubytes, mbytes;
  19.839 +	int result;
  19.840 +	unsigned char __user *buf;
  19.841 +
  19.842 +	result = 0;
  19.843 +	buf = segment->buf;
  19.844 +	ubytes = segment->bufsz;
  19.845 +	mbytes = segment->memsz;
  19.846 +	maddr = segment->mem;
  19.847 +	while (mbytes) {
  19.848 +		struct page *page;
  19.849 +		char *ptr;
  19.850 +		size_t uchunk, mchunk;
  19.851 +
  19.852 +		page = kexec_pfn_to_page(maddr >> PAGE_SHIFT);
  19.853 +		if (page == 0) {
  19.854 +			result  = -ENOMEM;
  19.855 +			goto out;
  19.856 +		}
  19.857 +		ptr = kmap(page);
  19.858 +		ptr += maddr & ~PAGE_MASK;
  19.859 +		mchunk = PAGE_SIZE - (maddr & ~PAGE_MASK);
  19.860 +		if (mchunk > mbytes)
  19.861 +			mchunk = mbytes;
  19.862 +
  19.863 +		uchunk = mchunk;
  19.864 +		if (uchunk > ubytes) {
  19.865 +			uchunk = ubytes;
  19.866 +			/* Zero the trailing part of the page */
  19.867 +			memset(ptr + uchunk, 0, mchunk - uchunk);
  19.868 +		}
  19.869 +		result = copy_from_user(ptr, buf, uchunk);
  19.870 +		kunmap(page);
  19.871 +		if (result) {
  19.872 +			result = (result < 0) ? result : -EIO;
  19.873 +			goto out;
  19.874 +		}
  19.875 +		ubytes -= uchunk;
  19.876 +		maddr  += mchunk;
  19.877 +		buf    += mchunk;
  19.878 +		mbytes -= mchunk;
  19.879 +	}
  19.880 +out:
  19.881 +	return result;
  19.882 +}
  19.883 +
  19.884 +static int kimage_load_segment(struct kimage *image,
  19.885 +				struct kexec_segment *segment)
  19.886 +{
  19.887 +	int result = -ENOMEM;
  19.888 +
  19.889 +	switch (image->type) {
  19.890 +	case KEXEC_TYPE_DEFAULT:
  19.891 +		result = kimage_load_normal_segment(image, segment);
  19.892 +		break;
  19.893 +	case KEXEC_TYPE_CRASH:
  19.894 +		result = kimage_load_crash_segment(image, segment);
  19.895 +		break;
  19.896 +	}
  19.897 +
  19.898 +	return result;
  19.899 +}
  19.900 +#else /* CONFIG_XEN */
  19.901 +static int kimage_load_segment(struct kimage *image,
  19.902 +				struct kexec_segment *segment)
  19.903 +{
  19.904 +	return kimage_load_normal_segment(image, segment);
  19.905 +}
  19.906 +#endif
  19.907 +
  19.908 +/*
  19.909 + * Exec Kernel system call: for obvious reasons only root may call it.
  19.910 + *
  19.911 + * This call breaks up into three pieces.
  19.912 + * - A generic part which loads the new kernel from the current
  19.913 + *   address space, and very carefully places the data in the
  19.914 + *   allocated pages.
  19.915 + *
  19.916 + * - A generic part that interacts with the kernel and tells all of
  19.917 + *   the devices to shut down.  Preventing on-going dmas, and placing
  19.918 + *   the devices in a consistent state so a later kernel can
  19.919 + *   reinitialize them.
  19.920 + *
  19.921 + * - A machine specific part that includes the syscall number
  19.922 + *   and the copies the image to it's final destination.  And
  19.923 + *   jumps into the image at entry.
  19.924 + *
  19.925 + * kexec does not sync, or unmount filesystems so if you need
  19.926 + * that to happen you need to do that yourself.
  19.927 + */
  19.928 +struct kimage *kexec_image = NULL;
  19.929 +static struct kimage *kexec_crash_image = NULL;
  19.930 +/*
  19.931 + * A home grown binary mutex.
  19.932 + * Nothing can wait so this mutex is safe to use
  19.933 + * in interrupt context :)
  19.934 + */
  19.935 +static int kexec_lock = 0;
  19.936 +
  19.937 +asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
  19.938 +				struct kexec_segment __user *segments,
  19.939 +				unsigned long flags)
  19.940 +{
  19.941 +	struct kimage **dest_image, *image;
  19.942 +	int locked;
  19.943 +	int result;
  19.944 +
  19.945 +	/* We only trust the superuser with rebooting the system. */
  19.946 +	if (!capable(CAP_SYS_BOOT))
  19.947 +		return -EPERM;
  19.948 +
  19.949 +	/*
  19.950 +	 * Verify we have a legal set of flags
  19.951 +	 * This leaves us room for future extensions.
  19.952 +	 */
  19.953 +	if ((flags & KEXEC_FLAGS) != (flags & ~KEXEC_ARCH_MASK))
  19.954 +		return -EINVAL;
  19.955 +
  19.956 +	/* Verify we are on the appropriate architecture */
  19.957 +	if (((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH) &&
  19.958 +		((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH_DEFAULT))
  19.959 +		return -EINVAL;
  19.960 +
  19.961 +	/* Put an artificial cap on the number
  19.962 +	 * of segments passed to kexec_load.
  19.963 +	 */
  19.964 +	if (nr_segments > KEXEC_SEGMENT_MAX)
  19.965 +		return -EINVAL;
  19.966 +
  19.967 +	image = NULL;
  19.968 +	result = 0;
  19.969 +
  19.970 +	/* Because we write directly to the reserved memory
  19.971 +	 * region when loading crash kernels we need a mutex here to
  19.972 +	 * prevent multiple crash  kernels from attempting to load
  19.973 +	 * simultaneously, and to prevent a crash kernel from loading
  19.974 +	 * over the top of a in use crash kernel.
  19.975 +	 *
  19.976 +	 * KISS: always take the mutex.
  19.977 +	 */
  19.978 +	locked = xchg(&kexec_lock, 1);
  19.979 +	if (locked)
  19.980 +		return -EBUSY;
  19.981 +
  19.982 +	dest_image = &kexec_image;
  19.983 +	if (flags & KEXEC_ON_CRASH)
  19.984 +		dest_image = &kexec_crash_image;
  19.985 +	if (nr_segments > 0) {
  19.986 +		unsigned long i;
  19.987 +
  19.988 +		/* Loading another kernel to reboot into */
  19.989 +		if ((flags & KEXEC_ON_CRASH) == 0)
  19.990 +			result = kimage_normal_alloc(&image, entry,
  19.991 +							nr_segments, segments);
  19.992 +		/* Loading another kernel to switch to if this one crashes */
  19.993 +		else if (flags & KEXEC_ON_CRASH) {
  19.994 +			/* Free any current crash dump kernel before
  19.995 +			 * we corrupt it.
  19.996 +			 */
  19.997 +			kimage_free(xchg(&kexec_crash_image, NULL));
  19.998 +			result = kimage_crash_alloc(&image, entry,
  19.999 +						     nr_segments, segments);
 19.1000 +		}
 19.1001 +		if (result)
 19.1002 +			goto out;
 19.1003 +
 19.1004 +		result = machine_kexec_prepare(image);
 19.1005 +		if (result)
 19.1006 +			goto out;
 19.1007 +
 19.1008 +		for (i = 0; i < nr_segments; i++) {
 19.1009 +			result = kimage_load_segment(image, &image->segment[i]);
 19.1010 +			if (result)
 19.1011 +				goto out;
 19.1012 +		}
 19.1013 +		result = kimage_terminate(image);
 19.1014 +		if (result)
 19.1015 +			goto out;
 19.1016 +	}
 19.1017 +#ifdef CONFIG_XEN
 19.1018 +	result = xen_machine_kexec_load(image);
 19.1019 +	if (result)
 19.1020 +		goto out;
 19.1021 +#endif
 19.1022 +	/* Install the new kernel, and  Uninstall the old */
 19.1023 +	image = xchg(dest_image, image);
 19.1024 +
 19.1025 +out:
 19.1026 +	xchg(&kexec_lock, 0); /* Release the mutex */
 19.1027 +	kimage_free(image);
 19.1028 +
 19.1029 +	return result;
 19.1030 +}
 19.1031 +
 19.1032 +#ifdef CONFIG_COMPAT
 19.1033 +asmlinkage long compat_sys_kexec_load(unsigned long entry,
 19.1034 +				unsigned long nr_segments,
 19.1035 +				struct compat_kexec_segment __user *segments,
 19.1036 +				unsigned long flags)
 19.1037 +{
 19.1038 +	struct compat_kexec_segment in;
 19.1039 +	struct kexec_segment out, __user *ksegments;
 19.1040 +	unsigned long i, result;
 19.1041 +
 19.1042 +	/* Don't allow clients that don't understand the native
 19.1043 +	 * architecture to do anything.
 19.1044 +	 */
 19.1045 +	if ((flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_DEFAULT)
 19.1046 +		return -EINVAL;
 19.1047 +
 19.1048 +	if (nr_segments > KEXEC_SEGMENT_MAX)
 19.1049 +		return -EINVAL;
 19.1050 +
 19.1051 +	ksegments = compat_alloc_user_space(nr_segments * sizeof(out));
 19.1052 +	for (i=0; i < nr_segments; i++) {
 19.1053 +		result = copy_from_user(&in, &segments[i], sizeof(in));
 19.1054 +		if (result)
 19.1055 +			return -EFAULT;
 19.1056 +
 19.1057 +		out.buf   = compat_ptr(in.buf);
 19.1058 +		out.bufsz = in.bufsz;
 19.1059 +		out.mem   = in.mem;
 19.1060 +		out.memsz = in.memsz;
 19.1061 +
 19.1062 +		result = copy_to_user(&ksegments[i], &out, sizeof(out));
 19.1063 +		if (result)
 19.1064 +			return -EFAULT;
 19.1065 +	}
 19.1066 +
 19.1067 +	return sys_kexec_load(entry, nr_segments, ksegments, flags);
 19.1068 +}
 19.1069 +#endif
 19.1070 +
 19.1071 +void crash_kexec(struct pt_regs *regs)
 19.1072 +{
 19.1073 +	struct kimage *image;
 19.1074 +	int locked;
 19.1075 +
 19.1076 +	/* Take the kexec_lock here to prevent sys_kexec_load
 19.1077 +	 * running on one cpu from replacing the crash kernel
 19.1078 +	 * we are using after a panic on a different cpu.
 19.1079 +	 *
 19.1080 +	 * If the crash kernel was not located in a fixed area
 19.1081 +	 * of memory the xchg(&kexec_crash_image) would be
 19.1082 +	 * sufficient.  But since I reuse the memory...
 19.1083 +	 */
 19.1084 +	locked = xchg(&kexec_lock, 1);
 19.1085 +	if (!locked) {
 19.1086 +		image = xchg(&kexec_crash_image, NULL);
 19.1087 +		if (image) {
 19.1088 +			struct pt_regs fixed_regs;
 19.1089 +			crash_setup_regs(&fixed_regs, regs);
 19.1090 +			machine_crash_shutdown(&fixed_regs);
 19.1091 +			machine_kexec(image);
 19.1092 +		}
 19.1093 +		xchg(&kexec_lock, 0);
 19.1094 +	}
 19.1095 +}
 19.1096 +
 19.1097 +static int __init crash_notes_memory_init(void)
 19.1098 +{
 19.1099 +	/* Allocate memory for saving cpu registers. */
 19.1100 +	crash_notes = alloc_percpu(note_buf_t);
 19.1101 +	if (!crash_notes) {
 19.1102 +		printk("Kexec: Memory allocation for saving cpu register"
 19.1103 +		" states failed\n");
 19.1104 +		return -ENOMEM;
 19.1105 +	}
 19.1106 +	return 0;
 19.1107 +}
 19.1108 +module_init(crash_notes_memory_init)
    20.1 --- a/patches/linux-2.6.16.33/kexec-generic.patch	Thu Dec 07 16:18:55 2006 -0700
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,228 +0,0 @@
    20.4 ---- 0001/include/linux/kexec.h
    20.5 -+++ work/include/linux/kexec.h
    20.6 -@@ -31,6 +31,13 @@
    20.7 - #error KEXEC_ARCH not defined
    20.8 - #endif
    20.9 - 
   20.10 -+#ifndef KEXEC_ARCH_HAS_PAGE_MACROS
   20.11 -+#define kexec_page_to_pfn(page)  page_to_pfn(page)
   20.12 -+#define kexec_pfn_to_page(pfn)   pfn_to_page(pfn)
   20.13 -+#define kexec_virt_to_phys(addr) virt_to_phys(addr)
   20.14 -+#define kexec_phys_to_virt(addr) phys_to_virt(addr)
   20.15 -+#endif
   20.16 -+
   20.17 - /*
   20.18 -  * This structure is used to hold the arguments that are used when loading
   20.19 -  * kernel binaries.
   20.20 -@@ -91,6 +98,13 @@ struct kimage {
   20.21 - extern NORET_TYPE void machine_kexec(struct kimage *image) ATTRIB_NORET;
   20.22 - extern int machine_kexec_prepare(struct kimage *image);
   20.23 - extern void machine_kexec_cleanup(struct kimage *image);
   20.24 -+#ifdef CONFIG_XEN
   20.25 -+extern int xen_machine_kexec_load(struct kimage *image);
   20.26 -+extern void xen_machine_kexec_unload(struct kimage *image);
   20.27 -+extern NORET_TYPE void xen_machine_kexec(struct kimage *image) ATTRIB_NORET;
   20.28 -+extern void xen_machine_kexec_setup_resources(void);
   20.29 -+extern void xen_machine_kexec_register_resources(struct resource *res);
   20.30 -+#endif
   20.31 - extern asmlinkage long sys_kexec_load(unsigned long entry,
   20.32 - 					unsigned long nr_segments,
   20.33 - 					struct kexec_segment __user *segments,
   20.34 ---- 0001/kernel/kexec.c
   20.35 -+++ work/kernel/kexec.c
   20.36 -@@ -403,7 +403,7 @@ static struct page *kimage_alloc_normal_
   20.37 - 		pages = kimage_alloc_pages(GFP_KERNEL, order);
   20.38 - 		if (!pages)
   20.39 - 			break;
   20.40 --		pfn   = page_to_pfn(pages);
   20.41 -+		pfn   = kexec_page_to_pfn(pages);
   20.42 - 		epfn  = pfn + count;
   20.43 - 		addr  = pfn << PAGE_SHIFT;
   20.44 - 		eaddr = epfn << PAGE_SHIFT;
   20.45 -@@ -437,6 +437,7 @@ static struct page *kimage_alloc_normal_
   20.46 - 	return pages;
   20.47 - }
   20.48 - 
   20.49 -+#ifndef CONFIG_XEN
   20.50 - static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
   20.51 - 						      unsigned int order)
   20.52 - {
   20.53 -@@ -490,7 +491,7 @@ static struct page *kimage_alloc_crash_c
   20.54 - 		}
   20.55 - 		/* If I don't overlap any segments I have found my hole! */
   20.56 - 		if (i == image->nr_segments) {
   20.57 --			pages = pfn_to_page(hole_start >> PAGE_SHIFT);
   20.58 -+			pages = kexec_pfn_to_page(hole_start >> PAGE_SHIFT);
   20.59 - 			break;
   20.60 - 		}
   20.61 - 	}
   20.62 -@@ -517,6 +518,13 @@ struct page *kimage_alloc_control_pages(
   20.63 - 
   20.64 - 	return pages;
   20.65 - }
   20.66 -+#else /* !CONFIG_XEN */
   20.67 -+struct page *kimage_alloc_control_pages(struct kimage *image,
   20.68 -+					 unsigned int order)
   20.69 -+{
   20.70 -+	return kimage_alloc_normal_control_pages(image, order);
   20.71 -+}
   20.72 -+#endif
   20.73 - 
   20.74 - static int kimage_add_entry(struct kimage *image, kimage_entry_t entry)
   20.75 - {
   20.76 -@@ -532,7 +540,7 @@ static int kimage_add_entry(struct kimag
   20.77 - 			return -ENOMEM;
   20.78 - 
   20.79 - 		ind_page = page_address(page);
   20.80 --		*image->entry = virt_to_phys(ind_page) | IND_INDIRECTION;
   20.81 -+		*image->entry = kexec_virt_to_phys(ind_page) | IND_INDIRECTION;
   20.82 - 		image->entry = ind_page;
   20.83 - 		image->last_entry = ind_page +
   20.84 - 				      ((PAGE_SIZE/sizeof(kimage_entry_t)) - 1);
   20.85 -@@ -593,13 +601,13 @@ static int kimage_terminate(struct kimag
   20.86 - #define for_each_kimage_entry(image, ptr, entry) \
   20.87 - 	for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); \
   20.88 - 		ptr = (entry & IND_INDIRECTION)? \
   20.89 --			phys_to_virt((entry & PAGE_MASK)): ptr +1)
   20.90 -+			kexec_phys_to_virt((entry & PAGE_MASK)): ptr +1)
   20.91 - 
   20.92 - static void kimage_free_entry(kimage_entry_t entry)
   20.93 - {
   20.94 - 	struct page *page;
   20.95 - 
   20.96 --	page = pfn_to_page(entry >> PAGE_SHIFT);
   20.97 -+	page = kexec_pfn_to_page(entry >> PAGE_SHIFT);
   20.98 - 	kimage_free_pages(page);
   20.99 - }
  20.100 - 
  20.101 -@@ -611,6 +619,10 @@ static void kimage_free(struct kimage *i
  20.102 - 	if (!image)
  20.103 - 		return;
  20.104 - 
  20.105 -+#ifdef CONFIG_XEN
  20.106 -+	xen_machine_kexec_unload(image);
  20.107 -+#endif
  20.108 -+
  20.109 - 	kimage_free_extra_pages(image);
  20.110 - 	for_each_kimage_entry(image, ptr, entry) {
  20.111 - 		if (entry & IND_INDIRECTION) {
  20.112 -@@ -686,7 +698,7 @@ static struct page *kimage_alloc_page(st
  20.113 - 	 * have a match.
  20.114 - 	 */
  20.115 - 	list_for_each_entry(page, &image->dest_pages, lru) {
  20.116 --		addr = page_to_pfn(page) << PAGE_SHIFT;
  20.117 -+		addr = kexec_page_to_pfn(page) << PAGE_SHIFT;
  20.118 - 		if (addr == destination) {
  20.119 - 			list_del(&page->lru);
  20.120 - 			return page;
  20.121 -@@ -701,12 +713,12 @@ static struct page *kimage_alloc_page(st
  20.122 - 		if (!page)
  20.123 - 			return NULL;
  20.124 - 		/* If the page cannot be used file it away */
  20.125 --		if (page_to_pfn(page) >
  20.126 -+		if (kexec_page_to_pfn(page) >
  20.127 - 				(KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
  20.128 - 			list_add(&page->lru, &image->unuseable_pages);
  20.129 - 			continue;
  20.130 - 		}
  20.131 --		addr = page_to_pfn(page) << PAGE_SHIFT;
  20.132 -+		addr = kexec_page_to_pfn(page) << PAGE_SHIFT;
  20.133 - 
  20.134 - 		/* If it is the destination page we want use it */
  20.135 - 		if (addr == destination)
  20.136 -@@ -729,7 +741,7 @@ static struct page *kimage_alloc_page(st
  20.137 - 			struct page *old_page;
  20.138 - 
  20.139 - 			old_addr = *old & PAGE_MASK;
  20.140 --			old_page = pfn_to_page(old_addr >> PAGE_SHIFT);
  20.141 -+			old_page = kexec_pfn_to_page(old_addr >> PAGE_SHIFT);
  20.142 - 			copy_highpage(page, old_page);
  20.143 - 			*old = addr | (*old & ~PAGE_MASK);
  20.144 - 
  20.145 -@@ -779,7 +791,7 @@ static int kimage_load_normal_segment(st
  20.146 - 			result  = -ENOMEM;
  20.147 - 			goto out;
  20.148 - 		}
  20.149 --		result = kimage_add_page(image, page_to_pfn(page)
  20.150 -+		result = kimage_add_page(image, kexec_page_to_pfn(page)
  20.151 - 								<< PAGE_SHIFT);
  20.152 - 		if (result < 0)
  20.153 - 			goto out;
  20.154 -@@ -811,6 +823,7 @@ out:
  20.155 - 	return result;
  20.156 - }
  20.157 - 
  20.158 -+#ifndef CONFIG_XEN
  20.159 - static int kimage_load_crash_segment(struct kimage *image,
  20.160 - 					struct kexec_segment *segment)
  20.161 - {
  20.162 -@@ -833,7 +846,7 @@ static int kimage_load_crash_segment(str
  20.163 - 		char *ptr;
  20.164 - 		size_t uchunk, mchunk;
  20.165 - 
  20.166 --		page = pfn_to_page(maddr >> PAGE_SHIFT);
  20.167 -+		page = kexec_pfn_to_page(maddr >> PAGE_SHIFT);
  20.168 - 		if (page == 0) {
  20.169 - 			result  = -ENOMEM;
  20.170 - 			goto out;
  20.171 -@@ -881,6 +894,13 @@ static int kimage_load_segment(struct ki
  20.172 - 
  20.173 - 	return result;
  20.174 - }
  20.175 -+#else /* CONFIG_XEN */
  20.176 -+static int kimage_load_segment(struct kimage *image,
  20.177 -+				struct kexec_segment *segment)
  20.178 -+{
  20.179 -+	return kimage_load_normal_segment(image, segment);
  20.180 -+}
  20.181 -+#endif
  20.182 - 
  20.183 - /*
  20.184 -  * Exec Kernel system call: for obvious reasons only root may call it.
  20.185 -@@ -991,6 +1011,11 @@ asmlinkage long sys_kexec_load(unsigned 
  20.186 - 		if (result)
  20.187 - 			goto out;
  20.188 - 	}
  20.189 -+#ifdef CONFIG_XEN
  20.190 -+	result = xen_machine_kexec_load(image);
  20.191 -+	if (result)
  20.192 -+		goto out;
  20.193 -+#endif
  20.194 - 	/* Install the new kernel, and  Uninstall the old */
  20.195 - 	image = xchg(dest_image, image);
  20.196 - 
  20.197 -@@ -1045,7 +1070,6 @@ void crash_kexec(struct pt_regs *regs)
  20.198 - 	struct kimage *image;
  20.199 - 	int locked;
  20.200 - 
  20.201 --
  20.202 - 	/* Take the kexec_lock here to prevent sys_kexec_load
  20.203 - 	 * running on one cpu from replacing the crash kernel
  20.204 - 	 * we are using after a panic on a different cpu.
  20.205 -@@ -1061,7 +1085,11 @@ void crash_kexec(struct pt_regs *regs)
  20.206 - 			struct pt_regs fixed_regs;
  20.207 - 			crash_setup_regs(&fixed_regs, regs);
  20.208 - 			machine_crash_shutdown(&fixed_regs);
  20.209 -+#ifdef CONFIG_XEN
  20.210 -+			xen_machine_kexec(image);
  20.211 -+#else
  20.212 - 			machine_kexec(image);
  20.213 -+#endif
  20.214 - 		}
  20.215 - 		xchg(&kexec_lock, 0);
  20.216 - 	}
  20.217 ---- 0002/kernel/sys.c
  20.218 -+++ work/kernel/sys.c
  20.219 -@@ -435,8 +435,12 @@ void kernel_kexec(void)
  20.220 - 	kernel_restart_prepare(NULL);
  20.221 - 	printk(KERN_EMERG "Starting new kernel\n");
  20.222 - 	machine_shutdown();
  20.223 -+#ifdef CONFIG_XEN
  20.224 -+	xen_machine_kexec(image);
  20.225 -+#else
  20.226 - 	machine_kexec(image);
  20.227 - #endif
  20.228 -+#endif
  20.229 - }
  20.230 - EXPORT_SYMBOL_GPL(kernel_kexec);
  20.231 - 
    21.1 --- a/patches/linux-2.6.16.33/linux-2.6.19-rc1-kexec-xen-i386.patch	Thu Dec 07 16:18:55 2006 -0700
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,108 +0,0 @@
    21.4 ---- 0001/arch/i386/kernel/crash.c
    21.5 -+++ work/arch/i386/kernel/crash.c
    21.6 -@@ -90,6 +90,7 @@ static void crash_save_self(struct pt_re
    21.7 - 	crash_save_this_cpu(regs, cpu);
    21.8 - }
    21.9 - 
   21.10 -+#ifndef CONFIG_XEN
   21.11 - #ifdef CONFIG_SMP
   21.12 - static atomic_t waiting_for_crash_ipi;
   21.13 - 
   21.14 -@@ -158,6 +159,7 @@ static void nmi_shootdown_cpus(void)
   21.15 - 	/* There are no cpus to shootdown */
   21.16 - }
   21.17 - #endif
   21.18 -+#endif /* CONFIG_XEN */
   21.19 - 
   21.20 - void machine_crash_shutdown(struct pt_regs *regs)
   21.21 - {
   21.22 -@@ -174,10 +176,12 @@ void machine_crash_shutdown(struct pt_re
   21.23 - 
   21.24 - 	/* Make a note of crashing cpu. Will be used in NMI callback.*/
   21.25 - 	crashing_cpu = smp_processor_id();
   21.26 -+#ifndef CONFIG_XEN
   21.27 - 	nmi_shootdown_cpus();
   21.28 - 	lapic_shutdown();
   21.29 - #if defined(CONFIG_X86_IO_APIC)
   21.30 - 	disable_IO_APIC();
   21.31 - #endif
   21.32 -+#endif /* CONFIG_XEN */
   21.33 - 	crash_save_self(regs);
   21.34 - }
   21.35 ---- 0007/arch/i386/kernel/machine_kexec.c
   21.36 -+++ work/arch/i386/kernel/machine_kexec.c
   21.37 -@@ -19,6 +19,10 @@
   21.38 - #include <asm/desc.h>
   21.39 - #include <asm/system.h>
   21.40 - 
   21.41 -+#ifdef CONFIG_XEN
   21.42 -+#include <xen/interface/kexec.h>
   21.43 -+#endif
   21.44 -+
   21.45 - #define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
   21.46 - static u32 kexec_pgd[1024] PAGE_ALIGNED;
   21.47 - #ifdef CONFIG_X86_PAE
   21.48 -@@ -28,6 +32,40 @@ static u32 kexec_pmd1[1024] PAGE_ALIGNED
   21.49 - static u32 kexec_pte0[1024] PAGE_ALIGNED;
   21.50 - static u32 kexec_pte1[1024] PAGE_ALIGNED;
   21.51 - 
   21.52 -+#ifdef CONFIG_XEN
   21.53 -+
   21.54 -+#define __ma(x) (pfn_to_mfn(__pa((x)) >> PAGE_SHIFT) << PAGE_SHIFT)
   21.55 -+
   21.56 -+#if PAGES_NR > KEXEC_XEN_NO_PAGES
   21.57 -+#error PAGES_NR is greater than KEXEC_XEN_NO_PAGES - Xen support will break
   21.58 -+#endif
   21.59 -+
   21.60 -+#if PA_CONTROL_PAGE != 0
   21.61 -+#error PA_CONTROL_PAGE is non zero - Xen support will break
   21.62 -+#endif
   21.63 -+
   21.64 -+void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, struct kimage *image)
   21.65 -+{
   21.66 -+	void *control_page;
   21.67 -+
   21.68 -+	memset(xki->page_list, 0, sizeof(xki->page_list));
   21.69 -+
   21.70 -+	control_page = page_address(image->control_code_page);
   21.71 -+	memcpy(control_page, relocate_kernel, PAGE_SIZE);
   21.72 -+
   21.73 -+	xki->page_list[PA_CONTROL_PAGE] = __ma(control_page);
   21.74 -+	xki->page_list[PA_PGD] = __ma(kexec_pgd);
   21.75 -+#ifdef CONFIG_X86_PAE
   21.76 -+	xki->page_list[PA_PMD_0] = __ma(kexec_pmd0);
   21.77 -+	xki->page_list[PA_PMD_1] = __ma(kexec_pmd1);
   21.78 -+#endif
   21.79 -+	xki->page_list[PA_PTE_0] = __ma(kexec_pte0);
   21.80 -+	xki->page_list[PA_PTE_1] = __ma(kexec_pte1);
   21.81 -+
   21.82 -+}
   21.83 -+
   21.84 -+#endif /* CONFIG_XEN */
   21.85 -+
   21.86 - /*
   21.87 -  * A architecture hook called to validate the
   21.88 -  * proposed image and prepare the control pages
   21.89 ---- 0006/include/asm-i386/kexec.h
   21.90 -+++ work/include/asm-i386/kexec.h
   21.91 -@@ -98,6 +98,20 @@ relocate_kernel(unsigned long indirectio
   21.92 - 		unsigned long start_address,
   21.93 - 		unsigned int has_pae) ATTRIB_NORET;
   21.94 - 
   21.95 -+
   21.96 -+/* Under Xen we need to work with machine addresses. These macros give the
   21.97 -+ * machine address of a certain page to the generic kexec code instead of 
   21.98 -+ * the pseudo physical address which would be given by the default macros.
   21.99 -+ */
  21.100 -+
  21.101 -+#ifdef CONFIG_XEN
  21.102 -+#define KEXEC_ARCH_HAS_PAGE_MACROS
  21.103 -+#define kexec_page_to_pfn(page)  pfn_to_mfn(page_to_pfn(page))
  21.104 -+#define kexec_pfn_to_page(pfn)   pfn_to_page(mfn_to_pfn(pfn))
  21.105 -+#define kexec_virt_to_phys(addr) virt_to_machine(addr)
  21.106 -+#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
  21.107 -+#endif
  21.108 -+
  21.109 - #endif /* __ASSEMBLY__ */
  21.110 - 
  21.111 - #endif /* _I386_KEXEC_H */
    22.1 --- a/patches/linux-2.6.16.33/linux-2.6.19-rc1-kexec-xen-x86_64.patch	Thu Dec 07 16:18:55 2006 -0700
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,219 +0,0 @@
    22.4 ---- 0001/arch/x86_64/kernel/crash.c
    22.5 -+++ work/arch/x86_64/kernel/crash.c
    22.6 -@@ -92,6 +92,7 @@ static void crash_save_self(struct pt_re
    22.7 - 	crash_save_this_cpu(regs, cpu);
    22.8 - }
    22.9 - 
   22.10 -+#ifndef CONFIG_XEN
   22.11 - #ifdef CONFIG_SMP
   22.12 - static atomic_t waiting_for_crash_ipi;
   22.13 - 
   22.14 -@@ -156,6 +157,7 @@ static void nmi_shootdown_cpus(void)
   22.15 - 	/* There are no cpus to shootdown */
   22.16 - }
   22.17 - #endif
   22.18 -+#endif /* CONFIG_XEN */
   22.19 - 
   22.20 - void machine_crash_shutdown(struct pt_regs *regs)
   22.21 - {
   22.22 -@@ -173,6 +175,8 @@ void machine_crash_shutdown(struct pt_re
   22.23 - 
   22.24 - 	/* Make a note of crashing cpu. Will be used in NMI callback.*/
   22.25 - 	crashing_cpu = smp_processor_id();
   22.26 -+
   22.27 -+#ifndef CONFIG_XEN
   22.28 - 	nmi_shootdown_cpus();
   22.29 - 
   22.30 - 	if(cpu_has_apic)
   22.31 -@@ -181,6 +185,6 @@ void machine_crash_shutdown(struct pt_re
   22.32 - #if defined(CONFIG_X86_IO_APIC)
   22.33 - 	disable_IO_APIC();
   22.34 - #endif
   22.35 --
   22.36 -+#endif /* CONFIG_XEN */
   22.37 - 	crash_save_self(regs);
   22.38 - }
   22.39 ---- 0010/arch/x86_64/kernel/machine_kexec.c
   22.40 -+++ work/arch/x86_64/kernel/machine_kexec.c
   22.41 -@@ -24,6 +24,104 @@ static u64 kexec_pud1[512] PAGE_ALIGNED;
   22.42 - static u64 kexec_pmd1[512] PAGE_ALIGNED;
   22.43 - static u64 kexec_pte1[512] PAGE_ALIGNED;
   22.44 - 
   22.45 -+#ifdef CONFIG_XEN
   22.46 -+
   22.47 -+/* In the case of Xen, override hypervisor functions to be able to create
   22.48 -+ * a regular identity mapping page table...
   22.49 -+ */
   22.50 -+
   22.51 -+#include <xen/interface/kexec.h>
   22.52 -+#include <xen/interface/memory.h>
   22.53 -+
   22.54 -+#define x__pmd(x) ((pmd_t) { (x) } )
   22.55 -+#define x__pud(x) ((pud_t) { (x) } )
   22.56 -+#define x__pgd(x) ((pgd_t) { (x) } )
   22.57 -+
   22.58 -+#define x_pmd_val(x)   ((x).pmd)
   22.59 -+#define x_pud_val(x)   ((x).pud)
   22.60 -+#define x_pgd_val(x)   ((x).pgd)
   22.61 -+
   22.62 -+static inline void x_set_pmd(pmd_t *dst, pmd_t val)
   22.63 -+{
   22.64 -+	x_pmd_val(*dst) = x_pmd_val(val);
   22.65 -+}
   22.66 -+
   22.67 -+static inline void x_set_pud(pud_t *dst, pud_t val)
   22.68 -+{
   22.69 -+	x_pud_val(*dst) = phys_to_machine(x_pud_val(val));
   22.70 -+}
   22.71 -+
   22.72 -+static inline void x_pud_clear (pud_t *pud)
   22.73 -+{
   22.74 -+	x_pud_val(*pud) = 0;
   22.75 -+}
   22.76 -+
   22.77 -+static inline void x_set_pgd(pgd_t *dst, pgd_t val)
   22.78 -+{
   22.79 -+	x_pgd_val(*dst) = phys_to_machine(x_pgd_val(val));
   22.80 -+}
   22.81 -+
   22.82 -+static inline void x_pgd_clear (pgd_t * pgd)
   22.83 -+{
   22.84 -+	x_pgd_val(*pgd) = 0;
   22.85 -+}
   22.86 -+
   22.87 -+#define X__PAGE_KERNEL_LARGE_EXEC \
   22.88 -+         _PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_PSE
   22.89 -+#define X_KERNPG_TABLE _PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY
   22.90 -+
   22.91 -+#define __ma(x) (pfn_to_mfn(__pa((x)) >> PAGE_SHIFT) << PAGE_SHIFT)
   22.92 -+
   22.93 -+#if PAGES_NR > KEXEC_XEN_NO_PAGES
   22.94 -+#error PAGES_NR is greater than KEXEC_XEN_NO_PAGES - Xen support will break
   22.95 -+#endif
   22.96 -+
   22.97 -+#if PA_CONTROL_PAGE != 0
   22.98 -+#error PA_CONTROL_PAGE is non zero - Xen support will break
   22.99 -+#endif
  22.100 -+
  22.101 -+void machine_kexec_setup_load_arg(xen_kexec_image_t *xki, struct kimage *image)
  22.102 -+{
  22.103 -+	void *control_page;
  22.104 -+	void *table_page;
  22.105 -+
  22.106 -+	memset(xki->page_list, 0, sizeof(xki->page_list));
  22.107 -+
  22.108 -+	control_page = page_address(image->control_code_page) + PAGE_SIZE;
  22.109 -+	memcpy(control_page, relocate_kernel, PAGE_SIZE);
  22.110 -+
  22.111 -+	table_page = page_address(image->control_code_page);
  22.112 -+
  22.113 -+	xki->page_list[PA_CONTROL_PAGE] = __ma(control_page);
  22.114 -+	xki->page_list[PA_TABLE_PAGE] = __ma(table_page);
  22.115 -+
  22.116 -+	xki->page_list[PA_PGD] = __ma(kexec_pgd);
  22.117 -+	xki->page_list[PA_PUD_0] = __ma(kexec_pud0);
  22.118 -+	xki->page_list[PA_PUD_1] = __ma(kexec_pud1);
  22.119 -+	xki->page_list[PA_PMD_0] = __ma(kexec_pmd0);
  22.120 -+	xki->page_list[PA_PMD_1] = __ma(kexec_pmd1);
  22.121 -+	xki->page_list[PA_PTE_0] = __ma(kexec_pte0);
  22.122 -+	xki->page_list[PA_PTE_1] = __ma(kexec_pte1);
  22.123 -+}
  22.124 -+
  22.125 -+#else /* CONFIG_XEN */
  22.126 -+
  22.127 -+#define x__pmd(x) __pmd(x)
  22.128 -+#define x__pud(x) __pud(x)
  22.129 -+#define x__pgd(x) __pgd(x)
  22.130 -+
  22.131 -+#define x_set_pmd(x, y) set_pmd(x, y)
  22.132 -+#define x_set_pud(x, y) set_pud(x, y)
  22.133 -+#define x_set_pgd(x, y) set_pgd(x, y)
  22.134 -+
  22.135 -+#define x_pud_clear(x) pud_clear(x)
  22.136 -+#define x_pgd_clear(x) pgd_clear(x)
  22.137 -+
  22.138 -+#define X__PAGE_KERNEL_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
  22.139 -+#define X_KERNPG_TABLE _KERNPG_TABLE
  22.140 -+
  22.141 -+#endif /* CONFIG_XEN */
  22.142 -+
  22.143 - static void init_level2_page(pmd_t *level2p, unsigned long addr)
  22.144 - {
  22.145 - 	unsigned long end_addr;
  22.146 -@@ -31,7 +129,7 @@ static void init_level2_page(pmd_t *leve
  22.147 - 	addr &= PAGE_MASK;
  22.148 - 	end_addr = addr + PUD_SIZE;
  22.149 - 	while (addr < end_addr) {
  22.150 --		set_pmd(level2p++, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC));
  22.151 -+		x_set_pmd(level2p++, x__pmd(addr | X__PAGE_KERNEL_LARGE_EXEC));
  22.152 - 		addr += PMD_SIZE;
  22.153 - 	}
  22.154 - }
  22.155 -@@ -56,12 +154,12 @@ static int init_level3_page(struct kimag
  22.156 - 		}
  22.157 - 		level2p = (pmd_t *)page_address(page);
  22.158 - 		init_level2_page(level2p, addr);
  22.159 --		set_pud(level3p++, __pud(__pa(level2p) | _KERNPG_TABLE));
  22.160 -+		x_set_pud(level3p++, x__pud(__pa(level2p) | X_KERNPG_TABLE));
  22.161 - 		addr += PUD_SIZE;
  22.162 - 	}
  22.163 - 	/* clear the unused entries */
  22.164 - 	while (addr < end_addr) {
  22.165 --		pud_clear(level3p++);
  22.166 -+		x_pud_clear(level3p++);
  22.167 - 		addr += PUD_SIZE;
  22.168 - 	}
  22.169 - out:
  22.170 -@@ -92,12 +190,12 @@ static int init_level4_page(struct kimag
  22.171 - 		if (result) {
  22.172 - 			goto out;
  22.173 - 		}
  22.174 --		set_pgd(level4p++, __pgd(__pa(level3p) | _KERNPG_TABLE));
  22.175 -+		x_set_pgd(level4p++, x__pgd(__pa(level3p) | X_KERNPG_TABLE));
  22.176 - 		addr += PGDIR_SIZE;
  22.177 - 	}
  22.178 - 	/* clear the unused entries */
  22.179 - 	while (addr < end_addr) {
  22.180 --		pgd_clear(level4p++);
  22.181 -+		x_pgd_clear(level4p++);
  22.182 - 		addr += PGDIR_SIZE;
  22.183 - 	}
  22.184 - out:
  22.185 -@@ -108,8 +206,14 @@ out:
  22.186 - static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
  22.187 - {
  22.188 - 	pgd_t *level4p;
  22.189 -+	unsigned long x_end_pfn = end_pfn;
  22.190 -+
  22.191 -+#ifdef CONFIG_XEN
  22.192 -+	x_end_pfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
  22.193 -+#endif
  22.194 -+
  22.195 - 	level4p = (pgd_t *)__va(start_pgtable);
  22.196 -- 	return init_level4_page(image, level4p, 0, end_pfn << PAGE_SHIFT);
  22.197 -+ 	return init_level4_page(image, level4p, 0, x_end_pfn << PAGE_SHIFT);
  22.198 - }
  22.199 - 
  22.200 - int machine_kexec_prepare(struct kimage *image)
  22.201 ---- 0009/include/asm-x86_64/kexec.h
  22.202 -+++ work/include/asm-x86_64/kexec.h
  22.203 -@@ -91,6 +91,19 @@ relocate_kernel(unsigned long indirectio
  22.204 - 		unsigned long page_list,
  22.205 - 		unsigned long start_address) ATTRIB_NORET;
  22.206 - 
  22.207 -+/* Under Xen we need to work with machine addresses. These macros give the
  22.208 -+ * machine address of a certain page to the generic kexec code instead of 
  22.209 -+ * the pseudo physical address which would be given by the default macros.
  22.210 -+ */
  22.211 -+
  22.212 -+#ifdef CONFIG_XEN
  22.213 -+#define KEXEC_ARCH_HAS_PAGE_MACROS
  22.214 -+#define kexec_page_to_pfn(page)  pfn_to_mfn(page_to_pfn(page))
  22.215 -+#define kexec_pfn_to_page(pfn)   pfn_to_page(mfn_to_pfn(pfn))
  22.216 -+#define kexec_virt_to_phys(addr) virt_to_machine(addr)
  22.217 -+#define kexec_phys_to_virt(addr) phys_to_virt(machine_to_phys(addr))
  22.218 -+#endif
  22.219 -+
  22.220 - #endif /* __ASSEMBLY__ */
  22.221 - 
  22.222 - #endif /* _X86_64_KEXEC_H */
    23.1 --- a/patches/linux-2.6.16.33/series	Thu Dec 07 16:18:55 2006 -0700
    23.2 +++ b/patches/linux-2.6.16.33/series	Fri Dec 08 09:09:18 2006 -0700
    23.3 @@ -1,12 +1,9 @@
    23.4 -kexec-generic.patch
    23.5  git-2efe55a9cec8418f0e0cde3dc3787a42fddc4411.patch
    23.6  git-2a8a3d5b65e86ec1dfef7d268c64a909eab94af7.patch
    23.7  git-3566561bfadffcb5dbc85d576be80c0dbf2cccc9.patch
    23.8  linux-2.6.19-rc1-kexec-move_segment_code-i386.patch
    23.9 -linux-2.6.19-rc1-kexec-xen-i386.patch
   23.10  git-4bfaaef01a1badb9e8ffb0c0a37cd2379008d21f.patch
   23.11  linux-2.6.19-rc1-kexec-move_segment_code-x86_64.patch
   23.12 -linux-2.6.19-rc1-kexec-xen-x86_64.patch
   23.13  blktap-aio-16_03_06.patch
   23.14  device_bind.patch
   23.15  fix-hz-suspend.patch
    24.1 --- a/tools/examples/init.d/xendomains	Thu Dec 07 16:18:55 2006 -0700
    24.2 +++ b/tools/examples/init.d/xendomains	Fri Dec 08 09:09:18 2006 -0700
    24.3 @@ -204,12 +204,14 @@ start()
    24.4  	return; 
    24.5      fi
    24.6  
    24.7 +    saved_domains=" "
    24.8      if [ "$XENDOMAINS_RESTORE" = "true" ] &&
    24.9         contains_something "$XENDOMAINS_SAVE"
   24.10      then
   24.11          mkdir -p $(dirname "$LOCKFILE")
   24.12  	touch $LOCKFILE
   24.13  	echo -n "Restoring Xen domains:"
   24.14 +	saved_domains=`ls $XENDOMAINS_SAVE`
   24.15  	for dom in $XENDOMAINS_SAVE/*; do
   24.16  	    echo -n " ${dom##*/}"
   24.17  	    xm restore $dom
   24.18 @@ -234,9 +236,14 @@ start()
   24.19  	# Create all domains with config files in XENDOMAINS_AUTO.
   24.20  	# TODO: We should record which domain name belongs 
   24.21  	# so we have the option to selectively shut down / migrate later
   24.22 +	# If a domain statefile from $XENDOMAINS_SAVE matches a domain name
   24.23 +	# in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't 
   24.24 +	# restore correctly it requires administrative attention.
   24.25  	for dom in $XENDOMAINS_AUTO/*; do
   24.26  	    echo -n " ${dom##*/}"
   24.27 -	    if is_running $dom; then
   24.28 +	    shortdom=$(echo $dom | sed -n 's/^.*\/\(.*\)$/\1/p')
   24.29 +	    echo $saved_domains | grep -w $shortdom > /dev/null
   24.30 +	    if [ $? -eq 0 ] || is_running $dom; then
   24.31  		echo -n "(skip)"
   24.32  	    else
   24.33  		xm create --quiet --defconfig $dom
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/tools/examples/xm-config.xml	Fri Dec 08 09:09:18 2006 -0700
    25.3 @@ -0,0 +1,43 @@
    25.4 +<!--
    25.5 +
    25.6 +Copyright (C) 2006 XenSource Inc.
    25.7 +
    25.8 +This library is free software; you can redistribute it and/or
    25.9 +modify it under the terms of version 2.1 of the GNU Lesser General Public
   25.10 +License as published by the Free Software Foundation.
   25.11 +
   25.12 +This library is distributed in the hope that it will be useful,
   25.13 +but WITHOUT ANY WARRANTY; without even the implied warranty of
   25.14 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   25.15 +Lesser General Public License for more details.
   25.16 +
   25.17 +You should have received a copy of the GNU Lesser General Public
   25.18 +License along with this library; if not, write to the Free Software
   25.19 +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   25.20 +
   25.21 +-->
   25.22 +
   25.23 +<!--
   25.24 +
   25.25 +This is a configuration file for xm; it should be placed in
   25.26 +/etc/xen/xm-config.xml.  If this file is missing, then xm will fall back to
   25.27 +the normal behaviour that's in Xen 3.0.4 and below.  The settings here are
   25.28 +most useful for experimenting with the Xen-API preview in Xen 3.0.4.
   25.29 +
   25.30 +-->
   25.31 +
   25.32 +<xm>
   25.33 +  <!-- The server element describes how to talk to Xend.  The type may be 
   25.34 +       Xen-API or LegacyXMLRPC (the default).  The URI is that of the
   25.35 +       server; you might try http://server:9363/ or
   25.36 +       httpu:///var/run/xend/xen-api.sock for the Xen-API, or
   25.37 +       httpu:///var/run/xend/xmlrpc.sock for the legacy server.
   25.38 +
   25.39 +       The username and password attributes will be used to log in if Xen-API
   25.40 +       is being used.
   25.41 +    -->
   25.42 +  <server type='Xen-API'
   25.43 +          uri='http://localhost:9363/'
   25.44 +          username='me'
   25.45 +          password='mypassword' />
   25.46 +</xm>
    26.1 --- a/tools/firmware/vmxassist/head.S	Thu Dec 07 16:18:55 2006 -0700
    26.2 +++ b/tools/firmware/vmxassist/head.S	Fri Dec 08 09:09:18 2006 -0700
    26.3 @@ -130,7 +130,7 @@ 1:
    26.4  	clts
    26.5  
    26.6  	/* setup my own stack */
    26.7 -	movl	$stack_top - 4*4, %esp
    26.8 +	movl	$stack_top, %esp
    26.9  	movl	%esp, %ebp
   26.10  
   26.11  	/* go ... */
    27.1 --- a/tools/firmware/vmxassist/setup.c	Thu Dec 07 16:18:55 2006 -0700
    27.2 +++ b/tools/firmware/vmxassist/setup.c	Fri Dec 08 09:09:18 2006 -0700
    27.3 @@ -125,7 +125,7 @@ setup_gdt(void)
    27.4  	/* setup task state segment */
    27.5  	memset(&tss, 0, sizeof(tss));
    27.6  	tss.ss0 = DATA_SELECTOR;
    27.7 -	tss.esp0 = (unsigned) stack_top - 4*4;
    27.8 +	tss.esp0 = (unsigned) stack_top;
    27.9  	tss.iomap_base = offsetof(struct tss, iomap);
   27.10  
   27.11  	/* initialize gdt's tss selector */
   27.12 @@ -258,7 +258,7 @@ setup_ctx(void)
   27.13  
   27.14  	memset(c, 0, sizeof(*c));
   27.15  	c->eip = (unsigned long) switch_to_real_mode;
   27.16 -	c->esp = (unsigned) stack_top - 4*4;
   27.17 +	c->esp = (unsigned) stack_top;
   27.18  	c->eflags = 0x2; /* no interrupts, please */
   27.19  
   27.20  	/*
    28.1 --- a/tools/firmware/vmxassist/vm86.c	Thu Dec 07 16:18:55 2006 -0700
    28.2 +++ b/tools/firmware/vmxassist/vm86.c	Fri Dec 08 09:09:18 2006 -0700
    28.3 @@ -1,6 +1,6 @@
    28.4  /*
    28.5   * vm86.c: A vm86 emulator. The main purpose of this emulator is to do as
    28.6 - * little work as possible. 
    28.7 + * little work as possible.
    28.8   *
    28.9   * Leendert van Doorn, leendert@watson.ibm.com
   28.10   * Copyright (c) 2005-2006, International Business Machines Corporation.
   28.11 @@ -52,8 +52,8 @@ char *states[] = {
   28.12  static char *rnames[] = { "ax", "cx", "dx", "bx", "sp", "bp", "si", "di" };
   28.13  #endif /* DEBUG */
   28.14  
   28.15 -#define PDE_PS           (1 << 7)
   28.16 -#define PT_ENTRY_PRESENT 0x1
   28.17 +#define PDE_PS				(1 << 7)
   28.18 +#define PT_ENTRY_PRESENT	0x1
   28.19  
   28.20  /* We only support access to <=4G physical memory due to 1:1 mapping */
   28.21  static uint64_t
   28.22 @@ -136,7 +136,7 @@ address(struct regs *regs, unsigned seg,
   28.23  	}
   28.24  
   28.25  	if (mode == VM86_REAL || seg > oldctx.gdtr_limit ||
   28.26 -	    (mode == VM86_REAL_TO_PROTECTED && regs->cs == seg))
   28.27 +		(mode == VM86_REAL_TO_PROTECTED && regs->cs == seg))
   28.28  		return ((seg & 0xFFFF) << 4) + off;
   28.29  
   28.30  	gdt_phys_base = guest_linear_to_phys(oldctx.gdtr_base);
   28.31 @@ -153,13 +153,13 @@ address(struct regs *regs, unsigned seg,
   28.32  	seg_limit = (entry_high & 0xF0000) | (entry_low & 0xFFFF);
   28.33  
   28.34  	if (entry_high & 0x8000 &&
   28.35 -	    ((entry_high & 0x800000 && off >> 12 <= seg_limit) ||
   28.36 -	    (!(entry_high & 0x800000) && off <= seg_limit)))
   28.37 +		((entry_high & 0x800000 && off >> 12 <= seg_limit) ||
   28.38 +		(!(entry_high & 0x800000) && off <= seg_limit)))
   28.39  		return seg_base + off;
   28.40  
   28.41  	panic("should never reach here in function address():\n\t"
   28.42 -	      "entry=0x%08x%08x, mode=%d, seg=0x%08x, offset=0x%08x\n",
   28.43 -	      entry_high, entry_low, mode, seg, off);
   28.44 +		  "entry=0x%08x%08x, mode=%d, seg=0x%08x, offset=0x%08x\n",
   28.45 +		  entry_high, entry_low, mode, seg, off);
   28.46  
   28.47  	return 0;
   28.48  }
   28.49 @@ -172,7 +172,7 @@ trace(struct regs *regs, int adjust, cha
   28.50  	va_list ap;
   28.51  
   28.52  	if ((traceset & (1 << mode)) &&
   28.53 -	   (mode == VM86_REAL_TO_PROTECTED || mode == VM86_REAL)) {
   28.54 +		(mode == VM86_REAL_TO_PROTECTED || mode == VM86_REAL)) {
   28.55  		/* 16-bit, seg:off addressing */
   28.56  		unsigned addr = address(regs, regs->cs, off);
   28.57  		printf("0x%08x: 0x%x:0x%04x ", addr, regs->cs, off);
   28.58 @@ -183,7 +183,7 @@ trace(struct regs *regs, int adjust, cha
   28.59  		printf("\n");
   28.60  	}
   28.61  	if ((traceset & (1 << mode)) &&
   28.62 -	   (mode == VM86_PROTECTED_TO_REAL || mode == VM86_PROTECTED)) {
   28.63 +		(mode == VM86_PROTECTED_TO_REAL || mode == VM86_PROTECTED)) {
   28.64  		/* 16-bit, gdt addressing */
   28.65  		unsigned addr = address(regs, regs->cs, off);
   28.66  		printf("0x%08x: 0x%x:0x%08x ", addr, regs->cs, off);
   28.67 @@ -430,7 +430,7 @@ operand(unsigned prefix, struct regs *re
   28.68  			case 2: return address(regs, seg, regs->edx);
   28.69  			case 3: return address(regs, seg, regs->ebx);
   28.70  			case 4: return address(regs, seg,
   28.71 -					       sib(regs, mod, fetch8(regs)));
   28.72 +						   sib(regs, mod, fetch8(regs)));
   28.73  			case 5: return address(regs, seg, fetch32(regs));
   28.74  			case 6: return address(regs, seg, regs->esi);
   28.75  			case 7: return address(regs, seg, regs->edi);
   28.76 @@ -450,7 +450,7 @@ operand(unsigned prefix, struct regs *re
   28.77  			case 2: return address(regs, seg, regs->edx + disp);
   28.78  			case 3: return address(regs, seg, regs->ebx + disp);
   28.79  			case 4: return address(regs, seg,
   28.80 -					       sib(regs, mod, fetch8(regs)));
   28.81 +						   sib(regs, mod, fetch8(regs)));
   28.82  			case 5: return address(regs, seg, regs->ebp + disp);
   28.83  			case 6: return address(regs, seg, regs->esi + disp);
   28.84  			case 7: return address(regs, seg, regs->edi + disp);
   28.85 @@ -507,7 +507,7 @@ operand(unsigned prefix, struct regs *re
   28.86  		}
   28.87  	}
   28.88  
   28.89 -	return 0; 
   28.90 +	return 0;
   28.91  }
   28.92  
   28.93  /*
   28.94 @@ -859,7 +859,7 @@ mov_to_seg(struct regs *regs, unsigned p
   28.95  
   28.96   fail:
   28.97  	printf("%s:%d: missed opcode %02x %02x\n",
   28.98 -	       __FUNCTION__, __LINE__, opc, modrm);
   28.99 +		   __FUNCTION__, __LINE__, opc, modrm);
  28.100  	return 0;
  28.101  }
  28.102  
  28.103 @@ -896,11 +896,11 @@ load_seg(unsigned long sel, uint32_t *ba
  28.104  		  ((entry >> (32-16)) & 0x00FF0000) |
  28.105  		  ((entry >> (   16)) & 0x0000FFFF));
  28.106  	*limit = (((entry >> (48-16)) & 0x000F0000) |
  28.107 -		  ((entry           ) & 0x0000FFFF));
  28.108 +		  (entry & 0x0000FFFF));
  28.109  
  28.110  	arbytes->bytes = 0;
  28.111  	arbytes->fields.seg_type = (entry >> (8+32)) & 0xF; /* TYPE */
  28.112 -	arbytes->fields.s =  (entry >> (12+32)) & 0x1; /* S */
  28.113 +	arbytes->fields.s = (entry >> (12+32)) & 0x1; /* S */
  28.114  	if (arbytes->fields.s)
  28.115  		arbytes->fields.seg_type |= 1; /* accessed */
  28.116  	arbytes->fields.dpl = (entry >> (13+32)) & 0x3; /* DPL */
  28.117 @@ -924,7 +924,7 @@ static void
  28.118  load_or_clear_seg(unsigned long sel, uint32_t *base, uint32_t *limit, union vmcs_arbytes *arbytes)
  28.119  {
  28.120  	if (!load_seg(sel, base, limit, arbytes))
  28.121 -		load_seg(0, base, limit, arbytes);	    
  28.122 +		load_seg(0, base, limit, arbytes);
  28.123  }
  28.124  
  28.125  
  28.126 @@ -988,21 +988,21 @@ real_mode(struct regs *regs)
  28.127  			panic("%%ss 0x%lx higher than 1MB", regs->uss);
  28.128  		regs->uss = address(regs, regs->uss, 0) >> 4;
  28.129  	} else {
  28.130 -	  regs->uss = saved_rm_regs.uss;
  28.131 +		regs->uss = saved_rm_regs.uss;
  28.132  	}
  28.133  	if (regs->vds != 0) {
  28.134  		if (regs->vds >= HIGHMEM)
  28.135  			panic("%%ds 0x%lx higher than 1MB", regs->vds);
  28.136  		regs->vds = address(regs, regs->vds, 0) >> 4;
  28.137  	} else {
  28.138 -	  regs->vds = saved_rm_regs.vds;
  28.139 +		regs->vds = saved_rm_regs.vds;
  28.140  	}
  28.141  	if (regs->ves != 0) {
  28.142  		if (regs->ves >= HIGHMEM)
  28.143  			panic("%%es 0x%lx higher than 1MB", regs->ves);
  28.144  		regs->ves = address(regs, regs->ves, 0) >> 4;
  28.145  	} else {
  28.146 -	  regs->ves = saved_rm_regs.ves;
  28.147 +		regs->ves = saved_rm_regs.ves;
  28.148  	}
  28.149  
  28.150  	/* this should get us into 16-bit mode */
  28.151 @@ -1029,10 +1029,7 @@ set_mode(struct regs *regs, enum vm86_mo
  28.152  		    (mode == VM86_REAL_TO_PROTECTED)) {
  28.153  			regs->eflags &= ~EFLAGS_TF;
  28.154  			real_mode(regs);
  28.155 -			break;
  28.156 -		} else if (mode == VM86_REAL) {
  28.157 -			break;
  28.158 -		} else
  28.159 +		} else if (mode != VM86_REAL)
  28.160  			panic("unexpected real mode transition");
  28.161  		break;
  28.162  
  28.163 @@ -1049,25 +1046,19 @@ set_mode(struct regs *regs, enum vm86_mo
  28.164  			oldctx.fs_sel = 0;
  28.165  			oldctx.gs_sel = 0;
  28.166  			oldctx.ss_sel = 0;
  28.167 -			break;
  28.168 -		} else if (mode == VM86_REAL_TO_PROTECTED) {
  28.169 -			break;
  28.170 -		} else
  28.171 +		} else if (mode != VM86_REAL_TO_PROTECTED)
  28.172  			panic("unexpected real-to-protected mode transition");
  28.173  		break;
  28.174  
  28.175  	case VM86_PROTECTED_TO_REAL:
  28.176 -		if (mode == VM86_PROTECTED) {
  28.177 -			break;
  28.178 -		} else
  28.179 +		if (mode != VM86_PROTECTED)
  28.180  			panic("unexpected protected-to-real mode transition");
  28.181  		break;
  28.182  
  28.183  	case VM86_PROTECTED:
  28.184 -		if (mode == VM86_REAL_TO_PROTECTED) {
  28.185 -			protected_mode(regs);
  28.186 -		} else
  28.187 +		if (mode != VM86_REAL_TO_PROTECTED)
  28.188  			panic("unexpected protected mode transition");
  28.189 +		protected_mode(regs);
  28.190  		break;
  28.191  	}
  28.192  
  28.193 @@ -1081,25 +1072,19 @@ jmpl(struct regs *regs, int prefix)
  28.194  	unsigned n = regs->eip;
  28.195  	unsigned cs, eip;
  28.196  
  28.197 -	if (mode == VM86_REAL_TO_PROTECTED) { /* jump to protected mode */
  28.198 -		eip = (prefix & DATA32) ? fetch32(regs) : fetch16(regs);
  28.199 -		cs = fetch16(regs);
  28.200 +	eip = (prefix & DATA32) ? fetch32(regs) : fetch16(regs);
  28.201 +	cs = fetch16(regs);
  28.202 +
  28.203 +	TRACE((regs, (regs->eip - n) + 1, "jmpl 0x%x:0x%x", cs, eip));
  28.204  
  28.205 -		TRACE((regs, (regs->eip - n) + 1, "jmpl 0x%x:0x%x", cs, eip));
  28.206 +	regs->cs = cs;
  28.207 +	regs->eip = eip;
  28.208  
  28.209 -                regs->cs = cs;
  28.210 -                regs->eip = eip;
  28.211 +	if (mode == VM86_REAL_TO_PROTECTED)		/* jump to protected mode */
  28.212  		set_mode(regs, VM86_PROTECTED);
  28.213 -	} else if (mode == VM86_PROTECTED_TO_REAL) { /* jump to real mode */
  28.214 -		eip = (prefix & DATA32) ? fetch32(regs) : fetch16(regs);
  28.215 -		cs = fetch16(regs);
  28.216 -
  28.217 -		TRACE((regs, (regs->eip - n) + 1, "jmpl 0x%x:0x%x", cs, eip));
  28.218 -
  28.219 -                regs->cs = cs;
  28.220 -                regs->eip = eip;
  28.221 +	else if (mode == VM86_PROTECTED_TO_REAL)/* jump to real mode */
  28.222  		set_mode(regs, VM86_REAL);
  28.223 -	} else
  28.224 +	else
  28.225  		panic("jmpl");
  28.226  }
  28.227  
  28.228 @@ -1110,29 +1095,22 @@ jmpl_indirect(struct regs *regs, int pre
  28.229  	unsigned cs, eip;
  28.230  	unsigned addr;
  28.231  
  28.232 -	addr  = operand(prefix, regs, modrm);
  28.233 +	addr = operand(prefix, regs, modrm);
  28.234 +
  28.235 +	eip = (prefix & DATA32) ? read32(addr) : read16(addr);
  28.236 +	addr += (prefix & DATA32) ? 4 : 2;
  28.237 +	cs = read16(addr);
  28.238  
  28.239 -	if (mode == VM86_REAL_TO_PROTECTED) { /* jump to protected mode */
  28.240 -		eip = (prefix & DATA32) ? read32(addr) : read16(addr);
  28.241 -		addr += (prefix & DATA32) ? 4 : 2;
  28.242 -		cs = read16(addr);
  28.243 +	TRACE((regs, (regs->eip - n) + 1, "jmpl 0x%x:0x%x", cs, eip));
  28.244  
  28.245 -		TRACE((regs, (regs->eip - n) + 1, "jmpl 0x%x:0x%x", cs, eip));
  28.246 +	regs->cs = cs;
  28.247 +	regs->eip = eip;
  28.248  
  28.249 -                regs->cs = cs;
  28.250 -                regs->eip = eip;
  28.251 +	if (mode == VM86_REAL_TO_PROTECTED)		/* jump to protected mode */
  28.252  		set_mode(regs, VM86_PROTECTED);
  28.253 -	} else if (mode == VM86_PROTECTED_TO_REAL) { /* jump to real mode */
  28.254 -		eip = (prefix & DATA32) ? read32(addr) : read16(addr);
  28.255 -		addr += (prefix & DATA32) ? 4 : 2;
  28.256 -		cs = read16(addr);
  28.257 -
  28.258 -		TRACE((regs, (regs->eip - n) + 1, "jmpl 0x%x:0x%x", cs, eip));
  28.259 -
  28.260 -                regs->cs = cs;
  28.261 -                regs->eip = eip;
  28.262 +	else if (mode == VM86_PROTECTED_TO_REAL)/* jump to real mode */
  28.263  		set_mode(regs, VM86_REAL);
  28.264 -	} else
  28.265 +	else
  28.266  		panic("jmpl");
  28.267  }
  28.268  
  28.269 @@ -1151,15 +1129,14 @@ retl(struct regs *regs, int prefix)
  28.270  
  28.271  	TRACE((regs, 1, "retl (to 0x%x:0x%x)", cs, eip));
  28.272  
  28.273 -	if (mode == VM86_REAL_TO_PROTECTED) { /* jump to protected mode */
  28.274 -                regs->cs = cs;
  28.275 -                regs->eip = eip;
  28.276 +	regs->cs = cs;
  28.277 +	regs->eip = eip;
  28.278 +
  28.279 +	if (mode == VM86_REAL_TO_PROTECTED)		/* jump to protected mode */
  28.280  		set_mode(regs, VM86_PROTECTED);
  28.281 -	} else if (mode == VM86_PROTECTED_TO_REAL) { /* jump to real mode */
  28.282 -                regs->cs = cs;
  28.283 -                regs->eip = eip;
  28.284 +	else if (mode == VM86_PROTECTED_TO_REAL)/* jump to real mode */
  28.285  		set_mode(regs, VM86_REAL);
  28.286 -	} else
  28.287 +	else
  28.288  		panic("retl");
  28.289  }
  28.290  
  28.291 @@ -1259,8 +1236,8 @@ pushrm(struct regs *regs, int prefix, un
  28.292  	unsigned addr;
  28.293  	unsigned data;
  28.294  
  28.295 -	addr  = operand(prefix, regs, modrm);
  28.296 -	
  28.297 +	addr = operand(prefix, regs, modrm);
  28.298 +
  28.299  	if (prefix & DATA32) {
  28.300  		data = read32(addr);
  28.301  		push32(regs, data);
  28.302 @@ -1386,11 +1363,11 @@ opcode(struct regs *regs)
  28.303  		case 0x3B: /* addr32 cmp r/m16, r16 */
  28.304  			if (mode != VM86_REAL && mode != VM86_REAL_TO_PROTECTED)
  28.305  				goto invalid;
  28.306 -                        if ((prefix & ADDR32) == 0)
  28.307 -                                goto invalid;
  28.308 -                        if (!cmp(regs, prefix, opc))
  28.309 -                                goto invalid;
  28.310 -                        return OPC_EMULATED;
  28.311 +			if ((prefix & ADDR32) == 0)
  28.312 +				goto invalid;
  28.313 +			if (!cmp(regs, prefix, opc))
  28.314 +				goto invalid;
  28.315 +			return OPC_EMULATED;
  28.316  
  28.317  		case 0x3E:
  28.318  			TRACE((regs, regs->eip - eip, "%%ds:"));
  28.319 @@ -1412,7 +1389,7 @@ opcode(struct regs *regs)
  28.320  			prefix |= DATA32;
  28.321  			continue;
  28.322  
  28.323 -		case 0x67: 
  28.324 +		case 0x67:
  28.325  			TRACE((regs, regs->eip - eip, "addr32"));
  28.326  			prefix |= ADDR32;
  28.327  			continue;
  28.328 @@ -1421,18 +1398,18 @@ opcode(struct regs *regs)
  28.329  		case 0x8A: /* addr32 mov r/m8, r8 */
  28.330  			if (mode != VM86_REAL && mode != VM86_REAL_TO_PROTECTED)
  28.331  				goto invalid;
  28.332 -                        if ((prefix & ADDR32) == 0)
  28.333 -                                goto invalid;
  28.334 -                        if (!movr(regs, prefix, opc))
  28.335 -                                goto invalid;
  28.336 -                        return OPC_EMULATED;
  28.337 +			if ((prefix & ADDR32) == 0)
  28.338 +				goto invalid;
  28.339 +			if (!movr(regs, prefix, opc))
  28.340 +				goto invalid;
  28.341 +			return OPC_EMULATED;
  28.342  
  28.343  		case 0x89: /* addr32 mov r16, r/m16 */
  28.344  			if (mode == VM86_PROTECTED_TO_REAL) {
  28.345  				unsigned modrm = fetch8(regs);
  28.346  				unsigned addr = operand(prefix, regs, modrm);
  28.347  				unsigned val, r = (modrm >> 3) & 7;
  28.348 -				
  28.349 +
  28.350  				if (prefix & DATA32) {
  28.351  					val = getreg16(regs, r);
  28.352  					write32(addr, val);
  28.353 @@ -1447,11 +1424,11 @@ opcode(struct regs *regs)
  28.354  		case 0x8B: /* addr32 mov r/m16, r16 */
  28.355  			if (mode != VM86_REAL && mode != VM86_REAL_TO_PROTECTED)
  28.356  				goto invalid;
  28.357 -                        if ((prefix & ADDR32) == 0)
  28.358 -                                goto invalid;
  28.359 -                        if (!movr(regs, prefix, opc))
  28.360 -                                goto invalid;
  28.361 -                        return OPC_EMULATED;
  28.362 +			if ((prefix & ADDR32) == 0)
  28.363 +				goto invalid;
  28.364 +			if (!movr(regs, prefix, opc))
  28.365 +				goto invalid;
  28.366 +			return OPC_EMULATED;
  28.367  
  28.368  		case 0x8E: /* mov r16, sreg */
  28.369  			if (!mov_to_seg(regs, prefix, opc))
  28.370 @@ -1459,11 +1436,11 @@ opcode(struct regs *regs)
  28.371  			return OPC_EMULATED;
  28.372  
  28.373  		case 0x8F: /* addr32 pop r/m16 */
  28.374 -                        if ((prefix & ADDR32) == 0)
  28.375 -                                goto invalid;
  28.376 -                        if (!pop(regs, prefix, opc))
  28.377 -                                goto invalid;
  28.378 -                        return OPC_EMULATED;
  28.379 +			if ((prefix & ADDR32) == 0)
  28.380 +				goto invalid;
  28.381 +			if (!pop(regs, prefix, opc))
  28.382 +				goto invalid;
  28.383 +			return OPC_EMULATED;
  28.384  
  28.385  		case 0x90: /* nop */
  28.386  			TRACE((regs, regs->eip - eip, "nop"));
  28.387 @@ -1487,7 +1464,7 @@ opcode(struct regs *regs)
  28.388  			regs->eflags |= EFLAGS_VM;
  28.389  			return OPC_EMULATED;
  28.390  
  28.391 -		case 0xA1: /* mov ax, r/m16 */ 
  28.392 +		case 0xA1: /* mov ax, r/m16 */
  28.393  			{
  28.394  				int addr, data;
  28.395  				int seg = segment(prefix, regs, regs->vds);
  28.396 @@ -1521,15 +1498,15 @@ opcode(struct regs *regs)
  28.397  			return OPC_EMULATED;
  28.398  
  28.399  		case 0xC6: /* addr32 movb $imm, r/m8 */
  28.400 -                        if ((prefix & ADDR32) == 0)
  28.401 -                                goto invalid;
  28.402 -                        if (!movr(regs, prefix, opc))
  28.403 -                                goto invalid;
  28.404 +			if ((prefix & ADDR32) == 0)
  28.405 +				goto invalid;
  28.406 +			if (!movr(regs, prefix, opc))
  28.407 +				goto invalid;
  28.408  			return OPC_EMULATED;
  28.409  
  28.410  		case 0xCB: /* retl */
  28.411  			if ((mode == VM86_REAL_TO_PROTECTED) ||
  28.412 -			    (mode == VM86_PROTECTED_TO_REAL)) {
  28.413 +				(mode == VM86_PROTECTED_TO_REAL)) {
  28.414  				retl(regs, prefix);
  28.415  				return OPC_INVALID;
  28.416  			}
  28.417 @@ -1567,7 +1544,7 @@ opcode(struct regs *regs)
  28.418  
  28.419  		case 0xEA: /* jmpl */
  28.420  			if ((mode == VM86_REAL_TO_PROTECTED) ||
  28.421 -			    (mode == VM86_PROTECTED_TO_REAL)) {
  28.422 +				(mode == VM86_PROTECTED_TO_REAL)) {
  28.423  				jmpl(regs, prefix);
  28.424  				return OPC_INVALID;
  28.425  			}
  28.426 @@ -1579,7 +1556,7 @@ opcode(struct regs *regs)
  28.427  				switch((modrm >> 3) & 7) {
  28.428  				case 5: /* jmpl (indirect) */
  28.429  					if ((mode == VM86_REAL_TO_PROTECTED) ||
  28.430 -					    (mode == VM86_PROTECTED_TO_REAL)) {
  28.431 +						(mode == VM86_PROTECTED_TO_REAL)) {
  28.432  						jmpl_indirect(regs, prefix, modrm);
  28.433  						return OPC_INVALID;
  28.434  					}
  28.435 @@ -1596,7 +1573,7 @@ opcode(struct regs *regs)
  28.436  
  28.437  		case 0xEB: /* short jump */
  28.438  			if ((mode == VM86_REAL_TO_PROTECTED) ||
  28.439 -			    (mode == VM86_PROTECTED_TO_REAL)) {
  28.440 +				(mode == VM86_PROTECTED_TO_REAL)) {
  28.441  				disp = (char) fetch8(regs);
  28.442  				TRACE((regs, 2, "jmp 0x%x", regs->eip + disp));
  28.443  				regs->eip += disp;
  28.444 @@ -1619,10 +1596,10 @@ opcode(struct regs *regs)
  28.445  			continue;
  28.446  
  28.447  		case 0xF6: /* addr32 testb $imm, r/m8 */
  28.448 -                        if ((prefix & ADDR32) == 0)
  28.449 -                                goto invalid;
  28.450 -                        if (!test(regs, prefix, opc))
  28.451 -                                goto invalid;
  28.452 +			if ((prefix & ADDR32) == 0)
  28.453 +				goto invalid;
  28.454 +			if (!test(regs, prefix, opc))
  28.455 +				goto invalid;
  28.456  			return OPC_EMULATED;
  28.457  
  28.458  		case 0xFA: /* cli */
  28.459 @@ -1682,6 +1659,8 @@ trap(int trapno, int errno, struct regs 
  28.460  	case 1: /* Debug */
  28.461  		if (regs->eflags & EFLAGS_VM) {
  28.462  			/* emulate any 8086 instructions  */
  28.463 +			if (mode == VM86_REAL)
  28.464 +				return;
  28.465  			if (mode != VM86_REAL_TO_PROTECTED)
  28.466  				panic("not in real-to-protected mode");
  28.467  			emulate(regs);
  28.468 @@ -1702,7 +1681,7 @@ trap(int trapno, int errno, struct regs 
  28.469  	default:
  28.470  	invalid:
  28.471  		printf("Trap (0x%x) while in %s mode\n",
  28.472 -		    trapno, regs->eflags & EFLAGS_VM ? "real" : "protected");
  28.473 +			trapno, regs->eflags & EFLAGS_VM ? "real" : "protected");
  28.474  		if (trapno == 14)
  28.475  			printf("Page fault address 0x%x\n", get_cr2());
  28.476  		dump_regs(regs);
    29.1 --- a/tools/ioemu/hw/tpm_tis.c	Thu Dec 07 16:18:55 2006 -0700
    29.2 +++ b/tools/ioemu/hw/tpm_tis.c	Fri Dec 08 09:09:18 2006 -0700
    29.3 @@ -132,7 +132,7 @@ typedef struct TPMState {
    29.4  
    29.5  
    29.6  /* local prototypes */
    29.7 -static int TPM_Send(tpmState *s, tpmBuffer *buffer, char *msg);
    29.8 +static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg);
    29.9  static int TPM_Receive(tpmState *s, tpmBuffer *buffer);
   29.10  static uint32_t vtpm_instance_from_xenstore(void);
   29.11  static void tis_poll_timer(void *opaque);
   29.12 @@ -271,6 +271,8 @@ static int create_local_socket(tpmState 
   29.13  /*
   29.14   * the 'write' method for sending requests to the vTPM
   29.15   * four bytes with the vTPM instance number are prepended to each request
   29.16 + * the locality in which the command was sent is transmitted in the
   29.17 + * highest 3 bits
   29.18   */
   29.19  static int write_local_socket(tpmState *s, const tpmBuffer *buffer)
   29.20  {
   29.21 @@ -608,7 +610,7 @@ static void tis_mem_writel(void *opaque,
   29.22              }
   29.23          }
   29.24          if (val & STS_TPM_GO) {
   29.25 -            n = TPM_Send(s, &s->buffer,"tpm_data_write");
   29.26 +            n = TPM_Send(s, &s->buffer, locty, "tpm_data_write");
   29.27              if (n > 0) {
   29.28                  /* sending of data was successful */
   29.29                  s->offset = 0;
   29.30 @@ -915,7 +917,7 @@ const static unsigned char tpm_failure[]
   29.31  /*
   29.32   * Send a TPM request.
   29.33   */
   29.34 -static int TPM_Send(tpmState *s, tpmBuffer *buffer, char *msg)
   29.35 +static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg)
   29.36  {
   29.37      int len;
   29.38      uint32_t size = tpm_get_size_from_buffer(buffer->buf);
   29.39 @@ -945,6 +947,10 @@ static int TPM_Send(tpmState *s, tpmBuff
   29.40      showBuff(buffer->buf, "To TPM");
   29.41  #endif
   29.42  
   29.43 +    /* transmit the locality in the highest 3 bits */
   29.44 +    buffer->instance[0] &= 0x1f;
   29.45 +    buffer->instance[0] |= (locty << 5);
   29.46 +
   29.47      len = vTPMTransmit[s->Transmitlayer].write(s, buffer);
   29.48      if (len < 0) {
   29.49          s->Transmitlayer = -1;
    30.1 --- a/tools/ioemu/hw/usb-hid.c	Thu Dec 07 16:18:55 2006 -0700
    30.2 +++ b/tools/ioemu/hw/usb-hid.c	Fri Dec 08 09:09:18 2006 -0700
    30.3 @@ -39,6 +39,7 @@ typedef struct USBMouseState {
    30.4      int x, y;
    30.5      int kind;
    30.6      int mouse_grabbed;
    30.7 +    int status_changed;
    30.8  } USBMouseState;
    30.9  
   30.10  /* mostly the same values as the Bochs USB Mouse device */
   30.11 @@ -231,6 +232,7 @@ static void usb_mouse_event(void *opaque
   30.12      s->dy += dy1;
   30.13      s->dz += dz1;
   30.14      s->buttons_state = buttons_state;
   30.15 +    s->status_changed = 1;
   30.16  }
   30.17  
   30.18  static void usb_tablet_event(void *opaque,
   30.19 @@ -242,6 +244,7 @@ static void usb_tablet_event(void *opaqu
   30.20      s->y = y;
   30.21      s->dz += dz;
   30.22      s->buttons_state = buttons_state;
   30.23 +    s->status_changed = 1;
   30.24  }
   30.25  
   30.26  static inline int int_clamp(int val, int vmin, int vmax)
   30.27 @@ -483,10 +486,16 @@ static int usb_mouse_handle_data(USBDevi
   30.28      switch(pid) {
   30.29      case USB_TOKEN_IN:
   30.30          if (devep == 1) {
   30.31 -	    if (s->kind == USB_MOUSE)
   30.32 -		ret = usb_mouse_poll(s, data, len);
   30.33 -	    else if (s->kind == USB_TABLET)
   30.34 -		ret = usb_tablet_poll(s, data, len);
   30.35 +            if (s->kind == USB_MOUSE)
   30.36 +                ret = usb_mouse_poll(s, data, len);
   30.37 +            else if (s->kind == USB_TABLET)
   30.38 +                ret = usb_tablet_poll(s, data, len);
   30.39 +
   30.40 +            if (!s->status_changed)
   30.41 +                ret = USB_RET_NAK;
   30.42 +            else
   30.43 +                s->status_changed = 0;
   30.44 +
   30.45          } else {
   30.46              goto fail;
   30.47          }
   30.48 @@ -523,6 +532,7 @@ USBDevice *usb_tablet_init(void)
   30.49      s->dev.handle_data = usb_mouse_handle_data;
   30.50      s->dev.handle_destroy = usb_mouse_handle_destroy;
   30.51      s->kind = USB_TABLET;
   30.52 +    s->status_changed = 0;
   30.53  
   30.54      pstrcpy(s->dev.devname, sizeof(s->dev.devname), "QEMU USB Tablet");
   30.55  
   30.56 @@ -544,6 +554,7 @@ USBDevice *usb_mouse_init(void)
   30.57      s->dev.handle_data = usb_mouse_handle_data;
   30.58      s->dev.handle_destroy = usb_mouse_handle_destroy;
   30.59      s->kind = USB_MOUSE;
   30.60 +    s->status_changed = 0;
   30.61  
   30.62      pstrcpy(s->dev.devname, sizeof(s->dev.devname), "QEMU USB Mouse");
   30.63  
    31.1 --- a/tools/ioemu/hw/usb-uhci.c	Thu Dec 07 16:18:55 2006 -0700
    31.2 +++ b/tools/ioemu/hw/usb-uhci.c	Fri Dec 08 09:09:18 2006 -0700
    31.3 @@ -424,12 +424,10 @@ static int uhci_handle_td(UHCIState *s, 
    31.4      uint8_t buf[2048];
    31.5      int len, max_len, err, ret;
    31.6  
    31.7 -    if (td->ctrl & TD_CTRL_IOC) {
    31.8 -        *int_mask |= 0x01;
    31.9 +    if (!(td->ctrl & TD_CTRL_ACTIVE)){
   31.10 +        ret = 1;
   31.11 +        goto out;
   31.12      }
   31.13 -    
   31.14 -    if (!(td->ctrl & TD_CTRL_ACTIVE))
   31.15 -        return 1;
   31.16  
   31.17      /* TD is active */
   31.18      max_len = ((td->token >> 21) + 1) & 0x7ff;
   31.19 @@ -467,7 +465,8 @@ static int uhci_handle_td(UHCIState *s, 
   31.20          /* invalid pid : frame interrupted */
   31.21          s->status |= UHCI_STS_HCPERR;
   31.22          uhci_update_irq(s);
   31.23 -        return -1;
   31.24 +        ret = -1;
   31.25 +        goto out;
   31.26      }
   31.27      if (td->ctrl & TD_CTRL_IOS)
   31.28          td->ctrl &= ~TD_CTRL_ACTIVE;
   31.29 @@ -479,10 +478,12 @@ static int uhci_handle_td(UHCIState *s, 
   31.30              len < max_len) {
   31.31              *int_mask |= 0x02;
   31.32              /* short packet: do not update QH */
   31.33 -            return 1;
   31.34 +            ret = 1;
   31.35 +            goto out;
   31.36          } else {
   31.37              /* success */
   31.38 -            return 0;
   31.39 +            ret = 0;
   31.40 +            goto out;
   31.41          }
   31.42      } else {
   31.43          switch(ret) {
   31.44 @@ -501,23 +502,34 @@ static int uhci_handle_td(UHCIState *s, 
   31.45              }
   31.46              td->ctrl = (td->ctrl & ~(3 << TD_CTRL_ERROR_SHIFT)) | 
   31.47                  (err << TD_CTRL_ERROR_SHIFT);
   31.48 -            return 1;
   31.49 +            ret = 1;
   31.50 +            goto out;
   31.51          case USB_RET_NAK:
   31.52              td->ctrl |= TD_CTRL_NAK;
   31.53              if (pid == USB_TOKEN_SETUP)
   31.54                  goto do_timeout;
   31.55 -            return 1;
   31.56 +            ret = 1;
   31.57 +            goto out;
   31.58          case USB_RET_STALL:
   31.59              td->ctrl |= TD_CTRL_STALL;
   31.60              td->ctrl &= ~TD_CTRL_ACTIVE;
   31.61 -            return 1;
   31.62 +            ret = 1;
   31.63 +            goto out;
   31.64          case USB_RET_BABBLE:
   31.65              td->ctrl |= TD_CTRL_BABBLE | TD_CTRL_STALL;
   31.66              td->ctrl &= ~TD_CTRL_ACTIVE;
   31.67              /* frame interrupted */
   31.68 -            return -1;
   31.69 +            ret = -1;
   31.70 +            goto out;
   31.71          }
   31.72      }
   31.73 +   
   31.74 +out:
   31.75 +    /* If TD is inactive and IOC bit set to 1 then update int_mask */ 
   31.76 +    if ((td->ctrl & TD_CTRL_IOC) && (!(td->ctrl & TD_CTRL_ACTIVE))) {
   31.77 +        *int_mask |= 0x01;
   31.78 +    }
   31.79 +    return ret;
   31.80  }
   31.81  
   31.82  static void uhci_frame_timer(void *opaque)
    32.1 --- a/tools/ioemu/target-i386-dm/cpu.h	Thu Dec 07 16:18:55 2006 -0700
    32.2 +++ b/tools/ioemu/target-i386-dm/cpu.h	Fri Dec 08 09:09:18 2006 -0700
    32.3 @@ -25,7 +25,8 @@
    32.4  #ifdef TARGET_X86_64
    32.5  #define TARGET_LONG_BITS 64
    32.6  #else
    32.7 -#define TARGET_LONG_BITS 32
    32.8 +/* #define TARGET_LONG_BITS 32 */
    32.9 +#define TARGET_LONG_BITS 64 /* for Qemu map cache */
   32.10  #endif
   32.11  
   32.12  /* target supports implicit self modifying code */
    33.1 --- a/tools/ioemu/target-i386-dm/exec-dm.c	Thu Dec 07 16:18:55 2006 -0700
    33.2 +++ b/tools/ioemu/target-i386-dm/exec-dm.c	Fri Dec 08 09:09:18 2006 -0700
    33.3 @@ -36,6 +36,7 @@
    33.4  
    33.5  #include "cpu.h"
    33.6  #include "exec-all.h"
    33.7 +#include "vl.h"
    33.8  
    33.9  //#define DEBUG_TB_INVALIDATE
   33.10  //#define DEBUG_FLUSH
   33.11 @@ -426,6 +427,12 @@ static inline int paddr_is_ram(target_ph
   33.12  #endif
   33.13  }
   33.14  
   33.15 +#if defined(__i386__) || defined(__x86_64__)
   33.16 +#define phys_ram_addr(x) (qemu_map_cache(x))
   33.17 +#elif defined(__ia64__)
   33.18 +#define phys_ram_addr(x) (phys_ram_base + (x))
   33.19 +#endif
   33.20 +
   33.21  void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, 
   33.22                              int len, int is_write)
   33.23  {
   33.24 @@ -438,7 +445,7 @@ void cpu_physical_memory_rw(target_phys_
   33.25          l = TARGET_PAGE_SIZE - (addr & ~TARGET_PAGE_MASK); 
   33.26          if (l > len)
   33.27              l = len;
   33.28 -	
   33.29 +
   33.30          io_index = iomem_index(addr);
   33.31          if (is_write) {
   33.32              if (io_index) {
   33.33 @@ -460,9 +467,10 @@ void cpu_physical_memory_rw(target_phys_
   33.34                  }
   33.35              } else if (paddr_is_ram(addr)) {
   33.36                  /* Reading from RAM */
   33.37 -                memcpy(phys_ram_base + addr, buf, l);
   33.38 +                ptr = phys_ram_addr(addr);
   33.39 +                memcpy(ptr, buf, l);
   33.40  #ifdef __ia64__
   33.41 -                sync_icache((unsigned long)(phys_ram_base + addr), l);
   33.42 +                sync_icache(ptr, l);
   33.43  #endif 
   33.44              }
   33.45          } else {
   33.46 @@ -485,7 +493,8 @@ void cpu_physical_memory_rw(target_phys_
   33.47                  }
   33.48              } else if (paddr_is_ram(addr)) {
   33.49                  /* Reading from RAM */
   33.50 -                memcpy(buf, phys_ram_base + addr, l);
   33.51 +                ptr = phys_ram_addr(addr);
   33.52 +                memcpy(buf, ptr, l);
   33.53              } else {
   33.54                  /* Neither RAM nor known MMIO space */
   33.55                  memset(buf, 0xff, len); 
    34.1 --- a/tools/ioemu/vl.c	Thu Dec 07 16:18:55 2006 -0700
    34.2 +++ b/tools/ioemu/vl.c	Fri Dec 08 09:09:18 2006 -0700
    34.3 @@ -5808,6 +5808,92 @@ int set_mm_mapping(int xc_handle, uint32
    34.4      return 0;
    34.5  }
    34.6  
    34.7 +#if defined(__i386__) || defined(__x86_64__)
    34.8 +static struct map_cache *mapcache_entry;
    34.9 +static unsigned long nr_buckets;
   34.10 +
   34.11 +static int qemu_map_cache_init(unsigned long nr_pages)
   34.12 +{
   34.13 +    unsigned long max_pages = MAX_MCACHE_SIZE >> PAGE_SHIFT;
   34.14 +    int i;
   34.15 +
   34.16 +    if (nr_pages < max_pages)
   34.17 +        max_pages = nr_pages;
   34.18 +
   34.19 +    nr_buckets = (max_pages << PAGE_SHIFT) >> MCACHE_BUCKET_SHIFT;
   34.20 +
   34.21 +    fprintf(logfile, "qemu_map_cache_init nr_buckets = %lx\n", nr_buckets);
   34.22 +
   34.23 +    mapcache_entry = malloc(nr_buckets * sizeof(struct map_cache));
   34.24 +    if (mapcache_entry == NULL) {
   34.25 +        errno = ENOMEM;
   34.26 +        return -1;
   34.27 +    }
   34.28 +
   34.29 +    memset(mapcache_entry, 0, nr_buckets * sizeof(struct map_cache));
   34.30 +
   34.31 +    /*
   34.32 +     * To avoid ENOMEM from xc_map_foreign_batch() at runtime, we
   34.33 +     * pre-fill all the map caches in advance.
   34.34 +     */
   34.35 +    for (i = 0; i < nr_buckets; i++)
   34.36 +       (void)qemu_map_cache(((target_phys_addr_t)i) << MCACHE_BUCKET_SHIFT);
   34.37 +
   34.38 +    return 0;
   34.39 +}
   34.40 +
   34.41 +uint8_t *qemu_map_cache(target_phys_addr_t phys_addr)
   34.42 +{
   34.43 +    struct map_cache *entry;
   34.44 +    unsigned long address_index  = phys_addr >> MCACHE_BUCKET_SHIFT;
   34.45 +    unsigned long address_offset = phys_addr & (MCACHE_BUCKET_SIZE-1);
   34.46 +
   34.47 +    /* For most cases (>99.9%), the page address is the same. */
   34.48 +    static unsigned long last_address_index = ~0UL;
   34.49 +    static uint8_t      *last_address_vaddr;
   34.50 +
   34.51 +    if (address_index == last_address_index)
   34.52 +        return last_address_vaddr + address_offset;
   34.53 +
   34.54 +    entry = &mapcache_entry[address_index % nr_buckets];
   34.55 +
   34.56 +    if (entry->vaddr_base == NULL || entry->paddr_index != address_index)
   34.57 +    { 
   34.58 +        /* We need to remap a bucket. */
   34.59 +        uint8_t *vaddr_base;
   34.60 +        unsigned long pfns[MCACHE_BUCKET_SIZE >> PAGE_SHIFT];
   34.61 +        unsigned int i;
   34.62 +
   34.63 +        if (entry->vaddr_base != NULL) {
   34.64 +            errno = munmap(entry->vaddr_base, MCACHE_BUCKET_SIZE);
   34.65 +            if (errno) {
   34.66 +                fprintf(logfile, "unmap fails %d\n", errno);
   34.67 +                exit(-1);
   34.68 +            }
   34.69 +        }
   34.70 +
   34.71 +        for (i = 0; i < MCACHE_BUCKET_SIZE >> PAGE_SHIFT; i++)
   34.72 +            pfns[i] = (address_index << (MCACHE_BUCKET_SHIFT-PAGE_SHIFT)) + i;
   34.73 +
   34.74 +        vaddr_base = xc_map_foreign_batch(
   34.75 +            xc_handle, domid, PROT_READ|PROT_WRITE,
   34.76 +            pfns, MCACHE_BUCKET_SIZE >> PAGE_SHIFT);
   34.77 +        if (vaddr_base == NULL) {
   34.78 +            fprintf(logfile, "xc_map_foreign_batch error %d\n", errno);
   34.79 +            exit(-1);
   34.80 +        }
   34.81 +
   34.82 +        entry->vaddr_base  = vaddr_base;
   34.83 +        entry->paddr_index = address_index;;
   34.84 +    }
   34.85 +
   34.86 +    last_address_index = address_index;
   34.87 +    last_address_vaddr = entry->vaddr_base;
   34.88 +
   34.89 +    return last_address_vaddr + address_offset;
   34.90 +}
   34.91 +#endif
   34.92 +
   34.93  int main(int argc, char **argv)
   34.94  {
   34.95  #ifdef CONFIG_GDBSTUB
   34.96 @@ -6130,6 +6216,7 @@ int main(int argc, char **argv)
   34.97                  break;
   34.98              case QEMU_OPTION_m:
   34.99                  ram_size = atol(optarg) * 1024 * 1024;
  34.100 +                ram_size = (uint64_t)atol(optarg) * 1024 * 1024;
  34.101                  if (ram_size <= 0)
  34.102                      help();
  34.103  #ifndef CONFIG_DM
  34.104 @@ -6404,50 +6491,41 @@ int main(int argc, char **argv)
  34.105          shared_page_nr = nr_pages - 1;
  34.106  #endif
  34.107  
  34.108 -    page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
  34.109 -    if (page_array == NULL) {
  34.110 -        fprintf(logfile, "malloc returned error %d\n", errno);
  34.111 -        exit(-1);
  34.112 -    }
  34.113 -
  34.114  #if defined(__i386__) || defined(__x86_64__)
  34.115 -    for ( i = 0; i < tmp_nr_pages; i++)
  34.116 -        page_array[i] = i;
  34.117 -
  34.118 -    phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
  34.119 -                                         PROT_READ|PROT_WRITE, page_array,
  34.120 -                                         tmp_nr_pages);
  34.121 -    if (phys_ram_base == NULL) {
  34.122 -        fprintf(logfile, "batch map guest memory returned error %d\n", errno);
  34.123 +
  34.124 +    if ( qemu_map_cache_init(tmp_nr_pages) )
  34.125 +    {
  34.126 +        fprintf(logfile, "qemu_map_cache_init returned: error %d\n", errno);
  34.127          exit(-1);
  34.128      }
  34.129  
  34.130      shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  34.131 -                                       PROT_READ|PROT_WRITE,
  34.132 -                                       page_array[shared_page_nr]);
  34.133 +                                       PROT_READ|PROT_WRITE, shared_page_nr);
  34.134      if (shared_page == NULL) {
  34.135          fprintf(logfile, "map shared IO page returned error %d\n", errno);
  34.136          exit(-1);
  34.137      }
  34.138  
  34.139 -    fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n",
  34.140 -            shared_page_nr, (uint64_t)(page_array[shared_page_nr]));
  34.141 +    fprintf(logfile, "shared page at pfn:%lx\n", shared_page_nr);
  34.142  
  34.143      buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  34.144                                              PROT_READ|PROT_WRITE,
  34.145 -                                            page_array[shared_page_nr - 2]);
  34.146 +                                            shared_page_nr - 2);
  34.147      if (buffered_io_page == NULL) {
  34.148          fprintf(logfile, "map buffered IO page returned error %d\n", errno);
  34.149          exit(-1);
  34.150      }
  34.151  
  34.152 -    fprintf(logfile, "buffered io page at pfn:%lx, mfn: %"PRIx64"\n",
  34.153 -            shared_page_nr - 2, (uint64_t)(page_array[shared_page_nr - 2]));
  34.154 -
  34.155 -    free(page_array);
  34.156 +    fprintf(logfile, "buffered io page at pfn:%lx\n", shared_page_nr - 2);
  34.157  
  34.158  #elif defined(__ia64__)
  34.159  
  34.160 +    page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
  34.161 +    if (page_array == NULL) {
  34.162 +        fprintf(logfile, "malloc returned error %d\n", errno);
  34.163 +        exit(-1);
  34.164 +    }
  34.165 +
  34.166      shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
  34.167                                         PROT_READ|PROT_WRITE,
  34.168                                         IO_PAGE_START >> PAGE_SHIFT);
    35.1 --- a/tools/ioemu/vl.h	Thu Dec 07 16:18:55 2006 -0700
    35.2 +++ b/tools/ioemu/vl.h	Fri Dec 08 09:09:18 2006 -0700
    35.3 @@ -156,6 +156,26 @@ extern void *shared_vram;
    35.4  
    35.5  extern FILE *logfile;
    35.6  
    35.7 +
    35.8 +#if defined(__i386__) || defined(__x86_64__)
    35.9 +#if defined(__i386__) 
   35.10 +#define MAX_MCACHE_SIZE    0x40000000 /* 1GB max for x86 */
   35.11 +#define MCACHE_BUCKET_SHIFT 16
   35.12 +#elif defined(__x86_64__)
   35.13 +#define MAX_MCACHE_SIZE    0x1000000000 /* 64GB max for x86_64 */
   35.14 +#define MCACHE_BUCKET_SHIFT 20
   35.15 +#endif
   35.16 +
   35.17 +#define MCACHE_BUCKET_SIZE (1UL << MCACHE_BUCKET_SHIFT)
   35.18 +
   35.19 +struct map_cache {
   35.20 +    unsigned long paddr_index;
   35.21 +    uint8_t      *vaddr_base;
   35.22 +};
   35.23 +
   35.24 +uint8_t *qemu_map_cache(target_phys_addr_t phys_addr);
   35.25 +#endif
   35.26 +
   35.27  extern int xc_handle;
   35.28  extern int domid;
   35.29  
    36.1 --- a/tools/libxc/ia64/xc_ia64_linux_save.c	Thu Dec 07 16:18:55 2006 -0700
    36.2 +++ b/tools/libxc/ia64/xc_ia64_linux_save.c	Fri Dec 08 09:09:18 2006 -0700
    36.3 @@ -353,7 +353,7 @@ xc_linux_save(int xc_handle, int io_fd, 
    36.4                     It will be remarked dirty.
    36.5                     FIXME: to be tracked.  */
    36.6                  fprintf(stderr, "cannot map page %lx: %s\n",
    36.7 -                        page_array[N], strerror (errno));
    36.8 +                        page_array[N], safe_strerror(errno));
    36.9                  continue;
   36.10              }
   36.11  
    37.1 --- a/tools/libxc/xc_core.c	Thu Dec 07 16:18:55 2006 -0700
    37.2 +++ b/tools/libxc/xc_core.c	Fri Dec 08 09:09:18 2006 -0700
    37.3 @@ -140,7 +140,7 @@ static int local_file_dump(void *args, c
    37.4          bytes = write(da->fd, &buffer[offset], length-offset);
    37.5          if ( bytes <= 0 )
    37.6          {
    37.7 -            PERROR("Failed to write buffer: %s", strerror(errno));
    37.8 +            PERROR("Failed to write buffer");
    37.9              return -errno;
   37.10          }
   37.11      }
   37.12 @@ -158,7 +158,7 @@ xc_domain_dumpcore(int xc_handle,
   37.13  
   37.14      if ( (da.fd = open(corename, O_CREAT|O_RDWR, S_IWUSR|S_IRUSR)) < 0 )
   37.15      {
   37.16 -        PERROR("Could not open corefile %s: %s", corename, strerror(errno));
   37.17 +        PERROR("Could not open corefile %s", corename);
   37.18          return -errno;
   37.19      }
   37.20  
    38.1 --- a/tools/libxc/xc_domain.c	Thu Dec 07 16:18:55 2006 -0700
    38.2 +++ b/tools/libxc/xc_domain.c	Fri Dec 08 09:09:18 2006 -0700
    38.3 @@ -316,6 +316,52 @@ int xc_domain_setmaxmem(int xc_handle,
    38.4      return do_domctl(xc_handle, &domctl);
    38.5  }
    38.6  
    38.7 +#if defined(__i386__) || defined(__x86_64__)
    38.8 +#include <xen/hvm/e820.h>
    38.9 +int xc_domain_set_memmap_limit(int xc_handle,
   38.10 +                               uint32_t domid,
   38.11 +                               unsigned long map_limitkb)
   38.12 +{
   38.13 +    int rc;
   38.14 +
   38.15 +    struct xen_foreign_memory_map fmap = {
   38.16 +        .domid = domid,
   38.17 +        .map = { .nr_entries = 1 }
   38.18 +    };
   38.19 +
   38.20 +    struct e820entry e820 = {
   38.21 +        .addr = 0,
   38.22 +        .size = (uint64_t)map_limitkb << 10,
   38.23 +        .type = E820_RAM
   38.24 +    };
   38.25 +
   38.26 +    set_xen_guest_handle(fmap.map.buffer, &e820);
   38.27 +
   38.28 +    if ( lock_pages(&fmap, sizeof(fmap)) || lock_pages(&e820, sizeof(e820)) )
   38.29 +    {
   38.30 +        PERROR("Could not lock memory for Xen hypercall");
   38.31 +        rc = -1;
   38.32 +        goto out;
   38.33 +    }
   38.34 +
   38.35 +    rc = xc_memory_op(xc_handle, XENMEM_set_memory_map, &fmap);
   38.36 +
   38.37 + out:
   38.38 +    unlock_pages(&fmap, sizeof(fmap));
   38.39 +    unlock_pages(&e820, sizeof(e820));
   38.40 +    return rc;
   38.41 +}
   38.42 +#else
   38.43 +int xc_domain_set_memmap_limit(int xc_handle,
   38.44 +                               uint32_t domid,
   38.45 +                               unsigned long map_limitkb)
   38.46 +{
   38.47 +    PERROR("Function not implemented");
   38.48 +    errno = ENOSYS;
   38.49 +    return -1;
   38.50 +}
   38.51 +#endif
   38.52 +
   38.53  int xc_domain_set_time_offset(int xc_handle,
   38.54                                uint32_t domid,
   38.55                                int32_t time_offset_seconds)
    39.1 --- a/tools/libxc/xc_hvm_build.c	Thu Dec 07 16:18:55 2006 -0700
    39.2 +++ b/tools/libxc/xc_hvm_build.c	Fri Dec 08 09:09:18 2006 -0700
    39.3 @@ -285,7 +285,6 @@ static int xc_hvm_build_internal(int xc_
    39.4  
    39.5      if ( setup_guest(xc_handle, domid, memsize, image, image_size, &ctxt) < 0 )
    39.6      {
    39.7 -        ERROR("Error constructing guest OS");
    39.8          goto error_out;
    39.9      }
   39.10  
   39.11 @@ -329,26 +328,30 @@ static int parseelfimage(char *elfbase,
   39.12  
   39.13      if ( !IS_ELF(*ehdr) )
   39.14      {
   39.15 -        ERROR("Kernel image does not have an ELF header.");
   39.16 +        xc_set_error(XC_INVALID_KERNEL,
   39.17 +                     "Kernel image does not have an ELF header.");
   39.18          return -EINVAL;
   39.19      }
   39.20  
   39.21      if ( (ehdr->e_phoff + (ehdr->e_phnum * ehdr->e_phentsize)) > elfsize )
   39.22      {
   39.23 -        ERROR("ELF program headers extend beyond end of image.");
   39.24 +        xc_set_error(XC_INVALID_KERNEL,
   39.25 +                     "ELF program headers extend beyond end of image.");
   39.26          return -EINVAL;
   39.27      }
   39.28  
   39.29      if ( (ehdr->e_shoff + (ehdr->e_shnum * ehdr->e_shentsize)) > elfsize )
   39.30      {
   39.31 -        ERROR("ELF section headers extend beyond end of image.");
   39.32 +        xc_set_error(XC_INVALID_KERNEL,
   39.33 +                     "ELF section headers extend beyond end of image.");
   39.34          return -EINVAL;
   39.35      }
   39.36  
   39.37      /* Find the section-header strings table. */
   39.38      if ( ehdr->e_shstrndx == SHN_UNDEF )
   39.39      {
   39.40 -        ERROR("ELF image has no section-header strings table (shstrtab).");
   39.41 +        xc_set_error(XC_INVALID_KERNEL,
   39.42 +                     "ELF image has no section-header strings table (shstrtab).");
   39.43          return -EINVAL;
   39.44      }
   39.45      shdr = (Elf32_Shdr *)(elfbase + ehdr->e_shoff +
   39.46 @@ -370,7 +373,8 @@ static int parseelfimage(char *elfbase,
   39.47           (ehdr->e_entry < kernstart) ||
   39.48           (ehdr->e_entry > kernend) )
   39.49      {
   39.50 -        ERROR("Malformed ELF image.");
   39.51 +        xc_set_error(XC_INVALID_KERNEL,
   39.52 +                     "Malformed ELF image.");
   39.53          return -EINVAL;
   39.54      }
   39.55  
    40.1 --- a/tools/libxc/xc_linux_build.c	Thu Dec 07 16:18:55 2006 -0700
    40.2 +++ b/tools/libxc/xc_linux_build.c	Fri Dec 08 09:09:18 2006 -0700
    40.3 @@ -120,7 +120,7 @@ static int probeimageformat(const char *
    40.4      if ( probe_elf(image, image_size, load_funcs) &&
    40.5           probe_bin(image, image_size, load_funcs) )
    40.6      {
    40.7 -        ERROR( "Unrecognized image format" );
    40.8 +        xc_set_error(XC_INVALID_KERNEL, "Not a valid ELF or raw kernel image");
    40.9          return -EINVAL;
   40.10      }
   40.11  
   40.12 @@ -606,8 +606,8 @@ static int setup_guest(int xc_handle,
   40.13      /* shared_info page starts its life empty. */
   40.14      shared_info = xc_map_foreign_range(
   40.15          xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, shared_info_frame);
   40.16 -    printf("shared_info = %p, err=%s frame=%lx\n",
   40.17 -           shared_info, strerror (errno), shared_info_frame);
   40.18 +    printf("shared_info = %p frame=%lx\n",
   40.19 +           shared_info, shared_info_frame);
   40.20      //memset(shared_info, 0, PAGE_SIZE);
   40.21      /* Mask all upcalls... */
   40.22      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
   40.23 @@ -631,17 +631,20 @@ static int compat_check(int xc_handle, s
   40.24      xen_capabilities_info_t xen_caps = "";
   40.25  
   40.26      if (xc_version(xc_handle, XENVER_capabilities, &xen_caps) != 0) {
   40.27 -        ERROR("Cannot determine host capabilities.");
   40.28 +        xc_set_error(XC_INVALID_KERNEL,
   40.29 +                     "Cannot determine host capabilities.");
   40.30          return 0;
   40.31      }
   40.32  
   40.33      if (strstr(xen_caps, "xen-3.0-x86_32p")) {
   40.34          if (dsi->pae_kernel == PAEKERN_no) {
   40.35 -            ERROR("Non PAE-kernel on PAE host.");
   40.36 +            xc_set_error(XC_INVALID_KERNEL,
   40.37 +                         "Non PAE-kernel on PAE host.");
   40.38              return 0;
   40.39          }
   40.40      } else if (dsi->pae_kernel != PAEKERN_no) {
   40.41 -        ERROR("PAE-kernel on non-PAE host.");
   40.42 +        xc_set_error(XC_INVALID_KERNEL,
   40.43 +                     "PAE-kernel on non-PAE host.");
   40.44          return 0;
   40.45      }
   40.46  
   40.47 @@ -1154,7 +1157,6 @@ static int xc_linux_build_internal(int x
   40.48                       console_evtchn, console_mfn,
   40.49                       features_bitmap) < 0 )
   40.50      {
   40.51 -        ERROR("Error constructing guest OS");
   40.52          goto error_out;
   40.53      }
   40.54  
    41.1 --- a/tools/libxc/xc_load_elf.c	Thu Dec 07 16:18:55 2006 -0700
    41.2 +++ b/tools/libxc/xc_load_elf.c	Fri Dec 08 09:09:18 2006 -0700
    41.3 @@ -29,20 +29,46 @@ loadelfsymtab(
    41.4   */
    41.5  #if defined(__ia64__)
    41.6  #define ELFCLASS   ELFCLASS64
    41.7 +#define ELFCLASS_DESC "64-bit"
    41.8 +
    41.9  #define ELFDATA    ELFDATA2LSB
   41.10 +#define ELFDATA_DESC "Little-Endian"
   41.11 +
   41.12  #define ELFMACHINE EM_IA_64
   41.13 +#define ELFMACHINE_DESC "ia64"
   41.14 +
   41.15 +
   41.16  #elif defined(__i386__)
   41.17  #define ELFCLASS   ELFCLASS32
   41.18 +#define ELFCLASS_DESC "32-bit"
   41.19 +
   41.20  #define ELFDATA    ELFDATA2LSB
   41.21 +#define ELFDATA_DESC "Little-Endian"
   41.22 +
   41.23  #define ELFMACHINE EM_386
   41.24 +#define ELFMACHINE_DESC "i386"
   41.25 +
   41.26 +
   41.27  #elif defined(__x86_64__)
   41.28  #define ELFCLASS   ELFCLASS64
   41.29 +#define ELFCLASS_DESC "64-bit"
   41.30 +
   41.31  #define ELFDATA    ELFDATA2LSB
   41.32 +#define ELFDATA_DESC "Little-Endian"
   41.33 +
   41.34  #define ELFMACHINE EM_X86_64
   41.35 +#define ELFMACHINE_DESC "x86_64"
   41.36 +
   41.37 +
   41.38  #elif defined(__powerpc__)
   41.39  #define ELFCLASS   ELFCLASS64
   41.40 +#define ELFCLASS_DESC "64-bit"
   41.41 +
   41.42  #define ELFDATA    ELFDATA2MSB
   41.43 +#define ELFDATA_DESC "Big-Endian"
   41.44 +
   41.45  #define ELFMACHINE EM_PPC64
   41.46 +#define ELFMACHINE_DESC "ppc64"
   41.47  #endif
   41.48  
   41.49  int probe_elf(const char *image,
   41.50 @@ -231,7 +257,8 @@ unsigned long long xen_elfnote_numeric(s
   41.51          *defined = 1;
   41.52          return *(uint64_t*)ELFNOTE_DESC(note);
   41.53      default:
   41.54 -        ERROR("elfnotes: unknown data size %#x for numeric type note %#x\n",
   41.55 +        xc_set_error(XC_INVALID_KERNEL,
   41.56 +                     "elfnotes: unknown data size %#x for numeric type note %#x\n",
   41.57                note->descsz, type);
   41.58          return 0;
   41.59      }
   41.60 @@ -250,35 +277,59 @@ static int parseelfimage(const char *ima
   41.61  
   41.62      if ( !IS_ELF(*ehdr) )
   41.63      {
   41.64 -        ERROR("Kernel image does not have an ELF header.");
   41.65 +        xc_set_error(XC_INVALID_KERNEL,
   41.66 +                     "Kernel image does not have an ELF header.");
   41.67          return -EINVAL;
   41.68      }
   41.69  
   41.70 -    if ( (ehdr->e_ident[EI_CLASS] != ELFCLASS) ||
   41.71 -         (ehdr->e_machine != ELFMACHINE) ||
   41.72 -         (ehdr->e_ident[EI_DATA] != ELFDATA) ||
   41.73 -         (ehdr->e_type != ET_EXEC) )
   41.74 +    if (ehdr->e_machine != ELFMACHINE)
   41.75 +    {
   41.76 +        xc_set_error(XC_INVALID_KERNEL,
   41.77 +                     "Kernel ELF architecture '%d' does not match Xen architecture '%d' (%s)",
   41.78 +                     ehdr->e_machine, ELFMACHINE, ELFMACHINE_DESC);
   41.79 +        return -EINVAL;
   41.80 +    }
   41.81 +    if (ehdr->e_ident[EI_CLASS] != ELFCLASS)
   41.82      {
   41.83 -        ERROR("Kernel not a Xen-compatible Elf image.");
   41.84 +        xc_set_error(XC_INVALID_KERNEL,
   41.85 +                     "Kernel ELF wordsize '%d' does not match Xen wordsize '%d' (%s)",
   41.86 +                     ehdr->e_ident[EI_CLASS], ELFCLASS, ELFCLASS_DESC);
   41.87 +        return -EINVAL;
   41.88 +    }
   41.89 +    if (ehdr->e_ident[EI_DATA] != ELFDATA)
   41.90 +    {
   41.91 +        xc_set_error(XC_INVALID_KERNEL,
   41.92 +                     "Kernel ELF endianness '%d' does not match Xen endianness '%d' (%s)",
   41.93 +                     ehdr->e_ident[EI_DATA], ELFDATA, ELFDATA_DESC);
   41.94 +        return -EINVAL;
   41.95 +    }
   41.96 +    if (ehdr->e_type != ET_EXEC)
   41.97 +    {
   41.98 +        xc_set_error(XC_INVALID_KERNEL,
   41.99 +                     "Kernel ELF type '%d' does not match Xen type '%d'",
  41.100 +                     ehdr->e_type, ET_EXEC);
  41.101          return -EINVAL;
  41.102      }
  41.103  
  41.104      if ( (ehdr->e_phoff + (ehdr->e_phnum*ehdr->e_phentsize)) > image_len )
  41.105      {
  41.106 -        ERROR("ELF program headers extend beyond end of image.");
  41.107 +        xc_set_error(XC_INVALID_KERNEL,
  41.108 +                     "ELF program headers extend beyond end of image.");
  41.109          return -EINVAL;
  41.110      }
  41.111  
  41.112      if ( (ehdr->e_shoff + (ehdr->e_shnum*ehdr->e_shentsize)) > image_len )
  41.113      {
  41.114 -        ERROR("ELF section headers extend beyond end of image.");
  41.115 +        xc_set_error(XC_INVALID_KERNEL,
  41.116 +                     "ELF section headers extend beyond end of image.");
  41.117          return -EINVAL;
  41.118      }
  41.119  
  41.120      /* Find the section-header strings table. */
  41.121      if ( ehdr->e_shstrndx == SHN_UNDEF )
  41.122      {
  41.123 -        ERROR("ELF image has no section-header strings table (shstrtab).");
  41.124 +        xc_set_error(XC_INVALID_KERNEL,
  41.125 +                     "ELF image has no section-header strings table (shstrtab).");
  41.126          return -EINVAL;
  41.127      }
  41.128      shdr = (Elf_Shdr *)(image + ehdr->e_shoff +
  41.129 @@ -325,22 +376,25 @@ static int parseelfimage(const char *ima
  41.130          if ( ( loader == NULL || strncmp(loader, "generic", 7) ) &&
  41.131               ( guest_os == NULL || strncmp(guest_os, "linux", 5) ) )
  41.132          {
  41.133 -            ERROR("Will only load images built for the generic loader "
  41.134 -                  "or Linux images");
  41.135 +            xc_set_error(XC_INVALID_KERNEL,
  41.136 +                         "Will only load images built for the generic loader "
  41.137 +                         "or Linux images");
  41.138              return -EINVAL;
  41.139          }
  41.140  
  41.141          if ( xen_version == NULL || strncmp(xen_version, "xen-3.0", 7) )
  41.142          {
  41.143 -            ERROR("Will only load images built for Xen v3.0");
  41.144 +            xc_set_error(XC_INVALID_KERNEL,
  41.145 +                         "Will only load images built for Xen v3.0");
  41.146              return -EINVAL;
  41.147          }
  41.148      }
  41.149      else
  41.150      {
  41.151  #if defined(__x86_64__) || defined(__i386__)
  41.152 -        ERROR("Not a Xen-ELF image: "
  41.153 -              "No ELF notes or '__xen_guest' section found.");
  41.154 +        xc_set_error(XC_INVALID_KERNEL,
  41.155 +                     "Not a Xen-ELF image: "
  41.156 +                     "No ELF notes or '__xen_guest' section found.");
  41.157          return -EINVAL;
  41.158  #endif
  41.159      }
  41.160 @@ -396,8 +450,9 @@ static int parseelfimage(const char *ima
  41.161  
  41.162      if ( elf_pa_off_defined && !virt_base_defined )
  41.163      {
  41.164 -        ERROR("Neither ELF_PADDR_OFFSET nor VIRT_BASE found in ELF "
  41.165 -              " notes or __xen_guest section.");
  41.166 +        xc_set_error(XC_INVALID_KERNEL,
  41.167 +                     "Neither ELF_PADDR_OFFSET nor VIRT_BASE found in ELF "
  41.168 +                     " notes or __xen_guest section.");
  41.169          return -EINVAL;
  41.170      }
  41.171  
  41.172 @@ -409,7 +464,8 @@ static int parseelfimage(const char *ima
  41.173          vaddr = phdr->p_paddr - dsi->elf_paddr_offset + dsi->v_start;
  41.174          if ( (vaddr + phdr->p_memsz) < vaddr )
  41.175          {
  41.176 -            ERROR("ELF program header %d is too large.", h);
  41.177 +            xc_set_error(XC_INVALID_KERNEL,
  41.178 +                         "ELF program header %d is too large.", h);
  41.179              return -EINVAL;
  41.180          }
  41.181  
  41.182 @@ -431,7 +487,8 @@ static int parseelfimage(const char *ima
  41.183           (dsi->v_kernentry > kernend) ||
  41.184           (dsi->v_start > kernstart) )
  41.185      {
  41.186 -        ERROR("ELF start or entries are out of bounds.");
  41.187 +        xc_set_error(XC_INVALID_KERNEL,
  41.188 +                     "ELF start or entries are out of bounds.");
  41.189          return -EINVAL;
  41.190      }
  41.191  
    42.1 --- a/tools/libxc/xc_private.c	Thu Dec 07 16:18:55 2006 -0700
    42.2 +++ b/tools/libxc/xc_private.c	Fri Dec 08 09:09:18 2006 -0700
    42.3 @@ -8,6 +8,82 @@
    42.4  #include "xc_private.h"
    42.5  #include "xg_private.h"
    42.6  
    42.7 +#include <stdarg.h>
    42.8 +
    42.9 +static __thread xc_error last_error = { XC_ERROR_NONE, ""};
   42.10 +#if DEBUG
   42.11 +static xc_error_handler error_handler = xc_default_error_handler;
   42.12 +#else
   42.13 +static xc_error_handler error_handler = NULL;
   42.14 +#endif
   42.15 +
   42.16 +void xc_default_error_handler(const xc_error const *err)
   42.17 +{
   42.18 +    const char *desc = xc_error_code_to_desc(err->code);
   42.19 +    fprintf(stderr, "ERROR %s: %s\n", desc, err->message);
   42.20 +}
   42.21 +
   42.22 +const xc_error const *xc_get_last_error(void)
   42.23 +{
   42.24 +    return &last_error;
   42.25 +}
   42.26 +
   42.27 +void xc_clear_last_error(void)
   42.28 +{
   42.29 +    last_error.code = XC_ERROR_NONE;
   42.30 +    last_error.message[0] = '\0';
   42.31 +}
   42.32 +
   42.33 +const char *xc_error_code_to_desc(int code)
   42.34 +{
   42.35 +    /* Sync to members of xc_error_code enumeration in xenctrl.h */
   42.36 +    switch ( code )
   42.37 +    {
   42.38 +    case XC_ERROR_NONE:
   42.39 +        return "No error details";
   42.40 +    case XC_INTERNAL_ERROR:
   42.41 +        return "Internal error";
   42.42 +    case XC_INVALID_KERNEL:
   42.43 +        return "Invalid kernel";
   42.44 +    }
   42.45 +
   42.46 +    return "Unknown error code";
   42.47 +}
   42.48 +
   42.49 +xc_error_handler xc_set_error_handler(xc_error_handler handler)
   42.50 +{
   42.51 +    xc_error_handler old = error_handler;
   42.52 +    error_handler = handler;
   42.53 +    return old;
   42.54 +}
   42.55 +
   42.56 +
   42.57 +static void _xc_set_error(int code, const char *msg)
   42.58 +{
   42.59 +    last_error.code = code;
   42.60 +    strncpy(last_error.message, msg, XC_MAX_ERROR_MSG_LEN - 1);
   42.61 +    last_error.message[XC_MAX_ERROR_MSG_LEN-1] = '\0';
   42.62 +}
   42.63 +
   42.64 +void xc_set_error(int code, const char *fmt, ...)
   42.65 +{
   42.66 +    int saved_errno = errno;
   42.67 +    char msg[XC_MAX_ERROR_MSG_LEN];
   42.68 +    va_list args;
   42.69 +
   42.70 +    va_start(args, fmt);
   42.71 +    vsnprintf(msg, XC_MAX_ERROR_MSG_LEN-1, fmt, args);
   42.72 +    msg[XC_MAX_ERROR_MSG_LEN-1] = '\0';
   42.73 +    va_end(args);
   42.74 +
   42.75 +    _xc_set_error(code, msg);
   42.76 +
   42.77 +    errno = saved_errno;
   42.78 +
   42.79 +    if ( error_handler != NULL )
   42.80 +        error_handler(&last_error);
   42.81 +}
   42.82 +
   42.83  int lock_pages(void *addr, size_t len)
   42.84  {
   42.85        int e = 0;
   42.86 @@ -407,6 +483,19 @@ unsigned long xc_make_page_below_4G(
   42.87      return new_mfn;
   42.88  }
   42.89  
   42.90 +char *safe_strerror(int errcode)
   42.91 +{
   42.92 +    static __thread char errbuf[32];
   42.93 +#ifdef __GLIBC__
   42.94 +    /* Broken GNU definition of strerror_r may not use our supplied buffer. */
   42.95 +    return strerror_r(errcode, errbuf, sizeof(errbuf));
   42.96 +#else
   42.97 +    /* Assume we have the POSIX definition of strerror_r. */
   42.98 +    strerror_r(errcode, errbuf, sizeof(errbuf));
   42.99 +    return errbuf;
  42.100 +#endif
  42.101 +}
  42.102 +
  42.103  /*
  42.104   * Local variables:
  42.105   * mode: C
    43.1 --- a/tools/libxc/xc_private.h	Thu Dec 07 16:18:55 2006 -0700
    43.2 +++ b/tools/libxc/xc_private.h	Fri Dec 08 09:09:18 2006 -0700
    43.3 @@ -59,24 +59,16 @@
    43.4  #define PPRINTF(_f, _a...)
    43.5  #endif
    43.6  
    43.7 -#define ERROR(_m, _a...)                        \
    43.8 -do {                                            \
    43.9 -    int __saved_errno = errno;                  \
   43.10 -    DPRINTF("ERROR: " _m "\n" , ## _a );        \
   43.11 -    errno = __saved_errno;                      \
   43.12 -} while (0)
   43.13 +char *safe_strerror(int errcode);
   43.14 +void xc_set_error(int code, const char *fmt, ...);
   43.15 +
   43.16 +#define ERROR(_m, _a...)  xc_set_error(XC_INTERNAL_ERROR, _m , ## _a )
   43.17 +#define PERROR(_m, _a...) xc_set_error(XC_INTERNAL_ERROR, _m " (%d = %s)", \
   43.18 +                                       ## _a , errno, safe_strerror(errno))
   43.19  
   43.20  int lock_pages(void *addr, size_t len);
   43.21  void unlock_pages(void *addr, size_t len);
   43.22  
   43.23 -#define PERROR(_m, _a...)                               \
   43.24 -do {                                                    \
   43.25 -    int __saved_errno = errno;                          \
   43.26 -    DPRINTF("ERROR: " _m " (%d = %s)\n" , ## _a ,       \
   43.27 -            __saved_errno, strerror(__saved_errno));    \
   43.28 -    errno = __saved_errno;                              \
   43.29 -} while (0)
   43.30 -
   43.31  static inline void safe_munlock(const void *addr, size_t len)
   43.32  {
   43.33      int saved_errno = errno;
    44.1 --- a/tools/libxc/xenctrl.h	Thu Dec 07 16:18:55 2006 -0700
    44.2 +++ b/tools/libxc/xenctrl.h	Fri Dec 08 09:09:18 2006 -0700
    44.3 @@ -419,6 +419,10 @@ int xc_domain_setmaxmem(int xc_handle,
    44.4                          uint32_t domid,
    44.5                          unsigned int max_memkb);
    44.6  
    44.7 +int xc_domain_set_memmap_limit(int xc_handle,
    44.8 +                               uint32_t domid,
    44.9 +                               unsigned long map_limitkb);
   44.10 +
   44.11  int xc_domain_set_time_offset(int xc_handle,
   44.12                                uint32_t domid,
   44.13                                int32_t time_offset_seconds);
   44.14 @@ -682,4 +686,46 @@ int xc_hvm_set_isa_irq_level(
   44.15  int xc_hvm_set_pci_link_route(
   44.16      int xc_handle, domid_t dom, uint8_t link, uint8_t isa_irq);
   44.17  
   44.18 +
   44.19 +typedef enum {
   44.20 +  XC_ERROR_NONE = 0,
   44.21 +  XC_INTERNAL_ERROR = 1,
   44.22 +  XC_INVALID_KERNEL = 2,
   44.23 +} xc_error_code;
   44.24 +
   44.25 +#define XC_MAX_ERROR_MSG_LEN 1024
   44.26 +typedef struct {
   44.27 +  int code;
   44.28 +  char message[XC_MAX_ERROR_MSG_LEN];
   44.29 +} xc_error;
   44.30 +
   44.31 +/*
   44.32 + * Return a pointer to the last error. This pointer and the
   44.33 + * data pointed to are only valid until the next call to
   44.34 + * libxc.
   44.35 + */
   44.36 +const xc_error const *xc_get_last_error(void);
   44.37 +
   44.38 +/*
   44.39 + * Clear the last error
   44.40 + */
   44.41 +void xc_clear_last_error(void);
   44.42 +
   44.43 +typedef void (*xc_error_handler)(const xc_error const* err);
   44.44 +
   44.45 +/*
   44.46 + * The default error handler which prints to stderr
   44.47 + */
   44.48 +void xc_default_error_handler(const xc_error const* err);
   44.49 +
   44.50 +/*
   44.51 + * Convert an error code into a text description
   44.52 + */
   44.53 +const char *xc_error_code_to_desc(int code);
   44.54 +
   44.55 +/*
   44.56 + * Registers a callback to handle errors
   44.57 + */
   44.58 +xc_error_handler xc_set_error_handler(xc_error_handler handler);
   44.59 +
   44.60  #endif
    45.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Thu Dec 07 16:18:55 2006 -0700
    45.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Fri Dec 08 09:09:18 2006 -0700
    45.3 @@ -29,7 +29,7 @@
    45.4  #define PKG "xen.lowlevel.xc"
    45.5  #define CLS "xc"
    45.6  
    45.7 -static PyObject *xc_error, *zero;
    45.8 +static PyObject *xc_error_obj, *zero;
    45.9  
   45.10  typedef struct {
   45.11      PyObject_HEAD;
   45.12 @@ -40,6 +40,26 @@ typedef struct {
   45.13  static PyObject *dom_op(XcObject *self, PyObject *args,
   45.14                          int (*fn)(int, uint32_t));
   45.15  
   45.16 +static PyObject *pyxc_error_to_exception(void)
   45.17 +{
   45.18 +    PyObject *pyerr;
   45.19 +    const xc_error const *err = xc_get_last_error();
   45.20 +    const char *desc = xc_error_code_to_desc(err->code);
   45.21 +
   45.22 +    if (err->code == XC_ERROR_NONE)
   45.23 +        return PyErr_SetFromErrno(xc_error_obj);
   45.24 +
   45.25 +    if (err->message[0] != '\0')
   45.26 +	pyerr = Py_BuildValue("(iss)", err->code, desc, err->message);
   45.27 +    else
   45.28 +	pyerr = Py_BuildValue("(is)", err->code, desc);
   45.29 +
   45.30 +    xc_clear_last_error();
   45.31 +
   45.32 +    PyErr_SetObject(xc_error_obj, pyerr);
   45.33 +
   45.34 +    return NULL;
   45.35 +}
   45.36  
   45.37  static PyObject *pyxc_domain_dumpcore(XcObject *self, PyObject *args)
   45.38  {
   45.39 @@ -53,7 +73,7 @@ static PyObject *pyxc_domain_dumpcore(Xc
   45.40          return NULL;
   45.41  
   45.42      if (xc_domain_dumpcore(self->xc_handle, dom, corefile) != 0)
   45.43 -        return PyErr_SetFromErrno(xc_error);
   45.44 +        return pyxc_error_to_exception();
   45.45      
   45.46      Py_INCREF(zero);
   45.47      return zero;
   45.48 @@ -101,13 +121,13 @@ static PyObject *pyxc_domain_create(XcOb
   45.49  
   45.50      if ( (ret = xc_domain_create(self->xc_handle, ssidref,
   45.51                                   handle, flags, &dom)) < 0 )
   45.52 -        return PyErr_SetFromErrno(xc_error);
   45.53 +        return pyxc_error_to_exception();
   45.54  
   45.55      return PyInt_FromLong(dom);
   45.56  
   45.57  out_exception:
   45.58      errno = EINVAL;
   45.59 -    PyErr_SetFromErrno(xc_error);
   45.60 +    PyErr_SetFromErrno(xc_error_obj);
   45.61      return NULL;
   45.62  }
   45.63  
   45.64 @@ -119,7 +139,7 @@ static PyObject *pyxc_domain_max_vcpus(X
   45.65        return NULL;
   45.66  
   45.67      if (xc_domain_max_vcpus(self->xc_handle, dom, max) != 0)
   45.68 -        return PyErr_SetFromErrno(xc_error);
   45.69 +        return pyxc_error_to_exception();
   45.70      
   45.71      Py_INCREF(zero);
   45.72      return zero;
   45.73 @@ -164,7 +184,7 @@ static PyObject *pyxc_vcpu_setaffinity(X
   45.74      }
   45.75    
   45.76      if ( xc_vcpu_setaffinity(self->xc_handle, dom, vcpu, cpumap) != 0 )
   45.77 -        return PyErr_SetFromErrno(xc_error);
   45.78 +        return pyxc_error_to_exception();
   45.79      
   45.80      Py_INCREF(zero);
   45.81      return zero;
   45.82 @@ -184,7 +204,7 @@ static PyObject *pyxc_domain_setcpuweigh
   45.83          return NULL;
   45.84  
   45.85      if ( xc_domain_setcpuweight(self->xc_handle, dom, cpuweight) != 0 )
   45.86 -        return PyErr_SetFromErrno(xc_error);
   45.87 +        return pyxc_error_to_exception();
   45.88      
   45.89      Py_INCREF(zero);
   45.90      return zero;
   45.91 @@ -215,14 +235,13 @@ static PyObject *pyxc_domain_sethandle(X
   45.92      }
   45.93  
   45.94      if (xc_domain_sethandle(self->xc_handle, dom, handle) < 0)
   45.95 -        return PyErr_SetFromErrno(xc_error);
   45.96 +        return pyxc_error_to_exception();
   45.97      
   45.98      Py_INCREF(zero);
   45.99      return zero;
  45.100  
  45.101  out_exception:
  45.102 -    errno = EINVAL;
  45.103 -    PyErr_SetFromErrno(xc_error);
  45.104 +    PyErr_SetFromErrno(xc_error_obj);
  45.105      return NULL;
  45.106  }
  45.107  
  45.108 @@ -251,7 +270,7 @@ static PyObject *pyxc_domain_getinfo(XcO
  45.109      if (nr_doms < 0)
  45.110      {
  45.111          free(info);
  45.112 -        return PyErr_SetFromErrno(xc_error);
  45.113 +        return pyxc_error_to_exception();
  45.114      }
  45.115  
  45.116      list = PyList_New(nr_doms);
  45.117 @@ -306,10 +325,10 @@ static PyObject *pyxc_vcpu_getinfo(XcObj
  45.118  
  45.119      rc = xc_vcpu_getinfo(self->xc_handle, dom, vcpu, &info);
  45.120      if ( rc < 0 )
  45.121 -        return PyErr_SetFromErrno(xc_error);
  45.122 +        return pyxc_error_to_exception();
  45.123      rc = xc_vcpu_getaffinity(self->xc_handle, dom, vcpu, &cpumap);
  45.124      if ( rc < 0 )
  45.125 -        return PyErr_SetFromErrno(xc_error);
  45.126 +        return pyxc_error_to_exception();
  45.127  
  45.128      info_dict = Py_BuildValue("{s:i,s:i,s:i,s:L,s:i}",
  45.129                                "online",   info.online,
  45.130 @@ -360,9 +379,7 @@ static PyObject *pyxc_linux_build(XcObje
  45.131                          ramdisk, cmdline, features, flags,
  45.132                          store_evtchn, &store_mfn,
  45.133                          console_evtchn, &console_mfn) != 0 ) {
  45.134 -        if (!errno)
  45.135 -             errno = EINVAL;
  45.136 -        return PyErr_SetFromErrno(xc_error);
  45.137 +        return pyxc_error_to_exception();
  45.138      }
  45.139      return Py_BuildValue("{s:i,s:i}", 
  45.140                           "store_mfn", store_mfn,
  45.141 @@ -396,7 +413,7 @@ static PyObject *pyxc_hvm_build(XcObject
  45.142      xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_VCPUS, vcpus);
  45.143  #endif
  45.144      if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 )
  45.145 -        return PyErr_SetFromErrno(xc_error);
  45.146 +        return pyxc_error_to_exception();
  45.147  
  45.148  #if !defined(__ia64__)
  45.149      /* Set up the HVM info table. */
  45.150 @@ -404,7 +421,7 @@ static PyObject *pyxc_hvm_build(XcObject
  45.151                                    PROT_READ | PROT_WRITE,
  45.152                                    HVM_INFO_PFN);
  45.153      if ( va_map == NULL )
  45.154 -        return PyErr_SetFromErrno(xc_error);
  45.155 +        return PyErr_SetFromErrno(xc_error_obj);
  45.156      va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
  45.157      memset(va_hvm, 0, sizeof(*va_hvm));
  45.158      strncpy(va_hvm->signature, "HVM INFO", 8);
  45.159 @@ -442,7 +459,7 @@ static PyObject *pyxc_evtchn_alloc_unbou
  45.160          return NULL;
  45.161  
  45.162      if ( (port = xc_evtchn_alloc_unbound(self->xc_handle, dom, remote_dom)) < 0 )
  45.163 -        return PyErr_SetFromErrno(xc_error);
  45.164 +        return pyxc_error_to_exception();
  45.165  
  45.166      return PyInt_FromLong(port);
  45.167  }
  45.168 @@ -463,7 +480,7 @@ static PyObject *pyxc_physdev_pci_access
  45.169      ret = xc_physdev_pci_access_modify(
  45.170          self->xc_handle, dom, bus, dev, func, enable);
  45.171      if ( ret != 0 )
  45.172 -        return PyErr_SetFromErrno(xc_error);
  45.173 +        return pyxc_error_to_exception();
  45.174  
  45.175      Py_INCREF(zero);
  45.176      return zero;
  45.177 @@ -485,7 +502,7 @@ static PyObject *pyxc_readconsolering(Xc
  45.178  
  45.179      ret = xc_readconsolering(self->xc_handle, &str, &count, clear);
  45.180      if ( ret < 0 )
  45.181 -        return PyErr_SetFromErrno(xc_error);
  45.182 +        return pyxc_error_to_exception();
  45.183  
  45.184      return PyString_FromStringAndSize(str, count);
  45.185  }
  45.186 @@ -515,7 +532,7 @@ static PyObject *pyxc_physinfo(XcObject 
  45.187      int i;
  45.188      
  45.189      if ( xc_physinfo(self->xc_handle, &info) != 0 )
  45.190 -        return PyErr_SetFromErrno(xc_error);
  45.191 +        return pyxc_error_to_exception();
  45.192  
  45.193      *q=0;
  45.194      for(i=0;i<sizeof(info.hw_cap)/4;i++)
  45.195 @@ -553,25 +570,25 @@ static PyObject *pyxc_xeninfo(XcObject *
  45.196      xen_version = xc_version(self->xc_handle, XENVER_version, NULL);
  45.197  
  45.198      if ( xc_version(self->xc_handle, XENVER_extraversion, &xen_extra) != 0 )
  45.199 -        return PyErr_SetFromErrno(xc_error);
  45.200 +        return pyxc_error_to_exception();
  45.201  
  45.202      if ( xc_version(self->xc_handle, XENVER_compile_info, &xen_cc) != 0 )
  45.203 -        return PyErr_SetFromErrno(xc_error);
  45.204 +        return pyxc_error_to_exception();
  45.205  
  45.206      if ( xc_version(self->xc_handle, XENVER_changeset, &xen_chgset) != 0 )
  45.207 -        return PyErr_SetFromErrno(xc_error);
  45.208 +        return pyxc_error_to_exception();
  45.209  
  45.210      if ( xc_version(self->xc_handle, XENVER_capabilities, &xen_caps) != 0 )
  45.211 -        return PyErr_SetFromErrno(xc_error);
  45.212 +        return pyxc_error_to_exception();
  45.213  
  45.214      if ( xc_version(self->xc_handle, XENVER_platform_parameters, &p_parms) != 0 )
  45.215 -        return PyErr_SetFromErrno(xc_error);
  45.216 +        return pyxc_error_to_exception();
  45.217  
  45.218      sprintf(str, "virt_start=0x%lx", p_parms.virt_start);
  45.219  
  45.220      xen_pagesize = xc_version(self->xc_handle, XENVER_pagesize, NULL);
  45.221      if (xen_pagesize < 0 )
  45.222 -        return PyErr_SetFromErrno(xc_error);
  45.223 +        return pyxc_error_to_exception();
  45.224  
  45.225      return Py_BuildValue("{s:i,s:i,s:s,s:s,s:i,s:s,s:s,s:s,s:s,s:s,s:s}",
  45.226                           "xen_major", xen_version >> 16,
  45.227 @@ -604,7 +621,7 @@ static PyObject *pyxc_sedf_domain_set(Xc
  45.228          return NULL;
  45.229     if ( xc_sedf_domain_set(self->xc_handle, domid, period,
  45.230                             slice, latency, extratime,weight) != 0 )
  45.231 -        return PyErr_SetFromErrno(xc_error);
  45.232 +        return pyxc_error_to_exception();
  45.233  
  45.234      Py_INCREF(zero);
  45.235      return zero;
  45.236 @@ -621,7 +638,7 @@ static PyObject *pyxc_sedf_domain_get(Xc
  45.237      
  45.238      if (xc_sedf_domain_get(self->xc_handle, domid, &period,
  45.239                             &slice,&latency,&extratime,&weight))
  45.240 -        return PyErr_SetFromErrno(xc_error);
  45.241 +        return pyxc_error_to_exception();
  45.242  
  45.243      return Py_BuildValue("{s:i,s:L,s:L,s:L,s:i,s:i}",
  45.244                           "domid",    domid,
  45.245 @@ -649,7 +666,7 @@ static PyObject *pyxc_shadow_control(PyO
  45.246      
  45.247      if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0, NULL, 0, NULL) 
  45.248           < 0 )
  45.249 -        return PyErr_SetFromErrno(xc_error);
  45.250 +        return pyxc_error_to_exception();
  45.251      
  45.252      Py_INCREF(zero);
  45.253      return zero;
  45.254 @@ -679,7 +696,7 @@ static PyObject *pyxc_shadow_mem_control
  45.255          op = XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION;
  45.256      }
  45.257      if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0, &mb, 0, NULL) < 0 )
  45.258 -        return PyErr_SetFromErrno(xc_error);
  45.259 +        return pyxc_error_to_exception();
  45.260      
  45.261      mbarg = mb;
  45.262      return Py_BuildValue("i", mbarg);
  45.263 @@ -689,7 +706,7 @@ static PyObject *pyxc_sched_id_get(XcObj
  45.264      
  45.265      int sched_id;
  45.266      if (xc_sched_id(self->xc_handle, &sched_id) != 0)
  45.267 -        return PyErr_SetFromErrno(xc_error);
  45.268 +        return PyErr_SetFromErrno(xc_error_obj);
  45.269  
  45.270      return Py_BuildValue("i", sched_id);
  45.271  }
  45.272 @@ -715,7 +732,7 @@ static PyObject *pyxc_sched_credit_domai
  45.273      sdom.cap = cap;
  45.274  
  45.275      if ( xc_sched_credit_domain_set(self->xc_handle, domid, &sdom) != 0 )
  45.276 -        return PyErr_SetFromErrno(xc_error);
  45.277 +        return pyxc_error_to_exception();
  45.278  
  45.279      Py_INCREF(zero);
  45.280      return zero;
  45.281 @@ -730,7 +747,7 @@ static PyObject *pyxc_sched_credit_domai
  45.282          return NULL;
  45.283      
  45.284      if ( xc_sched_credit_domain_get(self->xc_handle, domid, &sdom) != 0 )
  45.285 -        return PyErr_SetFromErrno(xc_error);
  45.286 +        return pyxc_error_to_exception();
  45.287  
  45.288      return Py_BuildValue("{s:H,s:H}",
  45.289                           "weight",  sdom.weight,
  45.290 @@ -746,7 +763,22 @@ static PyObject *pyxc_domain_setmaxmem(X
  45.291          return NULL;
  45.292  
  45.293      if (xc_domain_setmaxmem(self->xc_handle, dom, maxmem_kb) != 0)
  45.294 -        return PyErr_SetFromErrno(xc_error);
  45.295 +        return pyxc_error_to_exception();
  45.296 +    
  45.297 +    Py_INCREF(zero);
  45.298 +    return zero;
  45.299 +}
  45.300 +
  45.301 +static PyObject *pyxc_domain_set_memmap_limit(XcObject *self, PyObject *args)
  45.302 +{
  45.303 +    uint32_t dom;
  45.304 +    unsigned int maplimit_kb;
  45.305 +
  45.306 +    if ( !PyArg_ParseTuple(args, "ii", &dom, &maplimit_kb) )
  45.307 +        return NULL;
  45.308 +
  45.309 +    if ( xc_domain_set_memmap_limit(self->xc_handle, dom, maplimit_kb) != 0 )
  45.310 +        return pyxc_error_to_exception();
  45.311      
  45.312      Py_INCREF(zero);
  45.313      return zero;
  45.314 @@ -773,7 +805,7 @@ static PyObject *pyxc_domain_memory_incr
  45.315      if ( xc_domain_memory_increase_reservation(self->xc_handle, dom, 
  45.316                                                 nr_extents, extent_order, 
  45.317                                                 address_bits, NULL) )
  45.318 -        return PyErr_SetFromErrno(xc_error);
  45.319 +        return pyxc_error_to_exception();
  45.320      
  45.321      Py_INCREF(zero);
  45.322      return zero;
  45.323 @@ -795,7 +827,7 @@ static PyObject *pyxc_domain_ioport_perm
  45.324      ret = xc_domain_ioport_permission(
  45.325          self->xc_handle, dom, first_port, nr_ports, allow_access);
  45.326      if ( ret != 0 )
  45.327 -        return PyErr_SetFromErrno(xc_error);
  45.328 +        return pyxc_error_to_exception();
  45.329  
  45.330      Py_INCREF(zero);
  45.331      return zero;
  45.332 @@ -818,7 +850,7 @@ static PyObject *pyxc_domain_irq_permiss
  45.333      ret = xc_domain_irq_permission(
  45.334          xc->xc_handle, dom, pirq, allow_access);
  45.335      if ( ret != 0 )
  45.336 -        return PyErr_SetFromErrno(xc_error);
  45.337 +        return pyxc_error_to_exception();
  45.338  
  45.339      Py_INCREF(zero);
  45.340      return zero;
  45.341 @@ -841,7 +873,7 @@ static PyObject *pyxc_domain_iomem_permi
  45.342      ret = xc_domain_iomem_permission(
  45.343          xc->xc_handle, dom, first_pfn, nr_pfns, allow_access);
  45.344      if ( ret != 0 )
  45.345 -        return PyErr_SetFromErrno(xc_error);
  45.346 +        return pyxc_error_to_exception();
  45.347  
  45.348      Py_INCREF(zero);
  45.349      return zero;
  45.350 @@ -881,7 +913,7 @@ static PyObject *dom_op(XcObject *self, 
  45.351          return NULL;
  45.352  
  45.353      if (fn(self->xc_handle, dom) != 0)
  45.354 -        return PyErr_SetFromErrno(xc_error);
  45.355 +        return pyxc_error_to_exception();
  45.356  
  45.357      Py_INCREF(zero);
  45.358      return zero;
  45.359 @@ -1135,6 +1167,14 @@ static PyMethodDef pyxc_methods[] = {
  45.360        " maxmem_kb [int]: .\n"
  45.361        "Returns: [int] 0 on success; -1 on error.\n" },
  45.362  
  45.363 +    { "domain_set_memmap_limit", 
  45.364 +      (PyCFunction)pyxc_domain_set_memmap_limit, 
  45.365 +      METH_VARARGS, "\n"
  45.366 +      "Set a domain's physical memory mappping limit\n"
  45.367 +      " dom [int]: Identifier of domain.\n"
  45.368 +      " map_limitkb [int]: .\n"
  45.369 +      "Returns: [int] 0 on success; -1 on error.\n" },
  45.370 +
  45.371      { "domain_memory_increase_reservation", 
  45.372        (PyCFunction)pyxc_domain_memory_increase_reservation, 
  45.373        METH_VARARGS | METH_KEYWORDS, "\n"
  45.374 @@ -1210,7 +1250,7 @@ static int
  45.375  PyXc_init(XcObject *self, PyObject *args, PyObject *kwds)
  45.376  {
  45.377      if ((self->xc_handle = xc_interface_open()) == -1) {
  45.378 -        PyErr_SetFromErrno(xc_error);
  45.379 +        pyxc_error_to_exception();
  45.380          return -1;
  45.381      }
  45.382  
  45.383 @@ -1283,7 +1323,7 @@ PyMODINIT_FUNC initxc(void)
  45.384      if (m == NULL)
  45.385        return;
  45.386  
  45.387 -    xc_error = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
  45.388 +    xc_error_obj = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
  45.389      zero = PyInt_FromLong(0);
  45.390  
  45.391      /* KAF: This ensures that we get debug output in a timely manner. */
  45.392 @@ -1293,8 +1333,8 @@ PyMODINIT_FUNC initxc(void)
  45.393      Py_INCREF(&PyXcType);
  45.394      PyModule_AddObject(m, CLS, (PyObject *)&PyXcType);
  45.395  
  45.396 -    Py_INCREF(xc_error);
  45.397 -    PyModule_AddObject(m, "Error", xc_error);
  45.398 +    Py_INCREF(xc_error_obj);
  45.399 +    PyModule_AddObject(m, "Error", xc_error_obj);
  45.400  
  45.401      /* Expose some libxc constants to Python */
  45.402      PyModule_AddIntConstant(m, "XEN_SCHEDULER_SEDF", XEN_SCHEDULER_SEDF);
    46.1 --- a/tools/python/xen/web/httpserver.py	Thu Dec 07 16:18:55 2006 -0700
    46.2 +++ b/tools/python/xen/web/httpserver.py	Fri Dec 08 09:09:18 2006 -0700
    46.3 @@ -264,7 +264,32 @@ class HttpServerRequest(http.HttpRequest
    46.4              s += x + "/"
    46.5              self.write(' <a href="%s">%s</a>/' % (s, x))
    46.6          self.write("</h1>")
    46.7 -        
    46.8 +
    46.9 +class HttpServerClient:
   46.10 +
   46.11 +    def __init__(self, server, sock, addr):
   46.12 +        self.server = server
   46.13 +        self.sock = sock
   46.14 +        self.addr = addr
   46.15 +
   46.16 +    def process(self):
   46.17 +        thread = threading.Thread(target=self.doProcess)
   46.18 +        thread.setDaemon(True)
   46.19 +        thread.start()
   46.20 +
   46.21 +    def doProcess(self):
   46.22 +        try:
   46.23 +            rp = RequestProcessor(self.server, self.sock, self.addr)
   46.24 +            rp.process()
   46.25 +        except SystemExit:
   46.26 +            raise
   46.27 +        except Exception, ex:
   46.28 +            print 'HttpServer>processRequest> exception: ', ex
   46.29 +            try:
   46.30 +                self.sock.close()
   46.31 +            except:
   46.32 +                pass
   46.33 +
   46.34  class HttpServer:
   46.35  
   46.36      backlog = 5
   46.37 @@ -286,8 +311,8 @@ class HttpServer:
   46.38  
   46.39          while not self.closed:
   46.40              (sock, addr) = self.accept()
   46.41 -            self.processRequest(sock, addr)
   46.42 -
   46.43 +            cl = HttpServerClient(self, sock, addr)
   46.44 +            cl.process()
   46.45  
   46.46      def stop(self):
   46.47          self.close()
   46.48 @@ -314,19 +339,6 @@ class HttpServer:
   46.49          except:
   46.50              pass
   46.51  
   46.52 -    def processRequest(self, sock, addr):
   46.53 -        try:
   46.54 -            rp = RequestProcessor(self, sock, addr)
   46.55 -            rp.process()
   46.56 -        except SystemExit:
   46.57 -            raise
   46.58 -        except Exception, ex:
   46.59 -            print 'HttpServer>processRequest> exception: ', ex
   46.60 -            try:
   46.61 -                sock.close()
   46.62 -            except:
   46.63 -                pass
   46.64 -
   46.65      def getServerAddr(self):
   46.66          return (socket.gethostname(), self.port)
   46.67  
    47.1 --- a/tools/python/xen/xend/XendAPI.py	Thu Dec 07 16:18:55 2006 -0700
    47.2 +++ b/tools/python/xen/xend/XendAPI.py	Fri Dec 08 09:09:18 2006 -0700
    47.3 @@ -821,8 +821,9 @@ class XendAPI:
    47.4          dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    47.5          return xen_api_todo()
    47.6      
    47.7 -    def VM_set_name_label(self, session, vm_ref):
    47.8 +    def VM_set_name_label(self, session, vm_ref, label):
    47.9          dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
   47.10 +        dom.setName(label)
   47.11          return xen_api_success_void()
   47.12      
   47.13      def VM_set_name_description(self, session, vm_ref):
   47.14 @@ -1035,8 +1036,8 @@ class XendAPI:
   47.15      #       regular xm created VBDs
   47.16  
   47.17      VBD_attr_ro = ['image',
   47.18 -                   'IO_bandwidth_incoming_kbs',
   47.19 -                   'IO_bandwidth_outgoing_kbs']
   47.20 +                   'io_read_kbs',
   47.21 +                   'io_write_kbs']
   47.22      VBD_attr_rw = ['VM',
   47.23                     'VDI',
   47.24                     'device',
   47.25 @@ -1056,7 +1057,16 @@ class XendAPI:
   47.26          cfg = vm.get_dev_xenapi_config('vbd', vbd_ref)
   47.27          if not cfg:
   47.28              return xen_api_error(XEND_ERROR_VBD_INVALID)
   47.29 -        return xen_api_success(cfg)
   47.30 +
   47.31 +        valid_vbd_keys = self.VBD_attr_ro + self.VBD_attr_rw + \
   47.32 +                         self.Base_attr_ro + self.Base_attr_rw
   47.33 +
   47.34 +        return_cfg = {}
   47.35 +        for k in cfg.keys():
   47.36 +            if k in valid_vbd_keys:
   47.37 +                return_cfg[k] = cfg[k]
   47.38 +                
   47.39 +        return xen_api_success(return_cfg)
   47.40  
   47.41      def VBD_media_change(self, session, vbd_ref, vdi_ref):
   47.42          return xen_api_error(XEND_ERROR_UNSUPPORTED)
   47.43 @@ -1112,10 +1122,8 @@ class XendAPI:
   47.44      # Xen API: Class VIF
   47.45      # ----------------------------------------------------------------
   47.46  
   47.47 -    VIF_attr_ro = ['network_read_kbs',
   47.48 -                   'network_write_kbs',
   47.49 -                   'IO_bandwidth_incoming_kbs',
   47.50 -                   'IO_bandwidth_outgoing_kbs']
   47.51 +    VIF_attr_ro = ['io_read_kbs',
   47.52 +                   'io_write_kbs']
   47.53      VIF_attr_rw = ['name',
   47.54                     'type',
   47.55                     'device',
   47.56 @@ -1135,13 +1143,16 @@ class XendAPI:
   47.57          cfg = vm.get_dev_xenapi_config('vif', vif_ref)
   47.58          if not cfg:
   47.59              return xen_api_error(XEND_ERROR_VIF_INVALID)
   47.60 +        
   47.61          valid_vif_keys = self.VIF_attr_ro + self.VIF_attr_rw + \
   47.62                           self.Base_attr_ro + self.Base_attr_rw
   47.63 +
   47.64 +        return_cfg = {}
   47.65          for k in cfg.keys():
   47.66 -            if k not in valid_vif_keys:
   47.67 -                del cfg[k]
   47.68 +            if k in valid_vif_keys:
   47.69 +                return_cfg[k] = cfg[k]
   47.70              
   47.71 -        return xen_api_success(cfg)
   47.72 +        return xen_api_success(return_cfg)
   47.73  
   47.74      # class methods
   47.75      def VIF_create(self, session, vif_struct):
    48.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Thu Dec 07 16:18:55 2006 -0700
    48.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Fri Dec 08 09:09:18 2006 -0700
    48.3 @@ -137,7 +137,6 @@ def restore(xd, fd, dominfo = None, paus
    48.4      vmconfig = p.get_val()
    48.5  
    48.6      if dominfo:
    48.7 -        dominfo.update(XendConfig(sxp_obj = vmconfig), refresh = False)
    48.8          dominfo.resume()
    48.9      else:
   48.10          dominfo = xd.restore_(vmconfig)
    49.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Dec 07 16:18:55 2006 -0700
    49.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Dec 08 09:09:18 2006 -0700
    49.3 @@ -42,6 +42,39 @@ def reverse_dict(adict):
    49.4  def bool0(v):
    49.5      return v != '0' and bool(v)
    49.6  
    49.7 +# Recursively copy a data struct, scrubbing out VNC passwords.
    49.8 +# Will scrub any dict entry with a key of 'vncpasswd' or any
    49.9 +# 2-element list whose first member is 'vncpasswd'. It will
   49.10 +# also scrub a string matching '(vncpasswd XYZ)'. Everything
   49.11 +# else is no-op passthrough
   49.12 +def scrub_password(data):
   49.13 +    if type(data) == dict or type(data) == XendConfig:
   49.14 +        scrubbed = {}
   49.15 +        for key in data.keys():
   49.16 +            if key == "vncpasswd":
   49.17 +                scrubbed[key] = "XXXXXXXX"
   49.18 +            else:
   49.19 +                scrubbed[key] = scrub_password(data[key])
   49.20 +        return scrubbed
   49.21 +    elif type(data) == list:
   49.22 +        if len(data) == 2 and type(data[0]) == str and data[0] == 'vncpasswd':
   49.23 +            return ['vncpasswd', 'XXXXXXXX']
   49.24 +        else:
   49.25 +            scrubbed = []
   49.26 +            for entry in data:
   49.27 +                scrubbed.append(scrub_password(entry))
   49.28 +            return scrubbed
   49.29 +    elif type(data) == tuple:
   49.30 +        scrubbed = []
   49.31 +        for entry in data:
   49.32 +            scrubbed.append(scrub_password(entry))
   49.33 +        return tuple(scrubbed)
   49.34 +    elif type(data) == str:
   49.35 +        return re.sub(r'\(vncpasswd\s+[^\)]+\)','(vncpasswd XXXXXX)', data)
   49.36 +    else:
   49.37 +        return data
   49.38 +
   49.39 +
   49.40  # Mapping from XendConfig configuration keys to the old
   49.41  # legacy configuration keys that map directly.
   49.42  
   49.43 @@ -269,7 +302,7 @@ class XendConfig(dict):
   49.44              # output from xc.domain_getinfo
   49.45              self._dominfo_to_xapi(dominfo)
   49.46  
   49.47 -        log.debug('XendConfig.init: %s' % self)
   49.48 +        log.debug('XendConfig.init: %s' % scrub_password(self))
   49.49  
   49.50          # validators go here
   49.51          self.validate()
   49.52 @@ -353,10 +386,15 @@ class XendConfig(dict):
   49.53          if self['builder'] not in ('hvm', 'linux'):
   49.54              raise XendConfigError('Invalid builder configuration')
   49.55  
   49.56 +    def _vcpus_sanity_check(self):
   49.57 +        if self.get('vcpus_number') != None:
   49.58 +            self['vcpu_avail'] = (1 << self['vcpus_number']) - 1
   49.59 +
   49.60      def validate(self):
   49.61          self._memory_sanity_check()
   49.62          self._actions_sanity_check()
   49.63          self._builder_sanity_check()
   49.64 +        self._vcpus_sanity_check()
   49.65  
   49.66      def _dominfo_to_xapi(self, dominfo):
   49.67          self['domid'] = dominfo['domid']
   49.68 @@ -471,14 +509,8 @@ class XendConfig(dict):
   49.69                  
   49.70                  log.debug("XendConfig: reading device: %s" % pci_devs)
   49.71              else:
   49.72 -                for opt, val in config[1:]:
   49.73 -                    dev_info[opt] = val
   49.74 -                log.debug("XendConfig: reading device: %s" % dev_info)
   49.75 -                # create uuid if it doesn't
   49.76 -                dev_uuid = dev_info.get('uuid', uuid.createString())
   49.77 -                dev_info['uuid'] = dev_uuid
   49.78 -                cfg['devices'][dev_uuid] = (dev_type, dev_info)
   49.79 -
   49.80 +                self.device_add(dev_type, cfg_sxp = config, target = cfg)
   49.81 +                log.debug("XendConfig: reading device: %s" % scrub_password(dev_info))
   49.82  
   49.83          # Extract missing data from configuration entries
   49.84          image_sxp = sxp.child_value(sxp_cfg, 'image', [])
   49.85 @@ -600,6 +632,9 @@ class XendConfig(dict):
   49.86          self['memory_dynamic_max'] = self['memory_static_max']
   49.87          self['memory_dynamic_min'] = self['memory_static_min']
   49.88  
   49.89 +        # make sure max_vcpu_id is set correctly
   49.90 +        self['max_vcpu_id'] = self['vcpus_number'] - 1
   49.91 +
   49.92          # set device references in the configuration
   49.93          self['devices'] = cfg.get('devices', {})
   49.94          
   49.95 @@ -675,13 +710,14 @@ class XendConfig(dict):
   49.96                  else:
   49.97                      self[sxp_arg] = val
   49.98  
   49.99 +        _set_cfg_if_exists('bootloader')
  49.100          _set_cfg_if_exists('shadow_memory')
  49.101          _set_cfg_if_exists('security')
  49.102          _set_cfg_if_exists('features')
  49.103          _set_cfg_if_exists('on_xend_stop')
  49.104          _set_cfg_if_exists('on_xend_start')
  49.105          _set_cfg_if_exists('vcpu_avail')
  49.106 -        _set_cfg_if_exists('max_vcpu_id') # TODO, deprecated?
  49.107 +        _set_cfg_if_exists('max_vcpu_id') # needed for vcpuDomDetails
  49.108          
  49.109          # Parse and store runtime configuration 
  49.110          _set_cfg_if_exists('start_time')
  49.111 @@ -828,7 +864,8 @@ class XendConfig(dict):
  49.112  
  49.113          return sxpr    
  49.114      
  49.115 -    def device_add(self, dev_type, cfg_sxp = None, cfg_xenapi = None):
  49.116 +    def device_add(self, dev_type, cfg_sxp = None, cfg_xenapi = None,
  49.117 +                   target = None):
  49.118          """Add a device configuration in SXP format or XenAPI struct format.
  49.119  
  49.120          For SXP, it could be either:
  49.121 @@ -843,9 +880,14 @@ class XendConfig(dict):
  49.122          @param cfg_sxp: SXP configuration object
  49.123          @type cfg_xenapi: dict
  49.124          @param cfg_xenapi: A device configuration from Xen API (eg. vbd,vif)
  49.125 +        @param target: write device information to
  49.126 +        @type target: None or a dictionary
  49.127          @rtype: string
  49.128          @return: Assigned UUID of the device.
  49.129          """
  49.130 +        if target == None:
  49.131 +            target = self
  49.132 +        
  49.133          if dev_type not in XendDevices.valid_devices() and \
  49.134             dev_type not in XendDevices.pseudo_devices():        
  49.135              raise XendConfigError("XendConfig: %s not a valid device type" %
  49.136 @@ -875,10 +917,12 @@ class XendConfig(dict):
  49.137              except ValueError:
  49.138                  pass # SXP has no options for this device
  49.139  
  49.140 -            
  49.141 -            def _get_config_ipaddr(config):
  49.142 +
  49.143 +            # Special handling for certain device parameters.
  49.144 +
  49.145 +            def _get_config_ipaddr(cfg):
  49.146                  val = []
  49.147 -                for ipaddr in sxp.children(config, elt='ip'):
  49.148 +                for ipaddr in sxp.children(cfg, elt='ip'):
  49.149                      val.append(sxp.child0(ipaddr))
  49.150                  return val
  49.151  
  49.152 @@ -897,11 +941,18 @@ class XendConfig(dict):
  49.153              dev_info['uuid'] = dev_uuid
  49.154  
  49.155              # store dev references by uuid for certain device types
  49.156 -            self['devices'][dev_uuid] = (dev_type, dev_info)
  49.157 +            target['devices'][dev_uuid] = (dev_type, dev_info)
  49.158              if dev_type in ('vif', 'vbd', 'vtpm'):
  49.159 -                self['%s_refs' % dev_type].append(dev_uuid)
  49.160 +                param = '%s_refs' % dev_type
  49.161 +                if param not in target:
  49.162 +                    target[param] = []
  49.163 +                if dev_uuid not in target[param]:
  49.164 +                    target[param].append(dev_uuid)
  49.165              elif dev_type in ('tap',):
  49.166 -                self['vbd_refs'].append(dev_uuid)
  49.167 +                if 'vbd_refs' not in target:
  49.168 +                    target['vbd_refs'] = []
  49.169 +                if dev_uuid not in target['vbd_refs']:
  49.170 +                    target['vbd_refs'].append(dev_uuid)
  49.171  
  49.172              return dev_uuid
  49.173  
    50.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Dec 07 16:18:55 2006 -0700
    50.2 +++ b/tools/python/xen/xend/XendDomain.py	Fri Dec 08 09:09:18 2006 -0700
    50.3 @@ -641,17 +641,22 @@ class XendDomain:
    50.4          return (self.get_vm_with_dev_uuid(klass, dev_uuid) != None)
    50.5  
    50.6      def do_legacy_api_with_uuid(self, fn, vm_uuid, *args, **kwargs):
    50.7 +        dom = self.uuid_to_dom(vm_uuid)
    50.8 +        fn(dom, *args, **kwargs)
    50.9 +
   50.10 +    def uuid_to_dom(self, vm_uuid):
   50.11          self.domains_lock.acquire()
   50.12          try:
   50.13              for domid, dom in self.domains.items():
   50.14 -                if dom.get_uuid == vm_uuid:
   50.15 -                    return fn(domid, *args, **kwargs)
   50.16 +                if dom.get_uuid() == vm_uuid:
   50.17 +                    return domid
   50.18                      
   50.19              if vm_uuid in self.managed_domains:
   50.20                  domid = self.managed_domains[vm_uuid].getDomid()
   50.21 -                if domid == None:
   50.22 -                    domid = self.managed_domains[vm_uuid].getName()
   50.23 -                return fn(domid, *args, **kwargs)
   50.24 +                if domid is None:
   50.25 +                    return self.managed_domains[vm_uuid].getName()
   50.26 +                else:
   50.27 +                    return domid
   50.28              
   50.29              raise XendInvalidDomain("Domain does not exist")
   50.30          finally:
   50.31 @@ -808,7 +813,7 @@ class XendDomain:
   50.32                      raise XendError("Cannot save privileged domain %s" % domname)
   50.33  
   50.34                  if dominfo.state != DOM_STATE_HALTED:
   50.35 -                    raise XendError("Cannot suspend domain that is not running.")
   50.36 +                    raise XendError("Cannot resume domain that is not halted.")
   50.37  
   50.38                  dom_uuid = dominfo.get_uuid()
   50.39                  chkpath = self._managed_check_point_path(dom_uuid)
    51.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Dec 07 16:18:55 2006 -0700
    51.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Dec 08 09:09:18 2006 -0700
    51.3 @@ -40,6 +40,7 @@ from xen.util import security
    51.4  from xen.xend import balloon, sxp, uuid, image, arch
    51.5  from xen.xend import XendRoot, XendNode, XendConfig
    51.6  
    51.7 +from xen.xend.XendConfig import scrub_password
    51.8  from xen.xend.XendBootloader import bootloader
    51.9  from xen.xend.XendError import XendError, VmError
   51.10  from xen.xend.XendDevices import XendDevices
   51.11 @@ -148,7 +149,7 @@ def create(config):
   51.12      @raise VmError: Invalid configuration or failure to start.
   51.13      """
   51.14  
   51.15 -    log.debug("XendDomainInfo.create(%s)", config)
   51.16 +    log.debug("XendDomainInfo.create(%s)", scrub_password(config))
   51.17      vm = XendDomainInfo(XendConfig.XendConfig(sxp_obj = config))
   51.18      try:
   51.19          vm.start()
   51.20 @@ -175,7 +176,7 @@ def recreate(info, priv):
   51.21      @raise XendError: Errors with configuration.
   51.22      """
   51.23  
   51.24 -    log.debug("XendDomainInfo.recreate(%s)", info)
   51.25 +    log.debug("XendDomainInfo.recreate(%s)", scrub_password(info))
   51.26  
   51.27      assert not info['dying']
   51.28  
   51.29 @@ -257,7 +258,7 @@ def restore(config):
   51.30      @raise XendError: Errors with configuration.
   51.31      """
   51.32  
   51.33 -    log.debug("XendDomainInfo.restore(%s)", config)
   51.34 +    log.debug("XendDomainInfo.restore(%s)", scrub_password(config))
   51.35      vm = XendDomainInfo(XendConfig.XendConfig(sxp_obj = config),
   51.36                          resume = True)
   51.37      try:
   51.38 @@ -280,7 +281,7 @@ def createDormant(domconfig):
   51.39      @raise XendError: Errors with configuration.    
   51.40      """
   51.41      
   51.42 -    log.debug("XendDomainInfo.createDormant(%s)", domconfig)
   51.43 +    log.debug("XendDomainInfo.createDormant(%s)", scrub_password(domconfig))
   51.44      
   51.45      # domid does not make sense for non-running domains.
   51.46      domconfig.pop('domid', None)
   51.47 @@ -520,11 +521,11 @@ class XendDomainInfo:
   51.48          @param dev_config: device configuration
   51.49          @type  dev_config: SXP object (parsed config)
   51.50          """
   51.51 -        log.debug("XendDomainInfo.device_create: %s" % dev_config)
   51.52 +        log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config))
   51.53          dev_type = sxp.name(dev_config)
   51.54          dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config)
   51.55          dev_config_dict = self.info['devices'][dev_uuid][1]
   51.56 -        log.debug("XendDomainInfo.device_create: %s" % dev_config_dict)
   51.57 +        log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config_dict))
   51.58          devid = self._createDevice(dev_type, dev_config_dict)
   51.59          self._waitForDevice(dev_type, devid)
   51.60          return self.getDeviceController(dev_type).sxpr(devid)
   51.61 @@ -746,7 +747,7 @@ class XendDomainInfo:
   51.62  
   51.63          to_store.update(self._vcpuDomDetails())
   51.64  
   51.65 -        log.debug("Storing domain details: %s", to_store)
   51.66 +        log.debug("Storing domain details: %s", scrub_password(to_store))
   51.67  
   51.68          self._writeDom(to_store)
   51.69  
   51.70 @@ -875,10 +876,18 @@ class XendDomainInfo:
   51.71  
   51.72      def setVCpuCount(self, vcpus):
   51.73          self.info['vcpu_avail'] = (1 << vcpus) - 1
   51.74 -        self.info['vcpus_number'] = vcpus
   51.75          self.storeVm('vcpu_avail', self.info['vcpu_avail'])
   51.76 -        self.storeVm('vcpus', self.info['vcpus_number'])
   51.77 -        self._writeDom(self._vcpuDomDetails())
   51.78 +        # update dom differently depending on whether we are adjusting
   51.79 +        # vcpu number up or down, otherwise _vcpuDomDetails does not
   51.80 +        # disable the vcpus
   51.81 +        if self.info['vcpus_number'] > vcpus:
   51.82 +            # decreasing
   51.83 +            self._writeDom(self._vcpuDomDetails())
   51.84 +            self.info['vcpus_number'] = vcpus
   51.85 +        else:
   51.86 +            # same or increasing
   51.87 +            self.info['vcpus_number'] = vcpus
   51.88 +            self._writeDom(self._vcpuDomDetails())
   51.89  
   51.90      def getLabel(self):
   51.91          return security.get_security_info(self.info, 'label')
   51.92 @@ -1188,7 +1197,7 @@ class XendDomainInfo:
   51.93          """
   51.94          for (devclass, config) in self.info.get('devices', {}).values():
   51.95              if devclass in XendDevices.valid_devices():            
   51.96 -                log.info("createDevice: %s : %s" % (devclass, config))
   51.97 +                log.info("createDevice: %s : %s" % (devclass, scrub_password(config)))
   51.98                  self._createDevice(devclass, config)
   51.99  
  51.100          if self.image:
  51.101 @@ -1326,7 +1335,7 @@ class XendDomainInfo:
  51.102  
  51.103          # if we have a boot loader but no image, then we need to set things
  51.104          # up by running the boot loader non-interactively
  51.105 -        if self.info.get('bootloader') and self.info.get('image'):
  51.106 +        if self.info.get('bootloader'):
  51.107              self._configureBootloader()
  51.108  
  51.109          if not self._infoIsSet('image'):
  51.110 @@ -1532,11 +1541,17 @@ class XendDomainInfo:
  51.111          if not self.info.get('bootloader'):
  51.112              return
  51.113          blcfg = None
  51.114 +
  51.115          # FIXME: this assumes that we want to use the first disk device
  51.116 -        for devuuid, (devtype, devinfo) in self.info.all_devices_sxpr():
  51.117 +        for (devtype, devinfo) in self.info.all_devices_sxpr():
  51.118              if not devtype or not devinfo or devtype not in ('vbd', 'tap'):
  51.119                  continue
  51.120 -            disk = devinfo.get('uname')
  51.121 +            disk = None
  51.122 +            for param in devinfo:
  51.123 +                if param[0] == 'uname':
  51.124 +                    disk = param[1]
  51.125 +                    break
  51.126 +
  51.127              if disk is None:
  51.128                  continue
  51.129              fn = blkdev_uname_to_file(disk)
  51.130 @@ -1661,7 +1676,7 @@ class XendDomainInfo:
  51.131          if not self._readVm('xend/restart_count'):
  51.132              to_store['xend/restart_count'] = str(0)
  51.133  
  51.134 -        log.debug("Storing VM details: %s", to_store)
  51.135 +        log.debug("Storing VM details: %s", scrub_password(to_store))
  51.136  
  51.137          self._writeVm(to_store)
  51.138          self._setVmPermissions()
  51.139 @@ -1773,13 +1788,13 @@ class XendDomainInfo:
  51.140          return dom_uuid
  51.141      
  51.142      def get_memory_static_max(self):
  51.143 -        return self.info.get('memory_static_max')
  51.144 +        return self.info.get('memory_static_max', 0)
  51.145      def get_memory_static_min(self):
  51.146 -        return self.info.get('memory_static_min')
  51.147 +        return self.info.get('memory_static_min', 0)
  51.148      def get_memory_dynamic_max(self):
  51.149 -        return self.info.get('memory_dynamic_min')
  51.150 +        return self.info.get('memory_dynamic_max', 0)
  51.151      def get_memory_dynamic_min(self):
  51.152 -        return self.info.get('memory_dynamic_max')
  51.153 +        return self.info.get('memory_dynamic_min', 0)
  51.154      
  51.155      
  51.156      def get_vcpus_policy(self):
  51.157 @@ -1813,7 +1828,7 @@ class XendDomainInfo:
  51.158      def get_builder(self):
  51.159          return self.info.get('builder', 0)
  51.160      def get_boot_method(self):
  51.161 -        return self.info.get('boot_method', '')
  51.162 +        return self.info.get('boot_method', XEN_API_BOOT_TYPE[2])
  51.163      def get_kernel_image(self):
  51.164          return self.info.get('kernel_kernel', '')
  51.165      def get_kernel_initrd(self):
  51.166 @@ -1823,7 +1838,7 @@ class XendDomainInfo:
  51.167      def get_grub_cmdline(self):
  51.168          return '' # TODO
  51.169      def get_pci_bus(self):
  51.170 -        return 0 # TODO
  51.171 +        return '' # TODO
  51.172      def get_tools_version(self):
  51.173          return {} # TODO
  51.174      def get_other_config(self):
  51.175 @@ -1918,18 +1933,16 @@ class XendDomainInfo:
  51.176                      
  51.177              config['network'] = '' # Invalid for Xend
  51.178              config['MTU'] = 1500 # TODO
  51.179 -            config['network_read_kbs'] = 0.0
  51.180 -            config['network_write_kbs'] = 0.0
  51.181 -            config['IO_bandwidth_incoming_kbs'] = 0.0
  51.182 -            config['IO_bandwidth_outgoing_kbs'] = 0.0
  51.183 +            config['io_read_kbs'] = 0.0
  51.184 +            config['io_write_kbs'] = 0.0
  51.185  
  51.186          if dev_class == 'vbd':
  51.187 -            config['VDI'] = '' # TODO
  51.188 +            config['VDI'] = config.get('VDI', '')
  51.189              config['device'] = config.get('dev', '')
  51.190              config['driver'] = 'paravirtualised' # TODO
  51.191              config['image'] = config.get('uname', '')
  51.192 -            config['IO_bandwidth_incoming_kbs'] = 0.0
  51.193 -            config['IO_bandwidth_outgoing_kbs'] = 0.0
  51.194 +            config['io_read_kbs'] = 0.0
  51.195 +            config['io_write_kbs'] = 0.0
  51.196              if config['mode'] == 'r':
  51.197                  config['mode'] = 'RO'
  51.198              else:
  51.199 @@ -2043,27 +2056,7 @@ class XendDomainInfo:
  51.200          return dev_uuid
  51.201  
  51.202      def has_device(self, dev_class, dev_uuid):
  51.203 -        return (dev_uuid in self.info['%s_refs' % dev_class])
  51.204 -
  51.205 -    """
  51.206 -        def stateChar(name):
  51.207 -            if name in self.info:
  51.208 -                if self.info[name]:
  51.209 -                    return name[0]
  51.210 -                else:
  51.211 -                    return '-'
  51.212 -            else:
  51.213 -                return '?'
  51.214 -
  51.215 -        state = reduce(lambda x, y: x + y, map(stateChar, DOM_STATES_OLD))
  51.216 -
  51.217 -        sxpr.append(['state', state])
  51.218 -
  51.219 -        if self.store_mfn:
  51.220 -            sxpr.append(['store_mfn', self.store_mfn])
  51.221 -        if self.console_mfn:
  51.222 -            sxpr.append(['console_mfn', self.console_mfn])
  51.223 -    """
  51.224 +        return (dev_uuid in self.info['%s_refs' % dev_class.lower()])
  51.225  
  51.226      def __str__(self):
  51.227          return '<domain id=%s name=%s memory=%s state=%s>' % \
    52.1 --- a/tools/python/xen/xend/image.py	Thu Dec 07 16:18:55 2006 -0700
    52.2 +++ b/tools/python/xen/xend/image.py	Fri Dec 08 09:09:18 2006 -0700
    52.3 @@ -338,7 +338,7 @@ class HVMImageHandler(ImageHandler):
    52.4          
    52.5          for devuuid, (devtype, devinfo) in deviceConfig.items():
    52.6              if devtype == 'vbd':
    52.7 -                uname = devinfo['uname']
    52.8 +                uname = devinfo.get('uname')
    52.9                  if uname is not None and 'file:' in uname:
   52.10                      (_, vbdparam) = string.split(uname, ':', 1)
   52.11                      if not os.path.isfile(vbdparam):
   52.12 @@ -548,6 +548,14 @@ class X86_HVM_ImageHandler(HVMImageHandl
   52.13          return max(4 * (256 * self.vm.getVCpuCount() + 2 * (maxmem_kb / 1024)),
   52.14                     shadow_mem_kb)
   52.15  
   52.16 +class X86_Linux_ImageHandler(LinuxImageHandler):
   52.17 +
   52.18 +    def buildDomain(self):
   52.19 +        # set physical mapping limit
   52.20 +        # add an 8MB slack to balance backend allocations.
   52.21 +        mem_kb = self.getRequiredInitialReservation() + (8 * 1024)
   52.22 +        xc.domain_set_memmap_limit(self.vm.getDomid(), mem_kb)
   52.23 +        return LinuxImageHandler.buildDomain(self)
   52.24  
   52.25  _handlers = {
   52.26      "powerpc": {
   52.27 @@ -558,7 +566,7 @@ class X86_HVM_ImageHandler(HVMImageHandl
   52.28          "hvm": IA64_HVM_ImageHandler,
   52.29      },
   52.30      "x86": {
   52.31 -        "linux": LinuxImageHandler,
   52.32 +        "linux": X86_Linux_ImageHandler,
   52.33          "hvm": X86_HVM_ImageHandler,
   52.34      },
   52.35  }
    53.1 --- a/tools/python/xen/xend/server/DevController.py	Thu Dec 07 16:18:55 2006 -0700
    53.2 +++ b/tools/python/xen/xend/server/DevController.py	Fri Dec 08 09:09:18 2006 -0700
    53.3 @@ -226,9 +226,11 @@ class DevController:
    53.4          for key, val in configDict.items():
    53.5              if isinstance(val, (types.ListType, types.TupleType)):
    53.6                  for v in val:
    53.7 -                    sxpr.append([key, v])
    53.8 +                    if v != None:
    53.9 +                        sxpr.append([key, v])
   53.10              else:
   53.11 -                sxpr.append([key, val])
   53.12 +                if val != None:
   53.13 +                    sxpr.append([key, val])
   53.14          return sxpr
   53.15  
   53.16      def sxprs(self):
    54.1 --- a/tools/python/xen/xend/server/SrvDaemon.py	Thu Dec 07 16:18:55 2006 -0700
    54.2 +++ b/tools/python/xen/xend/server/SrvDaemon.py	Fri Dec 08 09:09:18 2006 -0700
    54.3 @@ -278,6 +278,8 @@ class Daemon:
    54.4              modulename = m.group(1)
    54.5              if re.search('sxp.py', modulename):
    54.6                  return None
    54.7 +            if re.search('SrvServer.py', modulename):
    54.8 +                return None
    54.9              self.traceindent += 1
   54.10              self.print_trace("> %s:%s\n"
   54.11                               % (modulename, code.co_name))
    55.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Thu Dec 07 16:18:55 2006 -0700
    55.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Fri Dec 08 09:09:18 2006 -0700
    55.3 @@ -21,6 +21,7 @@ from xen.web import http
    55.4  from xen.xend import sxp
    55.5  from xen.xend import XendDomain
    55.6  from xen.xend.Args import FormFn
    55.7 +from xen.xend.XendLogging import log
    55.8  
    55.9  from xen.web.SrvDir import SrvDir
   55.10  
   55.11 @@ -63,6 +64,18 @@ class SrvDomain(SrvDir):
   55.12          self.acceptCommand(req)
   55.13          return self.dom.shutdown(req.args['reason'][0])
   55.14  
   55.15 +    def op_delete(self, _, req):
   55.16