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?a=commitdiff_plain;h=ebef9a2d1ef75c5c5f55f6ecd6a259ffd4b7461e;p=palacios-OLD.git 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 cd741c9..4614e9e 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -654,6 +654,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 505d61c..ec59df0 100644 --- a/palacios/src/palacios/vmx.c +++ b/palacios/src/palacios/vmx.c @@ -910,6 +910,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); }