os-cmpi-xen

changeset 87:4ae953dc7f33

Added initial support for creating HVM guests via VirtualSystemManagementService.DefineSystem().

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri Feb 23 14:56:02 2007 -0700 (2007-02-23)
parents ff99c4398c16
children 9a96ebba2b60
files ChangeLog schema/Xen_ComputerSystemSettingData.mof src/Xen_SettingDataParser.y src/Xen_VirtualSystemManagementService.c
line diff
     1.1 --- a/ChangeLog	Fri Feb 23 10:24:18 2007 -0700
     1.2 +++ b/ChangeLog	Fri Feb 23 14:56:02 2007 -0700
     1.3 @@ -1,3 +1,9 @@
     1.4 +-------------------------------------------------------------------
     1.5 +Fri Feb 23 14:53:40 MST 2007 - jfehlig@novell.com
     1.6 +
     1.7 +        - Added initial support for creating HVM guests via
     1.8 +          VirtualSystemManagementService.DefineSystem().
     1.9 +
    1.10  -------------------------------------------------------------------
    1.11  Fri Feb 23 10:22:17 MST 2007 - jfehlig@novell.com
    1.12  
     2.1 --- a/schema/Xen_ComputerSystemSettingData.mof	Fri Feb 23 10:24:18 2007 -0700
     2.2 +++ b/schema/Xen_ComputerSystemSettingData.mof	Fri Feb 23 14:56:02 2007 -0700
     2.3 @@ -43,6 +43,12 @@ class Xen_ComputerSystemSettingData : CI
     2.4  	"property Bootloader.")]
     2.5     string BootloaderOptions;
     2.6  
     2.7 +   [Description ("String used to specify order of boot devices. "
     2.8 +	"This property will only be examined by the instrumentation "
     2.9 +	"when property VirtualSystemType is set to \"Xen HVM\". "
    2.10 +	"BootOrder will be ignored for all other virtual system types.")]
    2.11 +   string BootOrder;
    2.12 +
    2.13     [Description ("UUID assigned to this domain.")]
    2.14     string UUID;
    2.15  
     3.1 --- a/src/Xen_SettingDataParser.y	Fri Feb 23 10:24:18 2007 -0700
     3.2 +++ b/src/Xen_SettingDataParser.y	Fri Feb 23 14:56:02 2007 -0700
     3.3 @@ -77,7 +77,7 @@ property:	PROPERTYNAME '=' STRING ';'
     3.4  			fprintf(stderr,"\ttype = CMPI_sint64\n");
     3.5  			fprintf(stderr,"\tvalue = %lld\n",$3);
     3.6  			unsigned long long value = $3;
     3.7 -			CMSetProperty( *_INSTANCE, "VirtualQuantity", &(value), CMPI_uint64 );
     3.8 +			CMSetProperty( *_INSTANCE, $1, &(value), CMPI_uint64 );
     3.9  			free($1);
    3.10  			}
    3.11  
     4.1 --- a/src/Xen_VirtualSystemManagementService.c	Fri Feb 23 10:24:18 2007 -0700
     4.2 +++ b/src/Xen_VirtualSystemManagementService.c	Fri Feb 23 14:56:02 2007 -0700
     4.3 @@ -33,6 +33,7 @@
     4.4  #include <xen_vm.h>
     4.5  #include <xen_vif.h>
     4.6  #include <xen_vbd.h>
     4.7 +#include <xen_console.h>
     4.8  
     4.9  /* Include utility functions */
    4.10  #include "cmpiutil.h"
    4.11 @@ -101,6 +102,8 @@ static int disk_rasd2vmconfig(CMPIInstan
    4.12                                CMPIStatus *status);
    4.13  static int nic_rasd2vmconfig(CMPIInstance *instance, xen_vif_record **vif_rec,
    4.14                               CMPIStatus *status);
    4.15 +static int con_rasd2vmconfig(CMPIInstance *instance, xen_console_record *con_rec,
    4.16 +                             CMPIStatus *status);
    4.17  static CMPIInstance *parse_embedded_instance(char *instanceStr);
    4.18  
    4.19  
    4.20 @@ -893,8 +896,8 @@ static CMPIStatus InvokeMethod(
    4.21     
    4.22        xen_vm_record *vmRec;
    4.23        if (!xen_utils_get_domain_from_sd_OP(session, &vmRec, argdata.value.ref)) {
    4.24 -         _SBLIM_TRACE(1,("--- Unable to retrieve domain recored from object path"));
    4.25 -         CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_INVALID_PARAMETER, "Unable to retrieve domain recored from object path");
    4.26 +         _SBLIM_TRACE(1,("--- Unable to retrieve domain record from object path"));
    4.27 +         CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_INVALID_PARAMETER, "Unable to retrieve domain record from object path");
    4.28           rc = 5;
    4.29           goto Exit;
    4.30        }
    4.31 @@ -1109,10 +1112,10 @@ static int create_vm(char *vsSettings, C
    4.32     CMPIInstance *instance;
    4.33     CMPIObjectPath *objectpath;
    4.34     char *settingclassname;
    4.35 -   CMPIData propertyvalue;
    4.36 -   xen_vm_record vm_rec;
    4.37 +   xen_vm_record *vm_rec;
    4.38     xen_vbd_record_set *vbds = NULL;
    4.39     xen_vif_record_set *vifs = NULL;
    4.40 +   xen_console_record *con_rec = NULL;
    4.41     xen_vm vm = NULL;
    4.42     int i;
    4.43     int ccode;
    4.44 @@ -1120,9 +1123,14 @@ static int create_vm(char *vsSettings, C
    4.45     
    4.46     _SBLIM_TRACE(2,("--- vsSettings=\"%s\"", vsSettings));
    4.47  
    4.48 -   memset(&vm_rec, 0, sizeof(xen_vm_record));
    4.49 +   vm_rec = xen_vm_record_alloc();
    4.50 +   if (vm_rec == NULL) {
    4.51 +      _SBLIM_TRACE(1,("--- Cannot malloc memory for vm record"));
    4.52 +      CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Unable to malloc memory");
    4.53 +      return 0;
    4.54 +   }
    4.55 +      
    4.56     instance = parse_embedded_instance(vsSettings);
    4.57 -   
    4.58     if (instance == NULL) { /* parser returns zero for success, non-zero for error */
    4.59        _SBLIM_TRACE(1,("--- Error parsing VirtualSystemSettingData: \"%s\"", vsSettings));
    4.60        CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER, "Cannot parse VirtualSystemSettingData");
    4.61 @@ -1137,21 +1145,22 @@ static int create_vm(char *vsSettings, C
    4.62     settingclassname = CMGetCharPtr(CMGetClassName(objectpath, NULL));
    4.63     _SBLIM_TRACE(2,("--- settingclassname=%s", settingclassname));
    4.64     
    4.65 -   /* Check if this setting is for the virtual computer system or for a virtual device */
    4.66 +   /* Ensure we have a Xen_ComputerSystemSettingData */
    4.67     if (strcmp(settingclassname,"Xen_ComputerSystemSettingData") != 0) {
    4.68        _SBLIM_TRACE(1,("--- Unrecognized setting data class - %s", settingclassname));
    4.69        CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER, "Unrecognized setting data class");
    4.70        return 0;
    4.71     }
    4.72     
    4.73 -   if (!vssd2xenconfig(instance, &vm_rec, status)) {
    4.74 +   /* Convert the domain settings to respective xen settings. */
    4.75 +   if (!vssd2xenconfig(instance, vm_rec, status)) {
    4.76        _SBLIM_TRACE(1,("--- failed to convert VSSD to xen_vmrecord"));
    4.77 +      xen_vm_record_free(vm_rec);
    4.78        return 0;
    4.79     }
    4.80     
    4.81 -   /*
    4.82 -    * Convert resource settings to their respecitve xen settings.
    4.83 -    */
    4.84 +
    4.85 +   /* Convert resource settings to their respecitve xen settings. */
    4.86     char *setting;
    4.87     for (i = 0; i < CMGetArrayCount(resourceSettings, NULL); i++) {
    4.88        CMPIData settingdata = CMGetArrayElementAt(resourceSettings, i, status);
    4.89 @@ -1191,7 +1200,7 @@ static int create_vm(char *vsSettings, C
    4.90        if (strcmp(settingclassname,"Xen_ProcessorSettingData") == 0) {
    4.91           _SBLIM_TRACE(2,("--- adding Xen_ProcessorSettingData to configuration"));
    4.92           
    4.93 -         if (!proc_rasd2vmconfig(instance, &vm_rec, status)) {
    4.94 +         if (!proc_rasd2vmconfig(instance, vm_rec, status)) {
    4.95              _SBLIM_TRACE(1,("--- Error parsing processor settings"));
    4.96              goto Error;
    4.97           }
    4.98 @@ -1200,14 +1209,14 @@ static int create_vm(char *vsSettings, C
    4.99           _SBLIM_TRACE(2,("--- adding Xen_MemorySettingData to configuration"));
   4.100           
   4.101           /* Fail if duplicate memory rasd's? */
   4.102 -         if (vm_rec.memory_dynamic_max > 0) {
   4.103 +         if (vm_rec->memory_dynamic_max > 0) {
   4.104              _SBLIM_TRACE(1,("--- More than one memroy setting data specified"));
   4.105              CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER,
   4.106                                   "More than one memory setting data specified");
   4.107              goto Error;
   4.108           }
   4.109              
   4.110 -         if (!mem_rasd2vmconfig(instance, &vm_rec, status)) {
   4.111 +         if (!mem_rasd2vmconfig(instance, vm_rec, status)) {
   4.112              _SBLIM_TRACE(1,("--- Error parsing memory settings"));
   4.113              goto Error;
   4.114           }
   4.115 @@ -1234,6 +1243,21 @@ static int create_vm(char *vsSettings, C
   4.116  
   4.117           ADD_DEVICE_TO_LIST(vifs, vif_rec, xen_vif_record);
   4.118        }
   4.119 +      else if (strcmp(settingclassname,"Xen_ConsoleSettingData") == 0) {
   4.120 +         _SBLIM_TRACE(2,("--- adding Xen_ConsoleSettingData to configuration"));
   4.121 +         
   4.122 +         con_rec = xen_console_record_alloc();
   4.123 +         if (con_rec == NULL) {
   4.124 +            _SBLIM_TRACE(1,("--- Cannot malloc memory for console record"));
   4.125 +            CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Unable to malloc memory");
   4.126 +            goto Error;
   4.127 +         }
   4.128 +            
   4.129 +         if (!con_rasd2vmconfig(instance, con_rec, status)) {
   4.130 +            _SBLIM_TRACE(1,("--- Error parsing console settings"));
   4.131 +            goto Error;
   4.132 +         }
   4.133 +      }
   4.134        else {
   4.135           _SBLIM_TRACE(1,("--- Unrecognized setting data class - %s", settingclassname));
   4.136           goto Error;
   4.137 @@ -1241,7 +1265,7 @@ static int create_vm(char *vsSettings, C
   4.138     }
   4.139  
   4.140     /* We have all of the settings.  First create the vm. */
   4.141 -   if (!xen_vm_create(session->xen, &vm, &vm_rec)) {
   4.142 +   if (!xen_vm_create(session->xen, &vm, vm_rec)) {
   4.143        XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
   4.144        _SBLIM_TRACE(1,("--- xen_vm_create failed: %s", error_msg));
   4.145        CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_FAILED, error_msg);
   4.146 @@ -1290,8 +1314,28 @@ static int create_vm(char *vsSettings, C
   4.147        xen_vif_free(new_vif);
   4.148     }
   4.149  
   4.150 +   /* Add console device if specified */
   4.151 +   if (con_rec) {
   4.152 +      con_rec->vm = &vm_record_opt;
   4.153 +      xen_console new_con;
   4.154 +      ccode = xen_console_create(session->xen, &new_con, con_rec);
   4.155 +      /* Set vm field of console record to NULL so it is not freed */
   4.156 +      con_rec->vm = NULL;
   4.157 +      if (!ccode)
   4.158 +      {
   4.159 +         XEN_UTILS_GET_ERROR_STRING(error_msg, session->xen);
   4.160 +         _SBLIM_TRACE(1,("--- xen_console_create failed %s", error_msg));
   4.161 +         CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_FAILED, error_msg);
   4.162 +         goto Error;
   4.163 +      }
   4.164 +      xen_console_free(new_con);
   4.165 +   }
   4.166 +   
   4.167 +   xen_console_record_free(con_rec);
   4.168     xen_vbd_record_set_free(vbds);
   4.169     xen_vif_record_set_free(vifs);
   4.170 +   xen_vm_record_free(vm_rec);
   4.171 +
   4.172     *result = vm;
   4.173     
   4.174     return 1;
   4.175 @@ -1304,8 +1348,10 @@ static int create_vm(char *vsSettings, C
   4.176        remove_vm(vm);
   4.177        xen_vm_free(vm);
   4.178     }
   4.179 +   xen_console_record_free(con_rec);
   4.180     xen_vbd_record_set_free(vbds);
   4.181     xen_vif_record_set_free(vifs);
   4.182 +   xen_vm_record_free(vm_rec);
   4.183     *result = NULL;
   4.184     
   4.185     return 0;
   4.186 @@ -1512,6 +1558,7 @@ static void remove_vm(xen_vm vm)
   4.187  static int vssd2xenconfig(CMPIInstance *vssd, xen_vm_record *vm_rec, CMPIStatus *status)
   4.188  {
   4.189     CMPIData propertyvalue;
   4.190 +   char *vsType;;
   4.191  
   4.192     /*
   4.193      * Get domain name.
   4.194 @@ -1524,87 +1571,123 @@ static int vssd2xenconfig(CMPIInstance *
   4.195        CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER, "Unable to retrieve VirtualSystemIdentifier (name)  property from virtual system setting data");
   4.196        return 0;
   4.197     }
   4.198 -   vm_rec->name_label = CMGetCharPtr(propertyvalue.value.string);
   4.199 +   vm_rec->name_label = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.200  
   4.201      /* Get UUID, if specified */
   4.202     propertyvalue = CMGetProperty(vssd, "UUID", status);
   4.203     if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue))
   4.204 -      vm_rec->uuid = CMGetCharPtr(propertyvalue.value.string);
   4.205 +      vm_rec->uuid = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.206     
   4.207     /*
   4.208      * TODO:
   4.209      * 1. Handle defaults, e.g. missing required domain setting.
   4.210 -    * 2. Handle bootloader specification, hvm, ...
   4.211      */
   4.212 -   propertyvalue = CMGetProperty(vssd, "Bootloader", status);
   4.213 -   if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.214 -      vm_rec->pv_bootloader = CMGetCharPtr(propertyvalue.value.string);
   4.215  
   4.216 -      /* If Bootloader specified, get options. */
   4.217 -      /* WARNING!
   4.218 -       * Should we ensure that BootloaderOptions is specified if
   4.219 -       * Bootloader is specified?  For domUloader probably but
   4.220 -       * pygrub should work with no options.
   4.221 -       */
   4.222 -      propertyvalue = CMGetProperty(vssd, "BootloaderOptions", status);
   4.223 -      if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.224 -         vm_rec->pv_bootloader_args = CMGetCharPtr(propertyvalue.value.string);
   4.225 -      }
   4.226 -   }
   4.227 -
   4.228 -   /* Only honor Kernel if Bootloader not specified. */
   4.229 -   propertyvalue = CMGetProperty(vssd, "Kernel", status);
   4.230 -   if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue) &&
   4.231 -       vm_rec->pv_bootloader == NULL) {
   4.232 -      vm_rec->pv_kernel = CMGetCharPtr(propertyvalue.value.string);
   4.233 -
   4.234 -      /* If Kernel specified, get RAMDisk. */
   4.235 -      /* WARNING!
   4.236 -       * Should we ensure that RAMDisk is specified if
   4.237 -       * Kernel is specified?  For Unix'ish guests we probably need
   4.238 -       * RAMDisk but what about OS's with no notion of RAMDisk?
   4.239 -       */
   4.240 -      propertyvalue = CMGetProperty(vssd, "RAMDisk", status);
   4.241 -      if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.242 -         vm_rec->pv_ramdisk = CMGetCharPtr(propertyvalue.value.string);
   4.243 -      }
   4.244 +   /* Paravirtual or HVM domain? */
   4.245 +   propertyvalue = CMGetProperty(vssd, "VirtualSystemType", status);
   4.246 +   if ((status->rc != CMPI_RC_OK) || CMIsNullValue(propertyvalue)) {
   4.247 +      _SBLIM_TRACE(1,("--- VirtualSystemType not specified"));
   4.248 +      CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER,
   4.249 +                           "VirtualSystemType not specified");
   4.250 +      return 0;
   4.251     }
   4.252     
   4.253 -   propertyvalue = CMGetProperty(vssd, "KernelOptions", status);
   4.254 -   if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.255 -      vm_rec->pv_args = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.256 +   vsType = CMGetCharPtr(propertyvalue.value.string);
   4.257 +   if (vsType == NULL) {
   4.258 +      _SBLIM_TRACE(1,("--- VirtualSystemType not specified"));
   4.259 +      CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER,
   4.260 +                           "VirtualSystemType not specified");
   4.261 +      return 0;
   4.262     }
   4.263 +
   4.264 +   if (strcasecmp(vsType, "Xen Paravirtual") == 0) {
   4.265 +
   4.266 +      propertyvalue = CMGetProperty(vssd, "Bootloader", status);
   4.267 +      if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.268 +         vm_rec->pv_bootloader = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.269 +
   4.270 +         /* If Bootloader specified, get options. */
   4.271 +         /* WARNING!
   4.272 +          * Should we ensure that BootloaderOptions is specified if
   4.273 +          * Bootloader is specified?  For domUloader probably but
   4.274 +          * pygrub should work with no options.
   4.275 +          */
   4.276 +         propertyvalue = CMGetProperty(vssd, "BootloaderOptions", status);
   4.277 +         if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.278 +            vm_rec->pv_bootloader_args = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.279 +         }
   4.280 +      }
   4.281 +
   4.282 +      /* Only honor Kernel if Bootloader not specified. */
   4.283 +      propertyvalue = CMGetProperty(vssd, "Kernel", status);
   4.284 +      if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue) &&
   4.285 +          vm_rec->pv_bootloader == NULL) {
   4.286 +         vm_rec->pv_kernel = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.287 +
   4.288 +         /* If Kernel specified, get RAMDisk. */
   4.289 +         /* WARNING!
   4.290 +          * Should we ensure that RAMDisk is specified if
   4.291 +          * Kernel is specified?  For Unix'ish guests we probably need
   4.292 +          * RAMDisk but what about OS's with no notion of RAMDisk?
   4.293 +          */
   4.294 +         propertyvalue = CMGetProperty(vssd, "RAMDisk", status);
   4.295 +         if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.296 +            vm_rec->pv_ramdisk = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.297 +         }
   4.298 +      }
   4.299     
   4.300 -   propertyvalue = CMGetProperty(vssd, "Root", status);
   4.301 -   if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.302 -      char *root = CMGetCharPtr(propertyvalue.value.string);
   4.303 -      int len;
   4.304 -      char *temp;
   4.305 -      if (vm_rec->pv_args) {
   4.306 -         char *args = vm_rec->pv_args;
   4.307 -         len = strlen(args) + strlen(root) + 6 + 1; /* 6 -> " root=" */
   4.308 -         temp = malloc(len);
   4.309 -         if (temp == NULL) {
   4.310 +      propertyvalue = CMGetProperty(vssd, "KernelOptions", status);
   4.311 +      if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.312 +         vm_rec->pv_args = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.313 +      }
   4.314 +   
   4.315 +      propertyvalue = CMGetProperty(vssd, "Root", status);
   4.316 +      if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) {
   4.317 +         char *root = CMGetCharPtr(propertyvalue.value.string);
   4.318 +         int len;
   4.319 +         char *temp;
   4.320 +         if (vm_rec->pv_args) {
   4.321 +            char *args = vm_rec->pv_args;
   4.322 +            len = strlen(args) + strlen(root) + 6 + 1; /* 6 -> " root=" */
   4.323 +            temp = malloc(len);
   4.324 +            if (temp == NULL) {
   4.325 +               free(args);
   4.326 +               _SBLIM_TRACE(1,("--- Cannot malloc memory for kernel args"));
   4.327 +               CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Unable to malloc memory");
   4.328 +               return 0;
   4.329 +            }
   4.330 +            snprintf(temp, len, "%s root=%s", args, root);
   4.331 +            vm_rec->pv_args = temp;
   4.332              free(args);
   4.333 -            _SBLIM_TRACE(1,("--- Cannot malloc memory for kernel args"));
   4.334 -            CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Unable to malloc memory");
   4.335 -            return 0;
   4.336           }
   4.337 -         snprintf(temp, len, "%s root=%s", args, root);
   4.338 -         vm_rec->pv_args = temp;
   4.339 -         free(args);
   4.340 +         else {
   4.341 +            len = strlen(root) + 5 + 1; /* 5 -> "root=" */
   4.342 +            temp = malloc(len);
   4.343 +            if (temp == NULL) {
   4.344 +               _SBLIM_TRACE(1,("--- Cannot malloc memory for kernel args"));
   4.345 +               CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Unable to malloc memory");
   4.346 +               return 0;
   4.347 +            }
   4.348 +            snprintf(temp, len, "root=%s", root);
   4.349 +            vm_rec->pv_args = temp;
   4.350 +         }
   4.351        }
   4.352 -      else {
   4.353 -         len = strlen(root) + 5 + 1; /* 5 -> "root=" */
   4.354 -         temp = malloc(len);
   4.355 -         if (temp == NULL) {
   4.356 -            _SBLIM_TRACE(1,("--- Cannot malloc memory for kernel args"));
   4.357 -            CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERROR_SYSTEM, "Unable to malloc memory");
   4.358 -            return 0;
   4.359 -         }
   4.360 -         snprintf(temp, len, "root=%s", root);
   4.361 -         vm_rec->pv_args = temp;
   4.362 +   }
   4.363 +   else if (strcasecmp(vsType, "Xen HVM") == 0) {
   4.364 +      propertyvalue = CMGetProperty(vssd, "BootOrder", status);
   4.365 +      if ((status->rc != CMPI_RC_OK) || CMIsNullValue(propertyvalue)) {
   4.366 +         _SBLIM_TRACE(1,("--- No BootOrder specified for HVM guest"));
   4.367 +         CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER,
   4.368 +                              "No BootOrder specified for HVM guest");
   4.369 +         return 0;
   4.370        }
   4.371 +      vm_rec->hvm_boot = strdup(CMGetCharPtr(propertyvalue.value.string));
   4.372 +   }
   4.373 +   else {
   4.374 +      _SBLIM_TRACE(1,("--- Invalide VirtualSystemType %s specified", vsType));
   4.375 +      CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER,
   4.376 +                           "Invalid VirtualSystemType specified");
   4.377 +      return 0;
   4.378     }
   4.379     
   4.380     return 1;
   4.381 @@ -1764,7 +1847,39 @@ static int nic_rasd2vmconfig(CMPIInstanc
   4.382  }
   4.383  
   4.384  
   4.385 +static int con_rasd2vmconfig(CMPIInstance *con_rasd, xen_console_record *con_rec,
   4.386 +                             CMPIStatus *status)
   4.387 +{
   4.388 +   CMPIData propertyvalue;
   4.389     
   4.390 +   propertyvalue = CMGetProperty(con_rasd, "Protocol", status);
   4.391 +   if ((status->rc != CMPI_RC_OK) || CMIsNullValue(propertyvalue)) {
   4.392 +      _SBLIM_TRACE(1,("--- No protocol field specified in console setting data"));
   4.393 +      CMSetStatusWithChars(_BROKER, status,  CMPI_RC_ERR_INVALID_PARAMETER, "No protocol specified in console setting data");
   4.394 +      return 0;
   4.395 +   }
   4.396 +   
   4.397 +   switch (propertyvalue.value.uint16) {
   4.398 +      case 0:
   4.399 +         con_rec->protocol = XEN_CONSOLE_PROTOCOL_VT100;
   4.400 +         break;
   4.401 +      case 1:
   4.402 +         con_rec->protocol = XEN_CONSOLE_PROTOCOL_RFB;
   4.403 +         break;
   4.404 +      case 2:
   4.405 +         con_rec->protocol = XEN_CONSOLE_PROTOCOL_RDP;
   4.406 +         break;
   4.407 +      default:
   4.408 +         _SBLIM_TRACE(1,("--- Invalid protocol specified in console setting data"));
   4.409 +         CMSetStatusWithChars(_BROKER, status, CMPI_RC_ERR_INVALID_PARAMETER, "Invalid protocol specified in console setting data");
   4.410 +         return 0;
   4.411 +   }
   4.412 +
   4.413 +   return 1;
   4.414 +}
   4.415 +
   4.416 +
   4.417 +
   4.418  // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
   4.419  // THE FOLLOWING CODE IS REQUIRED UNTIL EMBEDDEDOBJECT SUPPORT IS WORKING!!! 
   4.420  //