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.


minor fixes for stopping VMs
Jack Lange [Wed, 24 Nov 2010 04:41:47 +0000 (22:41 -0600)]
palacios/src/devices/8254.c
palacios/src/devices/cga.c
palacios/src/palacios/vmm.c

index e5498b9..7bf6a8c 100644 (file)
@@ -680,8 +680,10 @@ static int pit_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
     ullong_t reload_val = (ullong_t)cpu_khz * 1000;
 
     pit_state = (struct pit *)V3_Malloc(sizeof(struct pit));
+
     V3_ASSERT(pit_state != NULL);
     pit_state->speaker = 0;
+    pit_state->vm = vm;
 
     dev = v3_add_device(vm, dev_id, &dev_ops, pit_state);
 
index febc36e..3f137e6 100644 (file)
@@ -269,8 +269,7 @@ static int crtc_index_write(struct guest_info * core, uint16_t port, void * src,
                   port, port);
        return -1;
     }
-                  
-
+    
     video_state->crtc_index_reg = *(uint8_t *)src;
 
     // Only do the passthrough IO for the first byte
@@ -302,6 +301,7 @@ int v3_cons_get_fb(struct vm_device * frontend_dev, uint8_t * dst, uint_t offset
     V3_ASSERT(offset < SCREEN_SIZE);
     V3_ASSERT(length <= SCREEN_SIZE);
     V3_ASSERT(offset + length <= SCREEN_SIZE);
+
     memcpy(dst, state->framebuf + screen_byte_offset + offset, length);
 
     return 0;
@@ -309,15 +309,15 @@ int v3_cons_get_fb(struct vm_device * frontend_dev, uint8_t * dst, uint_t offset
 
 
 
-static int free_device(struct video_internal * video_state) {
+static int free_cga(struct video_internal * video_state) {
 
     if (video_state->framebuf_pa) {
+       PrintError("Freeing framebuffer PA %p\n", (void *)(video_state->framebuf_pa));
        V3_FreePages((void *)(video_state->framebuf_pa), (FRAMEBUF_SIZE / 4096));
     }
 
     v3_unhook_mem(video_state->dev->vm, V3_MEM_CORE_ANY, START_ADDR);
 
-
     V3_Free(video_state);
 
     return 0;
@@ -325,7 +325,7 @@ static int free_device(struct video_internal * video_state) {
 
 
 static struct v3_device_ops dev_ops = {
-    .free = (int (*)(void *))free_device,
+    .free = (int (*)(void *))free_cga,
 };
 
 static int cga_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
index 6bf1a29..de6ee04 100644 (file)
@@ -283,11 +283,15 @@ int v3_stop_vm(struct v3_vm_info * vm) {
        }
 
        if (still_running == 0) {
-           break;
+           break;
        }
-       
+
+       V3_Print("Yielding\n");
+
        v3_yield(NULL);
     }
+    
+    V3_Print("VM stopped. Returning\n");
 
     return 0;
 }