From: Jack Lange Date: Fri, 28 Oct 2011 17:58:42 +0000 (-0400) Subject: enabled stopping a VM before the secondary cores have been initialized X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=e3f45cda75462948e8d2ad89a6167fbecc8d13f5 enabled stopping a VM before the secondary cores have been initialized --- diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index d583657..f61fadf 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -669,6 +669,12 @@ int v3_start_svm_guest(struct guest_info * info) { PrintDebug("SVM core %u (on %u): Waiting for core initialization\n", info->vcpu_id, info->pcpu_id); while (info->core_run_state == CORE_STOPPED) { + + if (info->vm_info->run_state == VM_STOPPED) { + // The VM was stopped before this core was initialized. + return 0; + } + v3_yield(info); //PrintDebug("SVM core %u: still waiting for INIT\n", info->vcpu_id); } diff --git a/palacios/src/palacios/vmx.c b/palacios/src/palacios/vmx.c index 73b5af9..49be909 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -915,6 +915,12 @@ int v3_start_vmx_guest(struct guest_info * info) { PrintDebug("VMX core %u: Waiting for core initialization\n", info->vcpu_id); while (info->core_run_state == CORE_STOPPED) { + + if (info->vm_info->run_state == VM_STOPPED) { + // The VM was stopped before this core was initialized. + return 0; + } + v3_yield(info); //PrintDebug("VMX core %u: still waiting for INIT\n",info->vcpu_id); }