From: Peter Dinda Date: Wed, 7 Aug 2013 21:26:54 +0000 (-0500) Subject: VM configuration attempts to roll back on failure X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=618756fd1cd3eb49db2a77202bcc26dedfd564b5 VM configuration attempts to roll back on failure --- diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index de646bf..e463e32 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -595,7 +595,9 @@ struct v3_vm_info * v3_config_guest(void * cfg_blob, void * priv_data) { V3_Print(vm, VCORE_NONE, "Preconfiguration\n"); if (pre_config_vm(vm, vm->cfg_data->cfg) == -1) { - PrintError(vm, VCORE_NONE, "Error in preconfiguration\n"); + PrintError(vm, VCORE_NONE, "Error in preconfiguration, attempting to free\n"); + vm->run_state=VM_ERROR; + v3_free_vm(vm); return NULL; } @@ -611,7 +613,9 @@ struct v3_vm_info * v3_config_guest(void * cfg_blob, void * priv_data) { info->core_cfg_data = per_core_cfg; if (pre_config_core(info, per_core_cfg) == -1) { - PrintError(vm, VCORE_NONE, "Error in core %d preconfiguration\n", i); + PrintError(vm, VCORE_NONE, "Error in core %d preconfiguration, attempting to free guest\n", i); + vm->run_state=VM_ERROR; + v3_free_vm(vm); return NULL; } @@ -623,7 +627,9 @@ struct v3_vm_info * v3_config_guest(void * cfg_blob, void * priv_data) { V3_Print(vm, VCORE_NONE, "Post Configuration\n"); if (post_config_vm(vm, vm->cfg_data->cfg) == -1) { - PrintError(vm, VCORE_NONE, "Error in postconfiguration\n"); + PrintError(vm, VCORE_NONE, "Error in postconfiguration, attempting to free guest\n"); + vm->run_state=VM_ERROR; + v3_free_vm(vm); return NULL; }