ia64/xen-unstable

changeset 13806:f73e71aa0a90

Change VM.HVM_boot to VM.HVM_boot_policy and VM.HVM_boot_params.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Feb 01 11:55:31 2007 +0000 (2007-02-01)
parents 0a4cbad6752c
children afb41f6bc30a
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_vm.h tools/libxen/src/xen_vm.c tools/libxen/test/test_bindings.c tools/python/xen/xend/XendAPI.py tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/messages/en/xen-xm.po
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Thu Feb 01 14:15:37 2007 +0000
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Thu Feb 01 11:55:31 2007 +0000
     1.3 @@ -1026,9 +1026,9 @@ references to objects with match names
     1.4  virtual machine (or 'guest').
     1.5  
     1.6  VM booting is controlled by setting one of the two mutually exclusive
     1.7 -groups: "PV", and "HVM".  If HVM.boot is the empty string, then paravirtual
     1.8 -domain building and booting will be used; otherwise the VM will be loaded
     1.9 -as an HVM domain, and booted using an emulated BIOS.
    1.10 +groups: "PV", and "HVM".  If HVM.boot\_policy is the empty string, then
    1.11 +paravirtual domain building and booting will be used; otherwise the VM will
    1.12 +be loaded as an HVM domain, and booted using an emulated BIOS.
    1.13  
    1.14  When paravirtual booting is in use, the PV/bootloader field indicates the
    1.15  bootloader to use.  It may be "pygrub", in which case the platform's
    1.16 @@ -1053,7 +1053,10 @@ ramdisk values will be treated as paths 
    1.17  PV/bootloader and PV/kernel are empty, then the behaviour is as if
    1.18  PV/bootloader was specified as "pygrub".
    1.19  
    1.20 -When using HVM booting, HVM/boot specifies the order of the boot devices.}} \\
    1.21 +When using HVM booting, HVM/boot\_policy and HVM/boot\_params specify the
    1.22 +boot handling.  Only one policy is currently defined: "BIOS order".  In
    1.23 +this case, HVM/boot\_params should contain one key-value pair "order" = "N"
    1.24 +where N is the string that will be passed to QEMU.}} \\
    1.25  \hline
    1.26  Quals & Field & Type & Description \\
    1.27  \hline
    1.28 @@ -1089,7 +1092,8 @@ Quals & Field & Type & Description \\
    1.29  $\mathit{RW}$ &  {\tt PV/ramdisk} & string & path to the initrd \\
    1.30  $\mathit{RW}$ &  {\tt PV/args} & string & kernel command-line arguments \\
    1.31  $\mathit{RW}$ &  {\tt PV/bootloader\_args} & string & miscellaneous arguments for the bootloader \\
    1.32 -$\mathit{RW}$ &  {\tt HVM/boot} & string & device boot order \\
    1.33 +$\mathit{RW}$ &  {\tt HVM/boot\_policy} & string & HVM boot policy \\
    1.34 +$\mathit{RW}$ &  {\tt HVM/boot\_params} & (string $\rightarrow$ string) Map & HVM boot params \\
    1.35  $\mathit{RW}$ &  {\tt platform/std\_VGA} & bool & emulate standard VGA instead of cirrus logic \\
    1.36  $\mathit{RW}$ &  {\tt platform/serial} & string & redirect serial port to pty \\
    1.37  $\mathit{RW}$ &  {\tt platform/localtime} & bool & set RTC to local time \\
    1.38 @@ -3297,13 +3301,13 @@ void
    1.39  \vspace{0.3cm}
    1.40  \vspace{0.3cm}
    1.41  \vspace{0.3cm}
    1.42 -\subsubsection{RPC name:~get\_HVM\_boot}
    1.43 -
    1.44 -{\bf Overview:} 
    1.45 -Get the HVM/boot field of the given VM.
    1.46 -
    1.47 - \noindent {\bf Signature:} 
    1.48 -\begin{verbatim} string get_HVM_boot (session_id s, VM ref self)\end{verbatim}
    1.49 +\subsubsection{RPC name:~get\_HVM\_boot\_policy}
    1.50 +
    1.51 +{\bf Overview:} 
    1.52 +Get the HVM/boot\_policy field of the given VM.
    1.53 +
    1.54 + \noindent {\bf Signature:} 
    1.55 +\begin{verbatim} string get_HVM_boot_policy (session_id s, VM ref self)\end{verbatim}
    1.56  
    1.57  
    1.58  \noindent{\bf Arguments:}
    1.59 @@ -3329,13 +3333,13 @@ value of the field
    1.60  \vspace{0.3cm}
    1.61  \vspace{0.3cm}
    1.62  \vspace{0.3cm}
    1.63 -\subsubsection{RPC name:~set\_HVM\_boot}
    1.64 -
    1.65 -{\bf Overview:} 
    1.66 -Set the HVM/boot field of the given VM.
    1.67 -
    1.68 - \noindent {\bf Signature:} 
    1.69 -\begin{verbatim} void set_HVM_boot (session_id s, VM ref self, string value)\end{verbatim}
    1.70 +\subsubsection{RPC name:~set\_HVM\_boot\_policy}
    1.71 +
    1.72 +{\bf Overview:} 
    1.73 +Set the HVM/boot\_policy field of the given VM.
    1.74 +
    1.75 + \noindent {\bf Signature:} 
    1.76 +\begin{verbatim} void set_HVM_boot_policy (session_id s, VM ref self, string value)\end{verbatim}
    1.77  
    1.78  
    1.79  \noindent{\bf Arguments:}
    1.80 @@ -3363,6 +3367,143 @@ void
    1.81  \vspace{0.3cm}
    1.82  \vspace{0.3cm}
    1.83  \vspace{0.3cm}
    1.84 +\subsubsection{RPC name:~get\_HVM\_boot\_params}
    1.85 +
    1.86 +{\bf Overview:} 
    1.87 +Get the HVM/boot\_params field of the given VM.
    1.88 +
    1.89 + \noindent {\bf Signature:} 
    1.90 +\begin{verbatim} ((string -> string) Map) get_HVM_boot_params (session_id s, VM ref self)\end{verbatim}
    1.91 +
    1.92 +
    1.93 +\noindent{\bf Arguments:}
    1.94 +
    1.95 + 
    1.96 +\vspace{0.3cm}
    1.97 +\begin{tabular}{|c|c|p{7cm}|}
    1.98 + \hline
    1.99 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.100 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.101 +
   1.102 +\end{tabular}
   1.103 +
   1.104 +\vspace{0.3cm}
   1.105 +
   1.106 + \noindent {\bf Return Type:} 
   1.107 +{\tt 
   1.108 +(string $\rightarrow$ string) Map
   1.109 +}
   1.110 +
   1.111 +
   1.112 +value of the field
   1.113 +\vspace{0.3cm}
   1.114 +\vspace{0.3cm}
   1.115 +\vspace{0.3cm}
   1.116 +\subsubsection{RPC name:~set\_HVM\_boot\_params}
   1.117 +
   1.118 +{\bf Overview:} 
   1.119 +Set the HVM/boot\_params field of the given VM.
   1.120 +
   1.121 + \noindent {\bf Signature:} 
   1.122 +\begin{verbatim} void set_HVM_boot_params (session_id s, VM ref self, (string -> string) Map value)\end{verbatim}
   1.123 +
   1.124 +
   1.125 +\noindent{\bf Arguments:}
   1.126 +
   1.127 + 
   1.128 +\vspace{0.3cm}
   1.129 +\begin{tabular}{|c|c|p{7cm}|}
   1.130 + \hline
   1.131 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.132 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.133 +
   1.134 +{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline 
   1.135 +
   1.136 +\end{tabular}
   1.137 +
   1.138 +\vspace{0.3cm}
   1.139 +
   1.140 + \noindent {\bf Return Type:} 
   1.141 +{\tt 
   1.142 +void
   1.143 +}
   1.144 +
   1.145 +
   1.146 +
   1.147 +\vspace{0.3cm}
   1.148 +\vspace{0.3cm}
   1.149 +\vspace{0.3cm}
   1.150 +\subsubsection{RPC name:~add\_to\_HVM\_boot\_params}
   1.151 +
   1.152 +{\bf Overview:} 
   1.153 +Add the given key-value pair to the HVM/boot\_params field of the given VM.
   1.154 +
   1.155 + \noindent {\bf Signature:} 
   1.156 +\begin{verbatim} void add_to_HVM_boot_params (session_id s, VM ref self, string key, string value)\end{verbatim}
   1.157 +
   1.158 +
   1.159 +\noindent{\bf Arguments:}
   1.160 +
   1.161 + 
   1.162 +\vspace{0.3cm}
   1.163 +\begin{tabular}{|c|c|p{7cm}|}
   1.164 + \hline
   1.165 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.166 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.167 +
   1.168 +{\tt string } & key & Key to add \\ \hline 
   1.169 +
   1.170 +{\tt string } & value & Value to add \\ \hline 
   1.171 +
   1.172 +\end{tabular}
   1.173 +
   1.174 +\vspace{0.3cm}
   1.175 +
   1.176 + \noindent {\bf Return Type:} 
   1.177 +{\tt 
   1.178 +void
   1.179 +}
   1.180 +
   1.181 +
   1.182 +
   1.183 +\vspace{0.3cm}
   1.184 +\vspace{0.3cm}
   1.185 +\vspace{0.3cm}
   1.186 +\subsubsection{RPC name:~remove\_from\_HVM\_boot\_params}
   1.187 +
   1.188 +{\bf Overview:} 
   1.189 +Remove the given key and its corresponding value from the HVM/boot\_params
   1.190 +field of the given VM.  If the key is not in that Map, then do nothing.
   1.191 +
   1.192 + \noindent {\bf Signature:} 
   1.193 +\begin{verbatim} void remove_from_HVM_boot_params (session_id s, VM ref self, string key)\end{verbatim}
   1.194 +
   1.195 +
   1.196 +\noindent{\bf Arguments:}
   1.197 +
   1.198 + 
   1.199 +\vspace{0.3cm}
   1.200 +\begin{tabular}{|c|c|p{7cm}|}
   1.201 + \hline
   1.202 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.203 +{\tt VM ref } & self & reference to the object \\ \hline 
   1.204 +
   1.205 +{\tt string } & key & Key to remove \\ \hline 
   1.206 +
   1.207 +\end{tabular}
   1.208 +
   1.209 +\vspace{0.3cm}
   1.210 +
   1.211 + \noindent {\bf Return Type:} 
   1.212 +{\tt 
   1.213 +void
   1.214 +}
   1.215 +
   1.216 +
   1.217 +
   1.218 +\vspace{0.3cm}
   1.219 +\vspace{0.3cm}
   1.220 +\vspace{0.3cm}
   1.221  \subsubsection{RPC name:~get\_platform\_std\_VGA}
   1.222  
   1.223  {\bf Overview:} 
   1.224 @@ -11758,6 +11899,17 @@ The handle parameter echoes the bad valu
   1.225  \begin{verbatim}TASK_HANDLE_INVALID(handle)\end{verbatim}
   1.226  \begin{center}\rule{10em}{0.1pt}\end{center}
   1.227  
   1.228 +\subsubsection{VALUE\_NOT\_SUPPORTED}
   1.229 +
   1.230 +You attempted to set a value that is not supported by this implementation. 
   1.231 +The fully-qualified field name and the value that you tried to set are
   1.232 +returned.  Also returned is a developer-only diagnostic reason.
   1.233 +
   1.234 +\vspace{0.3cm}
   1.235 +{\bf Signature:}
   1.236 +\begin{verbatim}VALUE_NOT_SUPPORTED(field, value, reason)\end{verbatim}
   1.237 +\begin{center}\rule{10em}{0.1pt}\end{center}
   1.238 +
   1.239  \subsubsection{VBD\_HANDLE\_INVALID}
   1.240  
   1.241  You gave an invalid VBD handle.  The VBD may have recently been deleted. 
     2.1 --- a/tools/libxen/include/xen_vm.h	Thu Feb 01 14:15:37 2007 +0000
     2.2 +++ b/tools/libxen/include/xen_vm.h	Thu Feb 01 11:55:31 2007 +0000
     2.3 @@ -42,9 +42,9 @@
     2.4   * A virtual machine (or 'guest').
     2.5   * 
     2.6   * VM booting is controlled by setting one of the two mutually exclusive
     2.7 - * groups: "PV", and "HVM".  If HVM.boot is the empty string, then paravirtual
     2.8 - * domain building and booting will be used; otherwise the VM will be loaded
     2.9 - * as an HVM domain, and booted using an emulated BIOS.
    2.10 + * groups: "PV", and "HVM".  If HVM.boot_policy is the empty string, then
    2.11 + * paravirtual domain building and booting will be used; otherwise the VM will
    2.12 + * be loaded as an HVM domain, and booted using an emulated BIOS.
    2.13   * 
    2.14   * When paravirtual booting is in use, the PV/bootloader field indicates the
    2.15   * bootloader to use.  It may be "pygrub", in which case the platform's
    2.16 @@ -69,7 +69,10 @@
    2.17   * PV/bootloader and PV/kernel are empty, then the behaviour is as if
    2.18   * PV/bootloader was specified as "pygrub".
    2.19   * 
    2.20 - * When using HVM booting, HVM/boot specifies the order of the boot devices.
    2.21 + * When using HVM booting, HVM/boot_policy and HVM/boot_params specify the
    2.22 + * boot handling.  Only one policy is currently defined: "BIOS order".  In
    2.23 + * this case, HVM/boot_params should contain one key-value pair "order" = "N"
    2.24 + * where N is the string that will be passed to QEMU..
    2.25   */
    2.26  
    2.27  
    2.28 @@ -136,7 +139,8 @@ typedef struct xen_vm_record
    2.29      char *pv_ramdisk;
    2.30      char *pv_args;
    2.31      char *pv_bootloader_args;
    2.32 -    char *hvm_boot;
    2.33 +    char *hvm_boot_policy;
    2.34 +    xen_string_string_map *hvm_boot_params;
    2.35      bool platform_std_vga;
    2.36      char *platform_serial;
    2.37      bool platform_localtime;
    2.38 @@ -490,10 +494,17 @@ xen_vm_get_pv_bootloader_args(xen_sessio
    2.39  
    2.40  
    2.41  /**
    2.42 - * Get the HVM/boot field of the given VM.
    2.43 + * Get the HVM/boot_policy field of the given VM.
    2.44   */
    2.45  extern bool
    2.46 -xen_vm_get_hvm_boot(xen_session *session, char **result, xen_vm vm);
    2.47 +xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm);
    2.48 +
    2.49 +
    2.50 +/**
    2.51 + * Get the HVM/boot_params field of the given VM.
    2.52 + */
    2.53 +extern bool
    2.54 +xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
    2.55  
    2.56  
    2.57  /**
    2.58 @@ -731,10 +742,34 @@ xen_vm_set_pv_bootloader_args(xen_sessio
    2.59  
    2.60  
    2.61  /**
    2.62 - * Set the HVM/boot field of the given VM.
    2.63 + * Set the HVM/boot_policy field of the given VM.
    2.64 + */
    2.65 +extern bool
    2.66 +xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy);
    2.67 +
    2.68 +
    2.69 +/**
    2.70 + * Set the HVM/boot_params field of the given VM.
    2.71   */
    2.72  extern bool
    2.73 -xen_vm_set_hvm_boot(xen_session *session, xen_vm vm, char *boot);
    2.74 +xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params);
    2.75 +
    2.76 +
    2.77 +/**
    2.78 + * Add the given key-value pair to the HVM/boot_params field of the
    2.79 + * given VM.
    2.80 + */
    2.81 +extern bool
    2.82 +xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value);
    2.83 +
    2.84 +
    2.85 +/**
    2.86 + * Remove the given key and its corresponding value from the
    2.87 + * HVM/boot_params field of the given VM.  If the key is not in that Map, then
    2.88 + * do nothing.
    2.89 + */
    2.90 +extern bool
    2.91 +xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key);
    2.92  
    2.93  
    2.94  /**
     3.1 --- a/tools/libxen/src/xen_vm.c	Thu Feb 01 14:15:37 2007 +0000
     3.2 +++ b/tools/libxen/src/xen_vm.c	Thu Feb 01 11:55:31 2007 +0000
     3.3 @@ -145,9 +145,12 @@ static const struct_member xen_vm_record
     3.4          { .key = "PV_bootloader_args",
     3.5            .type = &abstract_type_string,
     3.6            .offset = offsetof(xen_vm_record, pv_bootloader_args) },
     3.7 -        { .key = "HVM_boot",
     3.8 +        { .key = "HVM_boot_policy",
     3.9            .type = &abstract_type_string,
    3.10 -          .offset = offsetof(xen_vm_record, hvm_boot) },
    3.11 +          .offset = offsetof(xen_vm_record, hvm_boot_policy) },
    3.12 +        { .key = "HVM_boot_params",
    3.13 +          .type = &abstract_type_string_string_map,
    3.14 +          .offset = offsetof(xen_vm_record, hvm_boot_params) },
    3.15          { .key = "platform_std_VGA",
    3.16            .type = &abstract_type_bool,
    3.17            .offset = offsetof(xen_vm_record, platform_std_vga) },
    3.18 @@ -216,7 +219,8 @@ xen_vm_record_free(xen_vm_record *record
    3.19      free(record->pv_ramdisk);
    3.20      free(record->pv_args);
    3.21      free(record->pv_bootloader_args);
    3.22 -    free(record->hvm_boot);
    3.23 +    free(record->hvm_boot_policy);
    3.24 +    xen_string_string_map_free(record->hvm_boot_params);
    3.25      free(record->platform_serial);
    3.26      free(record->pci_bus);
    3.27      xen_string_string_map_free(record->tools_version);
    3.28 @@ -824,7 +828,7 @@ xen_vm_get_pv_bootloader_args(xen_sessio
    3.29  
    3.30  
    3.31  bool
    3.32 -xen_vm_get_hvm_boot(xen_session *session, char **result, xen_vm vm)
    3.33 +xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm)
    3.34  {
    3.35      abstract_value param_values[] =
    3.36          {
    3.37 @@ -835,7 +839,24 @@ xen_vm_get_hvm_boot(xen_session *session
    3.38      abstract_type result_type = abstract_type_string;
    3.39  
    3.40      *result = NULL;
    3.41 -    XEN_CALL_("VM.get_HVM_boot");
    3.42 +    XEN_CALL_("VM.get_HVM_boot_policy");
    3.43 +    return session->ok;
    3.44 +}
    3.45 +
    3.46 +
    3.47 +bool
    3.48 +xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm)
    3.49 +{
    3.50 +    abstract_value param_values[] =
    3.51 +        {
    3.52 +            { .type = &abstract_type_string,
    3.53 +              .u.string_val = vm }
    3.54 +        };
    3.55 +
    3.56 +    abstract_type result_type = abstract_type_string_string_map;
    3.57 +
    3.58 +    *result = NULL;
    3.59 +    XEN_CALL_("VM.get_HVM_boot_params");
    3.60      return session->ok;
    3.61  }
    3.62  
    3.63 @@ -1376,17 +1397,67 @@ xen_vm_set_pv_bootloader_args(xen_sessio
    3.64  
    3.65  
    3.66  bool
    3.67 -xen_vm_set_hvm_boot(xen_session *session, xen_vm vm, char *boot)
    3.68 +xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy)
    3.69  {
    3.70      abstract_value param_values[] =
    3.71          {
    3.72              { .type = &abstract_type_string,
    3.73                .u.string_val = vm },
    3.74              { .type = &abstract_type_string,
    3.75 -              .u.string_val = boot }
    3.76 +              .u.string_val = boot_policy }
    3.77 +        };
    3.78 +
    3.79 +    xen_call_(session, "VM.set_HVM_boot_policy", param_values, 2, NULL, NULL);
    3.80 +    return session->ok;
    3.81 +}
    3.82 +
    3.83 +
    3.84 +bool
    3.85 +xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params)
    3.86 +{
    3.87 +    abstract_value param_values[] =
    3.88 +        {
    3.89 +            { .type = &abstract_type_string,
    3.90 +              .u.string_val = vm },
    3.91 +            { .type = &abstract_type_string_string_map,
    3.92 +              .u.set_val = (arbitrary_set *)boot_params }
    3.93          };
    3.94  
    3.95 -    xen_call_(session, "VM.set_HVM_boot", param_values, 2, NULL, NULL);
    3.96 +    xen_call_(session, "VM.set_HVM_boot_params", param_values, 2, NULL, NULL);
    3.97 +    return session->ok;
    3.98 +}
    3.99 +
   3.100 +
   3.101 +bool
   3.102 +xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value)
   3.103 +{
   3.104 +    abstract_value param_values[] =
   3.105 +        {
   3.106 +            { .type = &abstract_type_string,
   3.107 +              .u.string_val = vm },
   3.108 +            { .type = &abstract_type_string,
   3.109 +              .u.string_val = key },
   3.110 +            { .type = &abstract_type_string,
   3.111 +              .u.string_val = value }
   3.112 +        };
   3.113 +
   3.114 +    xen_call_(session, "VM.add_to_HVM_boot_params", param_values, 3, NULL, NULL);
   3.115 +    return session->ok;
   3.116 +}
   3.117 +
   3.118 +
   3.119 +bool
   3.120 +xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key)
   3.121 +{
   3.122 +    abstract_value param_values[] =
   3.123 +        {
   3.124 +            { .type = &abstract_type_string,
   3.125 +              .u.string_val = vm },
   3.126 +            { .type = &abstract_type_string,
   3.127 +              .u.string_val = key }
   3.128 +        };
   3.129 +
   3.130 +    xen_call_(session, "VM.remove_from_HVM_boot_params", param_values, 2, NULL, NULL);
   3.131      return session->ok;
   3.132  }
   3.133  
     4.1 --- a/tools/libxen/test/test_bindings.c	Thu Feb 01 14:15:37 2007 +0000
     4.2 +++ b/tools/libxen/test/test_bindings.c	Thu Feb 01 11:55:31 2007 +0000
     4.3 @@ -278,6 +278,8 @@ int main(int argc, char **argv)
     4.4  static xen_vm create_new_vm(xen_session *session)
     4.5  {
     4.6      xen_string_string_map *vcpus_params = xen_string_string_map_alloc(1);
     4.7 +    vcpus_params->contents[0].key = strdup("weight");
     4.8 +    vcpus_params->contents[0].val = strdup("300");
     4.9      xen_vm_record vm_record =
    4.10          {
    4.11              .name_label = "NewVM",
    4.12 @@ -294,9 +296,10 @@ static xen_vm create_new_vm(xen_session 
    4.13              .actions_after_shutdown = XEN_ON_NORMAL_EXIT_DESTROY,
    4.14              .actions_after_reboot = XEN_ON_NORMAL_EXIT_RESTART,
    4.15              .actions_after_crash = XEN_ON_CRASH_BEHAVIOUR_PRESERVE,
    4.16 -            .hvm_boot = "",
    4.17 -            //.pv_bootloader = "pygrub",
    4.18 -            .pv_kernel = "/boot/vmlinuz-2.6.18-xenU",
    4.19 +            .hvm_boot_policy = NULL,
    4.20 +            .hvm_boot_params = NULL,
    4.21 +            .pv_bootloader = "pygrub",
    4.22 +            .pv_kernel = "/boot/vmlinuz-2.6.16.33-xen",
    4.23              .pv_ramdisk = "",
    4.24              .pv_args = "root=/dev/sda1 ro",
    4.25              .pv_bootloader_args = ""
    4.26 @@ -306,6 +309,8 @@ static xen_vm create_new_vm(xen_session 
    4.27      xen_vm vm;
    4.28      xen_vm_create(session, &vm, &vm_record);
    4.29  
    4.30 +    xen_string_string_map_free(vcpus_params);
    4.31 +
    4.32      if (!session->ok)
    4.33      {
    4.34          fprintf(stderr, "VM creation failed.\n");
     5.1 --- a/tools/python/xen/xend/XendAPI.py	Thu Feb 01 14:15:37 2007 +0000
     5.2 +++ b/tools/python/xen/xend/XendAPI.py	Thu Feb 01 11:55:31 2007 +0000
     5.3 @@ -974,7 +974,8 @@ class XendAPI(object):
     5.4                    'PV_ramdisk',
     5.5                    'PV_args',
     5.6                    'PV_bootloader_args',
     5.7 -                  'HVM_boot',
     5.8 +                  'HVM_boot_policy',
     5.9 +                  'HVM_boot_params',
    5.10                    'platform_std_VGA',
    5.11                    'platform_serial',
    5.12                    'platform_localtime',
    5.13 @@ -1020,7 +1021,8 @@ class XendAPI(object):
    5.14          'PV_ramdisk',
    5.15          'PV_args',
    5.16          'PV_bootloader_args',
    5.17 -        'HVM_boot',
    5.18 +        'HVM_boot_policy',
    5.19 +        'HVM_boot_params',
    5.20          'platform_std_VGA',
    5.21          'platform_serial',
    5.22          'platform_localtime',
    5.23 @@ -1158,8 +1160,11 @@ class XendAPI(object):
    5.24      def VM_get_PV_bootloader_args(self, session, vm_ref):
    5.25          return self.VM_get('PV_bootloader_args', session, vm_ref)
    5.26  
    5.27 -    def VM_get_HVM_boot(self, session, vm_ref):
    5.28 -        return self.VM_get('HVM_boot', session, vm_ref)
    5.29 +    def VM_get_HVM_boot_policy(self, session, vm_ref):
    5.30 +        return self.VM_get('HVM_boot_policy', session, vm_ref)
    5.31 +    
    5.32 +    def VM_get_HVM_boot_params(self, session, vm_ref):
    5.33 +        return self.VM_get('HVM_boot_params', session, vm_ref)
    5.34      
    5.35      def VM_get_platform_std_VGA(self, session, vm_ref):
    5.36          dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    5.37 @@ -1246,8 +1251,30 @@ class XendAPI(object):
    5.38              return xen_api_error(['VM_ON_CRASH_BEHAVIOUR_INVALID', vm_ref])
    5.39          return self.VM_set('actions_after_crash', session, vm_ref, action)
    5.40  
    5.41 -    def VM_set_HVM_boot(self, session, vm_ref, value):
    5.42 -        return self.VM_set('HVM_boot', session, vm_ref, value)
    5.43 +    def VM_set_HVM_boot_policy(self, session, vm_ref, value):
    5.44 +        if value != "" and value != "BIOS order":
    5.45 +            return xen_api_error(
    5.46 +                ['VALUE_NOT_SUPPORTED', 'VM.HVM_boot_policy', value,
    5.47 +                 'Xend supports only the "BIOS order" boot policy.'])
    5.48 +        else:
    5.49 +            return self.VM_set('HVM_boot_policy', session, vm_ref, value)
    5.50 +
    5.51 +    def VM_set_HVM_boot_params(self, session, vm_ref, value):
    5.52 +        return self.VM_set('HVM_boot_params', session, vm_ref, value)
    5.53 +
    5.54 +    def VM_add_to_HVM_boot_params(self, session, vm_ref, key, value):
    5.55 +        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    5.56 +        if 'HVM_boot_params' not in dom.info:
    5.57 +            dom.info['HVM_boot_params'] = {}
    5.58 +        dom.info['HVM_boot_params'][key] = value
    5.59 +        return xen_api_success_void()
    5.60 +
    5.61 +    def VM_remove_from_HVM_boot_params(self, session, vm_ref, key):
    5.62 +        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
    5.63 +        if 'HVM_boot_params' in dom.info \
    5.64 +               and key in dom.info['HVM_boot_params']:
    5.65 +            del dom.info['HVM_boot_params'][key]
    5.66 +        return xen_api_success_void()
    5.67  
    5.68      def VM_set_PV_bootloader(self, session, vm_ref, value):
    5.69          return self.VM_set('PV_bootloader', session, vm_ref, value)
    5.70 @@ -1354,7 +1381,8 @@ class XendAPI(object):
    5.71              'PV_ramdisk': xeninfo.info.get('PV_ramdisk'),
    5.72              'PV_args': xeninfo.info.get('PV_args'),
    5.73              'PV_bootloader_args': xeninfo.info.get('PV_bootloader_args'),
    5.74 -            'HVM_boot': xeninfo.info.get('HVM_boot'),
    5.75 +            'HVM_boot_policy': xeninfo.info.get('HVM_boot_policy'),
    5.76 +            'HVM_boot_params': xeninfo.info.get('HVM_boot_params'),
    5.77              'platform_std_VGA': xeninfo.get_platform_std_vga(),
    5.78              'platform_serial': xeninfo.get_platform_serial(),
    5.79              'platform_localtime': xeninfo.get_platform_localtime(),
    5.80 @@ -1622,7 +1650,7 @@ class XendAPI(object):
    5.81          xendom = XendDomain.instance()
    5.82          return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
    5.83                                                                 'io_write_kbs'))
    5.84 -    
    5.85 +
    5.86      def VIF_get_all(self, session):
    5.87          xendom = XendDomain.instance()
    5.88          vifs = [d.get_vifs() for d in XendDomain.instance().list('all')]
     6.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Feb 01 14:15:37 2007 +0000
     6.2 +++ b/tools/python/xen/xend/XendConfig.py	Thu Feb 01 11:55:31 2007 +0000
     6.3 @@ -28,7 +28,7 @@ from xen.xend.PrettyPrint import prettyp
     6.4  from xen.xend.XendConstants import DOM_STATE_HALTED
     6.5  
     6.6  log = logging.getLogger("xend.XendConfig")
     6.7 -log.setLevel(logging.WARN)
     6.8 +log.setLevel(logging.DEBUG)
     6.9  
    6.10  
    6.11  """
    6.12 @@ -164,7 +164,8 @@ XENAPI_CFG_TYPES = {
    6.13      'PV_ramdisk': str,
    6.14      'PV_args': str,
    6.15      'PV_bootloader_args': str,
    6.16 -    'HVM_boot': str,
    6.17 +    'HVM_boot_policy': str,
    6.18 +    'HVM_boot_params': dict,
    6.19      'platform_std_vga': bool0,
    6.20      'platform_serial': str,
    6.21      'platform_localtime': bool0,
    6.22 @@ -361,7 +362,8 @@ class XendConfig(dict):
    6.23              'PV_ramdisk': '',
    6.24              'PV_args': '',
    6.25              'PV_bootloader_args': '',
    6.26 -            'HVM_boot': '',
    6.27 +            'HVM_boot_policy': '',
    6.28 +            'HVM_boot_params': {},
    6.29              'memory_static_min': 0,
    6.30              'memory_dynamic_min': 0,
    6.31              'shadow_memory': 0,
    6.32 @@ -496,6 +498,12 @@ class XendConfig(dict):
    6.33                      log.warn("Unable to parse key %s: %s: %s" %
    6.34                               (key, str(val), e))
    6.35  
    6.36 +        # Compatibility hack -- can go soon.
    6.37 +        boot_order = sxp.child_value(sxp_cfg, 'HVM_boot')
    6.38 +        if boot_order:
    6.39 +            cfg['HVM_boot_policy'] = 'BIOS order'
    6.40 +            cfg['HVM_boot_params'] = { 'order' : boot_order }
    6.41 +
    6.42          # Parsing the device SXP's. In most cases, the SXP looks
    6.43          # like this:
    6.44          #
    6.45 @@ -768,7 +776,7 @@ class XendConfig(dict):
    6.46          if 'image' in xapi_dict:
    6.47              self['image'].update(xapi_dict['image'])
    6.48          else:
    6.49 -            hvm = self['HVM_boot'] != ''
    6.50 +            hvm = self['HVM_boot_policy'] != ''
    6.51              self['image']['type'] = hvm and 'hvm' or 'linux'
    6.52              if hvm:
    6.53                  self['image']['hvm'] = {'devices': {}}
     7.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Feb 01 14:15:37 2007 +0000
     7.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Feb 01 11:55:31 2007 +0000
     7.3 @@ -1648,14 +1648,15 @@ class XendDomainInfo:
     7.4          kernel          = self.info['PV_kernel']
     7.5          ramdisk         = self.info['PV_ramdisk']
     7.6          args            = self.info['PV_args']
     7.7 -        boot            = self.info['HVM_boot']
     7.8 +        boot            = self.info['HVM_boot_policy']
     7.9  
    7.10          if boot:
    7.11              # HVM booting.
    7.12              self.info['image']['type'] = 'hvm'
    7.13              if not 'devices' in self.info['image']:
    7.14                  self.info['image']['devices'] = {}
    7.15 -            self.info['image']['devices']['boot'] = boot
    7.16 +            self.info['image']['devices']['boot'] = \
    7.17 +                self.info['HVM_boot_params'].get('order', 'dc')
    7.18          elif not blexec and kernel:
    7.19              # Boot from dom0.  Nothing left to do -- the kernel and ramdisk
    7.20              # will be picked up by image.py.
     8.1 --- a/tools/python/xen/xm/messages/en/xen-xm.po	Thu Feb 01 14:15:37 2007 +0000
     8.2 +++ b/tools/python/xen/xm/messages/en/xen-xm.po	Thu Feb 01 11:55:31 2007 +0000
     8.3 @@ -19,7 +19,7 @@
     8.4  msgid ""
     8.5  msgstr ""
     8.6  "Project-Id-Version: Xen-xm 3.0\n"
     8.7 -"PO-Revision-Date: 2007-01-30 17:15+0000\n"
     8.8 +"PO-Revision-Date: 2007-01-31 12:34+0000\n"
     8.9  "Last-Translator: Ewan Mellor <ewan@xensource.com>\n"
    8.10  "Language-Team: xen-devel <xen-devel@lists.xensource.com>\n"
    8.11  "MIME-Version: 1.0\n"
    8.12 @@ -41,6 +41,9 @@ msgstr "The method %(1)s takes %(2)s arg
    8.13  msgid "SESSION_AUTHENTICATION_FAILED"
    8.14  msgstr "Permission denied."
    8.15  
    8.16 +msgid "VALUE_NOT_SUPPORTED"
    8.17 +msgstr "Value \"%(2)s\" for %(1)s is not supported by this server.  The server said \"%(3)s\"."
    8.18 +
    8.19  msgid "HOST_CPU_HANDLE_INVALID"
    8.20  msgstr "The host_cpu handle %(1)s is invalid."
    8.21