direct-io.hg

changeset 13695:049d9022653c

Added modelling and C bindings for the PBD class. PBDs are the analogue of
PIFs, indicating how an SR is attached to a host.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Jan 29 13:17:53 2007 +0000 (2007-01-29)
parents 7d64bdc7a300
children 66c2a4085863
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_host.h tools/libxen/include/xen_sr.h tools/libxen/src/xen_host.c tools/libxen/src/xen_sr.c
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Mon Jan 29 13:16:00 2007 +0000
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Mon Jan 29 13:17:53 2007 +0000
     1.3 @@ -33,6 +33,7 @@ Name & Description \\
     1.4  {\tt SR} & A storage repository \\
     1.5  {\tt VDI} & A virtual disk image \\
     1.6  {\tt VBD} & A virtual block device \\
     1.7 +{\tt PBD} & The physical block devices through which hosts access SRs \\
     1.8  {\tt VTPM} & A virtual TPM device \\
     1.9  {\tt console} & A console \\
    1.10  {\tt user} & A user of the system \\
    1.11 @@ -46,6 +47,8 @@ Fields that are bound together are shown
    1.12  {\em object.field} & {\em object.field} & {\em relationship} \\
    1.13  
    1.14  \hline
    1.15 +host.PBDs & PBD.host & many-to-one\\
    1.16 +SR.PBDs & PBD.SR & many-to-one\\
    1.17  VDI.VBDs & VBD.VDI & many-to-one\\
    1.18  VBD.VM & VM.VBDs & one-to-many\\
    1.19  VIF.VM & VM.VIFs & one-to-many\\
    1.20 @@ -4232,6 +4235,7 @@ Quals & Field & Type & Description \\
    1.21  $\mathit{RO}_\mathit{run}$ &  {\tt software\_version} & (string $\rightarrow$ string) Map & version strings \\
    1.22  $\mathit{RO}_\mathit{run}$ &  {\tt resident\_VMs} & (VM ref) Set & list of VMs currently resident on host \\
    1.23  $\mathit{RO}_\mathit{run}$ &  {\tt PIFs} & (PIF ref) Set & physical network interfaces \\
    1.24 +$\mathit{RO}_\mathit{run}$ &  {\tt PBDs} & (PBD ref) Set & physical blockdevices \\
    1.25  $\mathit{RO}_\mathit{run}$ &  {\tt host\_CPUs} & (host\_cpu ref) Set & The physical CPUs on this host \\
    1.26  \hline
    1.27  \end{longtable}
    1.28 @@ -4648,6 +4652,38 @@ value of the field
    1.29  \vspace{0.3cm}
    1.30  \vspace{0.3cm}
    1.31  \vspace{0.3cm}
    1.32 +\subsubsection{RPC name:~get\_PBDs}
    1.33 +
    1.34 +{\bf Overview:} 
    1.35 +Get the PBDs field of the given host.
    1.36 +
    1.37 + \noindent {\bf Signature:} 
    1.38 +\begin{verbatim} ((PBD ref) Set) get_PBDs (session_id s, host ref self)\end{verbatim}
    1.39 +
    1.40 +
    1.41 +\noindent{\bf Arguments:}
    1.42 +
    1.43 + 
    1.44 +\vspace{0.3cm}
    1.45 +\begin{tabular}{|c|c|p{7cm}|}
    1.46 + \hline
    1.47 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.48 +{\tt host ref } & self & reference to the object \\ \hline 
    1.49 +
    1.50 +\end{tabular}
    1.51 +
    1.52 +\vspace{0.3cm}
    1.53 +
    1.54 + \noindent {\bf Return Type:} 
    1.55 +{\tt 
    1.56 +(PBD ref) Set
    1.57 +}
    1.58 +
    1.59 +
    1.60 +value of the field
    1.61 +\vspace{0.3cm}
    1.62 +\vspace{0.3cm}
    1.63 +\vspace{0.3cm}
    1.64  \subsubsection{RPC name:~get\_host\_CPUs}
    1.65  
    1.66  {\bf Overview:} 
    1.67 @@ -7063,6 +7099,7 @@ Quals & Field & Type & Description \\
    1.68  $\mathit{RW}$ &  {\tt name/label} & string & a human-readable name \\
    1.69  $\mathit{RW}$ &  {\tt name/description} & string & a notes field containg human-readable description \\
    1.70  $\mathit{RO}_\mathit{run}$ &  {\tt VDIs} & (VDI ref) Set & managed virtual disks \\
    1.71 +$\mathit{RO}_\mathit{run}$ &  {\tt PBDs} & (PBD ref) Set & physical blockdevices \\
    1.72  $\mathit{RO}_\mathit{run}$ &  {\tt virtual\_allocation} & int & sum of virtual\_sizes of all VDIs in this storage repository (in bytes) \\
    1.73  $\mathit{RO}_\mathit{run}$ &  {\tt physical\_utilisation} & int & physical space currently utilised on this storage repository (in bytes). Note that for sparse disk formats, physical\_utilisation may be less than virtual\_allocation \\
    1.74  $\mathit{RO}_\mathit{ins}$ &  {\tt physical\_size} & int & total physical size of the repository (in bytes) \\
    1.75 @@ -7325,6 +7362,38 @@ value of the field
    1.76  \vspace{0.3cm}
    1.77  \vspace{0.3cm}
    1.78  \vspace{0.3cm}
    1.79 +\subsubsection{RPC name:~get\_PBDs}
    1.80 +
    1.81 +{\bf Overview:} 
    1.82 +Get the PBDs field of the given SR.
    1.83 +
    1.84 + \noindent {\bf Signature:} 
    1.85 +\begin{verbatim} ((PBD ref) Set) get_PBDs (session_id s, SR ref self)\end{verbatim}
    1.86 +
    1.87 +
    1.88 +\noindent{\bf Arguments:}
    1.89 +
    1.90 + 
    1.91 +\vspace{0.3cm}
    1.92 +\begin{tabular}{|c|c|p{7cm}|}
    1.93 + \hline
    1.94 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.95 +{\tt SR ref } & self & reference to the object \\ \hline 
    1.96 +
    1.97 +\end{tabular}
    1.98 +
    1.99 +\vspace{0.3cm}
   1.100 +
   1.101 + \noindent {\bf Return Type:} 
   1.102 +{\tt 
   1.103 +(PBD ref) Set
   1.104 +}
   1.105 +
   1.106 +
   1.107 +value of the field
   1.108 +\vspace{0.3cm}
   1.109 +\vspace{0.3cm}
   1.110 +\vspace{0.3cm}
   1.111  \subsubsection{RPC name:~get\_virtual\_allocation}
   1.112  
   1.113  {\bf Overview:} 
   1.114 @@ -9138,6 +9207,315 @@ all fields from the object
   1.115  
   1.116  \vspace{1cm}
   1.117  \newpage
   1.118 +\section{Class: PBD}
   1.119 +\subsection{Fields for class: PBD}
   1.120 +\begin{longtable}{|lllp{0.38\textwidth}|}
   1.121 +\hline
   1.122 +\multicolumn{1}{|l}{Name} & \multicolumn{3}{l|}{\bf PBD} \\
   1.123 +\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em
   1.124 +The physical block devices through which hosts access SRs.}} \\
   1.125 +\hline
   1.126 +Quals & Field & Type & Description \\
   1.127 +\hline
   1.128 +$\mathit{RO}_\mathit{run}$ &  {\tt uuid} & string & unique identifier/object reference \\
   1.129 +$\mathit{RO}_\mathit{ins}$ &  {\tt host} & host ref & physical machine on which the pbd is available \\
   1.130 +$\mathit{RO}_\mathit{ins}$ &  {\tt SR} & SR ref & the storage repository that the pbd realises \\
   1.131 +$\mathit{RO}_\mathit{ins}$ &  {\tt device\_config} & (string $\rightarrow$ string) Map & a config string that is provided to the host's SR-backend-driver \\
   1.132 +$\mathit{RO}_\mathit{run}$ &  {\tt currently\_attached} & bool & is the SR currently attached on this host? \\
   1.133 +\hline
   1.134 +\end{longtable}
   1.135 +\subsection{Additional RPCs associated with class: PBD}
   1.136 +\subsubsection{RPC name:~get\_uuid}
   1.137 +
   1.138 +{\bf Overview:} 
   1.139 +Get the uuid field of the given PBD.
   1.140 +
   1.141 + \noindent {\bf Signature:} 
   1.142 +\begin{verbatim} string get_uuid (session_id s, PBD ref self)\end{verbatim}
   1.143 +
   1.144 +
   1.145 +\noindent{\bf Arguments:}
   1.146 +
   1.147 + 
   1.148 +\vspace{0.3cm}
   1.149 +\begin{tabular}{|c|c|p{7cm}|}
   1.150 + \hline
   1.151 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.152 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.153 +
   1.154 +\end{tabular}
   1.155 +
   1.156 +\vspace{0.3cm}
   1.157 +
   1.158 + \noindent {\bf Return Type:} 
   1.159 +{\tt 
   1.160 +string
   1.161 +}
   1.162 +
   1.163 +
   1.164 +value of the field
   1.165 +\vspace{0.3cm}
   1.166 +\vspace{0.3cm}
   1.167 +\vspace{0.3cm}
   1.168 +\subsubsection{RPC name:~get\_host}
   1.169 +
   1.170 +{\bf Overview:} 
   1.171 +Get the host field of the given PBD.
   1.172 +
   1.173 + \noindent {\bf Signature:} 
   1.174 +\begin{verbatim} (host ref) get_host (session_id s, PBD ref self)\end{verbatim}
   1.175 +
   1.176 +
   1.177 +\noindent{\bf Arguments:}
   1.178 +
   1.179 + 
   1.180 +\vspace{0.3cm}
   1.181 +\begin{tabular}{|c|c|p{7cm}|}
   1.182 + \hline
   1.183 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.184 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.185 +
   1.186 +\end{tabular}
   1.187 +
   1.188 +\vspace{0.3cm}
   1.189 +
   1.190 + \noindent {\bf Return Type:} 
   1.191 +{\tt 
   1.192 +host ref
   1.193 +}
   1.194 +
   1.195 +
   1.196 +value of the field
   1.197 +\vspace{0.3cm}
   1.198 +\vspace{0.3cm}
   1.199 +\vspace{0.3cm}
   1.200 +\subsubsection{RPC name:~get\_SR}
   1.201 +
   1.202 +{\bf Overview:} 
   1.203 +Get the SR field of the given PBD.
   1.204 +
   1.205 + \noindent {\bf Signature:} 
   1.206 +\begin{verbatim} (SR ref) get_SR (session_id s, PBD ref self)\end{verbatim}
   1.207 +
   1.208 +
   1.209 +\noindent{\bf Arguments:}
   1.210 +
   1.211 + 
   1.212 +\vspace{0.3cm}
   1.213 +\begin{tabular}{|c|c|p{7cm}|}
   1.214 + \hline
   1.215 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.216 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.217 +
   1.218 +\end{tabular}
   1.219 +
   1.220 +\vspace{0.3cm}
   1.221 +
   1.222 + \noindent {\bf Return Type:} 
   1.223 +{\tt 
   1.224 +SR ref
   1.225 +}
   1.226 +
   1.227 +
   1.228 +value of the field
   1.229 +\vspace{0.3cm}
   1.230 +\vspace{0.3cm}
   1.231 +\vspace{0.3cm}
   1.232 +\subsubsection{RPC name:~get\_device\_config}
   1.233 +
   1.234 +{\bf Overview:} 
   1.235 +Get the device\_config field of the given PBD.
   1.236 +
   1.237 + \noindent {\bf Signature:} 
   1.238 +\begin{verbatim} ((string -> string) Map) get_device_config (session_id s, PBD ref self)\end{verbatim}
   1.239 +
   1.240 +
   1.241 +\noindent{\bf Arguments:}
   1.242 +
   1.243 + 
   1.244 +\vspace{0.3cm}
   1.245 +\begin{tabular}{|c|c|p{7cm}|}
   1.246 + \hline
   1.247 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.248 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.249 +
   1.250 +\end{tabular}
   1.251 +
   1.252 +\vspace{0.3cm}
   1.253 +
   1.254 + \noindent {\bf Return Type:} 
   1.255 +{\tt 
   1.256 +(string $\rightarrow$ string) Map
   1.257 +}
   1.258 +
   1.259 +
   1.260 +value of the field
   1.261 +\vspace{0.3cm}
   1.262 +\vspace{0.3cm}
   1.263 +\vspace{0.3cm}
   1.264 +\subsubsection{RPC name:~get\_currently\_attached}
   1.265 +
   1.266 +{\bf Overview:} 
   1.267 +Get the currently\_attached field of the given PBD.
   1.268 +
   1.269 + \noindent {\bf Signature:} 
   1.270 +\begin{verbatim} bool get_currently_attached (session_id s, PBD ref self)\end{verbatim}
   1.271 +
   1.272 +
   1.273 +\noindent{\bf Arguments:}
   1.274 +
   1.275 + 
   1.276 +\vspace{0.3cm}
   1.277 +\begin{tabular}{|c|c|p{7cm}|}
   1.278 + \hline
   1.279 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.280 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.281 +
   1.282 +\end{tabular}
   1.283 +
   1.284 +\vspace{0.3cm}
   1.285 +
   1.286 + \noindent {\bf Return Type:} 
   1.287 +{\tt 
   1.288 +bool
   1.289 +}
   1.290 +
   1.291 +
   1.292 +value of the field
   1.293 +\vspace{0.3cm}
   1.294 +\vspace{0.3cm}
   1.295 +\vspace{0.3cm}
   1.296 +\subsubsection{RPC name:~create}
   1.297 +
   1.298 +{\bf Overview:} 
   1.299 +Create a new PBD instance, and return its handle.
   1.300 +
   1.301 + \noindent {\bf Signature:} 
   1.302 +\begin{verbatim} (PBD ref) create (session_id s, PBD record args)\end{verbatim}
   1.303 +
   1.304 +
   1.305 +\noindent{\bf Arguments:}
   1.306 +
   1.307 + 
   1.308 +\vspace{0.3cm}
   1.309 +\begin{tabular}{|c|c|p{7cm}|}
   1.310 + \hline
   1.311 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.312 +{\tt PBD record } & args & All constructor arguments \\ \hline 
   1.313 +
   1.314 +\end{tabular}
   1.315 +
   1.316 +\vspace{0.3cm}
   1.317 +
   1.318 + \noindent {\bf Return Type:} 
   1.319 +{\tt 
   1.320 +PBD ref
   1.321 +}
   1.322 +
   1.323 +
   1.324 +reference to the newly created object
   1.325 +\vspace{0.3cm}
   1.326 +\vspace{0.3cm}
   1.327 +\vspace{0.3cm}
   1.328 +\subsubsection{RPC name:~destroy}
   1.329 +
   1.330 +{\bf Overview:} 
   1.331 +Destroy the specified PBD instance.
   1.332 +
   1.333 + \noindent {\bf Signature:} 
   1.334 +\begin{verbatim} void destroy (session_id s, PBD ref self)\end{verbatim}
   1.335 +
   1.336 +
   1.337 +\noindent{\bf Arguments:}
   1.338 +
   1.339 + 
   1.340 +\vspace{0.3cm}
   1.341 +\begin{tabular}{|c|c|p{7cm}|}
   1.342 + \hline
   1.343 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.344 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.345 +
   1.346 +\end{tabular}
   1.347 +
   1.348 +\vspace{0.3cm}
   1.349 +
   1.350 + \noindent {\bf Return Type:} 
   1.351 +{\tt 
   1.352 +void
   1.353 +}
   1.354 +
   1.355 +
   1.356 +
   1.357 +\vspace{0.3cm}
   1.358 +\vspace{0.3cm}
   1.359 +\vspace{0.3cm}
   1.360 +\subsubsection{RPC name:~get\_by\_uuid}
   1.361 +
   1.362 +{\bf Overview:} 
   1.363 +Get a reference to the PBD instance with the specified UUID.
   1.364 +
   1.365 + \noindent {\bf Signature:} 
   1.366 +\begin{verbatim} (PBD ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
   1.367 +
   1.368 +
   1.369 +\noindent{\bf Arguments:}
   1.370 +
   1.371 + 
   1.372 +\vspace{0.3cm}
   1.373 +\begin{tabular}{|c|c|p{7cm}|}
   1.374 + \hline
   1.375 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.376 +{\tt string } & uuid & UUID of object to return \\ \hline 
   1.377 +
   1.378 +\end{tabular}
   1.379 +
   1.380 +\vspace{0.3cm}
   1.381 +
   1.382 + \noindent {\bf Return Type:} 
   1.383 +{\tt 
   1.384 +PBD ref
   1.385 +}
   1.386 +
   1.387 +
   1.388 +reference to the object
   1.389 +\vspace{0.3cm}
   1.390 +\vspace{0.3cm}
   1.391 +\vspace{0.3cm}
   1.392 +\subsubsection{RPC name:~get\_record}
   1.393 +
   1.394 +{\bf Overview:} 
   1.395 +Get a record containing the current state of the given PBD.
   1.396 +
   1.397 + \noindent {\bf Signature:} 
   1.398 +\begin{verbatim} (PBD record) get_record (session_id s, PBD ref self)\end{verbatim}
   1.399 +
   1.400 +
   1.401 +\noindent{\bf Arguments:}
   1.402 +
   1.403 + 
   1.404 +\vspace{0.3cm}
   1.405 +\begin{tabular}{|c|c|p{7cm}|}
   1.406 + \hline
   1.407 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.408 +{\tt PBD ref } & self & reference to the object \\ \hline 
   1.409 +
   1.410 +\end{tabular}
   1.411 +
   1.412 +\vspace{0.3cm}
   1.413 +
   1.414 + \noindent {\bf Return Type:} 
   1.415 +{\tt 
   1.416 +PBD record
   1.417 +}
   1.418 +
   1.419 +
   1.420 +all fields from the object
   1.421 +\vspace{0.3cm}
   1.422 +\vspace{0.3cm}
   1.423 +\vspace{0.3cm}
   1.424 +
   1.425 +\vspace{1cm}
   1.426 +\newpage
   1.427  \section{Class: VTPM}
   1.428  \subsection{Fields for class: VTPM}
   1.429  \begin{longtable}{|lllp{0.38\textwidth}|}
     2.1 --- a/tools/libxen/include/xen_host.h	Mon Jan 29 13:16:00 2007 +0000
     2.2 +++ b/tools/libxen/include/xen_host.h	Mon Jan 29 13:17:53 2007 +0000
     2.3 @@ -22,14 +22,15 @@
     2.4  #include "xen_common.h"
     2.5  #include "xen_host_cpu_decl.h"
     2.6  #include "xen_host_decl.h"
     2.7 +#include "xen_pbd_decl.h"
     2.8  #include "xen_pif_decl.h"
     2.9  #include "xen_string_string_map.h"
    2.10  #include "xen_vm_decl.h"
    2.11  
    2.12  
    2.13  /*
    2.14 - * The host class. 
    2.15 - *  
    2.16 + * The host class.
    2.17 + * 
    2.18   * A physical host.
    2.19   */
    2.20  
    2.21 @@ -71,6 +72,7 @@ typedef struct xen_host_record
    2.22      xen_string_string_map *software_version;
    2.23      struct xen_vm_record_opt_set *resident_vms;
    2.24      struct xen_pif_record_opt_set *pifs;
    2.25 +    struct xen_pbd_record_opt_set *pbds;
    2.26      struct xen_host_cpu_record_opt_set *host_cpus;
    2.27  } xen_host_record;
    2.28  
    2.29 @@ -231,6 +233,13 @@ xen_host_get_pifs(xen_session *session, 
    2.30  
    2.31  
    2.32  /**
    2.33 + * Get the PBDs field of the given host.
    2.34 + */
    2.35 +extern bool
    2.36 +xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
    2.37 +
    2.38 +
    2.39 +/**
    2.40   * Get the host_CPUs field of the given host.
    2.41   */
    2.42  extern bool
     3.1 --- a/tools/libxen/include/xen_sr.h	Mon Jan 29 13:16:00 2007 +0000
     3.2 +++ b/tools/libxen/include/xen_sr.h	Mon Jan 29 13:17:53 2007 +0000
     3.3 @@ -20,13 +20,14 @@
     3.4  #define XEN_SR_H
     3.5  
     3.6  #include "xen_common.h"
     3.7 +#include "xen_pbd_decl.h"
     3.8  #include "xen_sr_decl.h"
     3.9  #include "xen_vdi_decl.h"
    3.10  
    3.11  
    3.12  /*
    3.13 - * The SR class. 
    3.14 - *  
    3.15 + * The SR class.
    3.16 + * 
    3.17   * A storage repository.
    3.18   */
    3.19  
    3.20 @@ -66,6 +67,7 @@ typedef struct xen_sr_record
    3.21      char *name_label;
    3.22      char *name_description;
    3.23      struct xen_vdi_record_opt_set *vdis;
    3.24 +    struct xen_pbd_record_opt_set *pbds;
    3.25      int64_t virtual_allocation;
    3.26      int64_t physical_utilisation;
    3.27      int64_t physical_size;
    3.28 @@ -216,6 +218,13 @@ xen_sr_get_vdis(xen_session *session, st
    3.29  
    3.30  
    3.31  /**
    3.32 + * Get the PBDs field of the given SR.
    3.33 + */
    3.34 +extern bool
    3.35 +xen_sr_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_sr sr);
    3.36 +
    3.37 +
    3.38 +/**
    3.39   * Get the virtual_allocation field of the given SR.
    3.40   */
    3.41  extern bool
     4.1 --- a/tools/libxen/src/xen_host.c	Mon Jan 29 13:16:00 2007 +0000
     4.2 +++ b/tools/libxen/src/xen_host.c	Mon Jan 29 13:17:53 2007 +0000
     4.3 @@ -24,6 +24,7 @@
     4.4  #include "xen_host.h"
     4.5  #include "xen_host_cpu.h"
     4.6  #include "xen_internal.h"
     4.7 +#include "xen_pbd.h"
     4.8  #include "xen_pif.h"
     4.9  #include "xen_string_string_map.h"
    4.10  #include "xen_vm.h"
    4.11 @@ -58,6 +59,9 @@ static const struct_member xen_host_reco
    4.12          { .key = "PIFs",
    4.13            .type = &abstract_type_ref_set,
    4.14            .offset = offsetof(xen_host_record, pifs) },
    4.15 +        { .key = "PBDs",
    4.16 +          .type = &abstract_type_ref_set,
    4.17 +          .offset = offsetof(xen_host_record, pbds) },
    4.18          { .key = "host_CPUs",
    4.19            .type = &abstract_type_ref_set,
    4.20            .offset = offsetof(xen_host_record, host_cpus) }
    4.21 @@ -87,6 +91,7 @@ xen_host_record_free(xen_host_record *re
    4.22      xen_string_string_map_free(record->software_version);
    4.23      xen_vm_record_opt_set_free(record->resident_vms);
    4.24      xen_pif_record_opt_set_free(record->pifs);
    4.25 +    xen_pbd_record_opt_set_free(record->pbds);
    4.26      xen_host_cpu_record_opt_set_free(record->host_cpus);
    4.27      free(record);
    4.28  }
    4.29 @@ -266,6 +271,23 @@ xen_host_get_pifs(xen_session *session, 
    4.30  
    4.31  
    4.32  bool
    4.33 +xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host)
    4.34 +{
    4.35 +    abstract_value param_values[] =
    4.36 +        {
    4.37 +            { .type = &abstract_type_string,
    4.38 +              .u.string_val = host }
    4.39 +        };
    4.40 +
    4.41 +    abstract_type result_type = abstract_type_string_set;
    4.42 +
    4.43 +    *result = NULL;
    4.44 +    XEN_CALL_("host.get_PBDs");
    4.45 +    return session->ok;
    4.46 +}
    4.47 +
    4.48 +
    4.49 +bool
    4.50  xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host)
    4.51  {
    4.52      abstract_value param_values[] =
     5.1 --- a/tools/libxen/src/xen_sr.c	Mon Jan 29 13:16:00 2007 +0000
     5.2 +++ b/tools/libxen/src/xen_sr.c	Mon Jan 29 13:17:53 2007 +0000
     5.3 @@ -22,6 +22,7 @@
     5.4  
     5.5  #include "xen_common.h"
     5.6  #include "xen_internal.h"
     5.7 +#include "xen_pbd.h"
     5.8  #include "xen_sr.h"
     5.9  #include "xen_vdi.h"
    5.10  
    5.11 @@ -49,6 +50,9 @@ static const struct_member xen_sr_record
    5.12          { .key = "VDIs",
    5.13            .type = &abstract_type_ref_set,
    5.14            .offset = offsetof(xen_sr_record, vdis) },
    5.15 +        { .key = "PBDs",
    5.16 +          .type = &abstract_type_ref_set,
    5.17 +          .offset = offsetof(xen_sr_record, pbds) },
    5.18          { .key = "virtual_allocation",
    5.19            .type = &abstract_type_int,
    5.20            .offset = offsetof(xen_sr_record, virtual_allocation) },
    5.21 @@ -88,6 +92,7 @@ xen_sr_record_free(xen_sr_record *record
    5.22      free(record->name_label);
    5.23      free(record->name_description);
    5.24      xen_vdi_record_opt_set_free(record->vdis);
    5.25 +    xen_pbd_record_opt_set_free(record->pbds);
    5.26      free(record->type);
    5.27      free(record->location);
    5.28      free(record);