Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added run state checks to the vm run loops to allow stopping of VMs
Jack Lange [Fri, 5 Nov 2010 22:43:46 +0000 (17:43 -0500)]
palacios/src/palacios/svm.c
palacios/src/palacios/vmx.c

index 4ba619b..a1fad8d 100644 (file)
@@ -586,6 +586,12 @@ int v3_start_svm_guest(struct guest_info * info) {
     v3_start_time(info);
 
     while (1) {
+
+       if (info->vm_info->run_state == VM_STOPPED) {
+           info->core_run_state = CORE_STOPPED;
+           break;
+       }
+       
        if (v3_svm_enter(info) == -1) {
            vmcb_ctrl_t * guest_ctrl = GET_VMCB_CTRL_AREA((vmcb_t*)(info->vmm_data));
            addr_t host_addr;
@@ -622,6 +628,13 @@ int v3_start_svm_guest(struct guest_info * info) {
 
            break;
        }
+
+
+       if (info->vm_info->run_state == VM_STOPPED) {
+           info->core_run_state = CORE_STOPPED;
+           break;
+       }
+
        
 /*
        if ((info->num_exits % 5000) == 0) {
index 3417767..6ada30f 100644 (file)
@@ -778,12 +778,24 @@ int v3_start_vmx_guest(struct guest_info * info) {
     v3_start_time(info);
 
     while (1) {
+
+       if (info->vm_info->run_state == VM_STOPPED) {
+           info->core_run_state = CORE_STOPPED;
+           break;
+       }
+
        if (v3_vmx_enter(info) == -1) {
            v3_print_vmcs();
            print_exit_log(info);
            return -1;
        }
 
+
+
+       if (info->vm_info->run_state == VM_STOPPED) {
+           info->core_run_state = CORE_STOPPED;
+           break;
+       }
 /*
        if ((info->num_exits % 5000) == 0) {
            V3_Print("VMX Exit number %d\n", (uint32_t)info->num_exits);