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.


restructured device manager deinitialization
Jack Lange [Wed, 12 Jan 2011 04:23:46 +0000 (22:23 -0600)]
palacios/include/palacios/vmm_dev_mgr.h
palacios/src/palacios/vm_guest.c
palacios/src/palacios/vmm.c
palacios/src/palacios/vmm_dev_mgr.c

index 3e52d9a..ea45784 100644 (file)
@@ -88,14 +88,18 @@ struct vm_device * v3_find_dev(struct v3_vm_info * info, const char * dev_name);
 
 
 int v3_init_dev_mgr(struct v3_vm_info * vm);
-int v3_dev_mgr_deinit(struct v3_vm_info * vm);
+int v3_deinit_dev_mgr(struct v3_vm_info * vm);
 
+int v3_free_vm_devices(struct v3_vm_info * vm);
 
 
 
 
 
-int v3_init_devices();
+
+
+int V3_init_devices();
+
 
 
 struct v3_device_ops {
index aa42528..92d206f 100644 (file)
@@ -542,15 +542,15 @@ int v3_free_vm_internal(struct v3_vm_info * vm) {
 #ifdef CONFIG_SVM
        case V3_SVM_CPU:
        case V3_SVM_REV3_CPU:
-           v3_init_svm_io_map(vm);
-           v3_init_svm_msr_map(vm);
+           v3_deinit_svm_io_map(vm);
+           v3_deinit_svm_msr_map(vm);
            break;
 #endif
 #ifdef CONFIG_VMX
        case V3_VMX_CPU:
        case V3_VMX_EPT_CPU:
-           v3_init_vmx_io_map(vm);
-           v3_init_vmx_msr_map(vm);
+           v3_deinit_vmx_io_map(vm);
+           v3_deinit_vmx_msr_map(vm);
            break;
 #endif
        default:
@@ -558,6 +558,8 @@ int v3_free_vm_internal(struct v3_vm_info * vm) {
            return -1;
     }
 
+    v3_deinit_dev_mgr(vm);
+
     
     return 0;
 }
index d67509c..580a514 100644 (file)
@@ -82,7 +82,7 @@ void Init_V3(struct v3_os_hooks * hooks, int num_cpus) {
     }
 
     // Register all the possible device types
-    v3_init_devices();
+    V3_init_devices();
 
     // Register all shadow paging handlers
     V3_init_shdw_paging();
@@ -300,7 +300,7 @@ int v3_free_vm(struct v3_vm_info * vm) {
     int i = 0;
     // deinitialize guest (free memory, etc...)
 
-    v3_dev_mgr_deinit(vm);
+    v3_free_vm_devices(vm);
 
     for (i = 0; i < vm->num_cores; i++) {
        // free cores
index 6f80ba9..d41c331 100644 (file)
@@ -44,7 +44,7 @@ static int dev_eq_fn(addr_t key1, addr_t key2) {
 }
 
 
-int v3_init_devices() {
+int V3_init_devices() {
     extern struct v3_device_info __start__v3_devices[];
     extern struct v3_device_info __stop__v3_devices[];
     struct v3_device_info * tmp_dev =  __start__v3_devices;
@@ -108,15 +108,21 @@ int v3_init_dev_mgr(struct v3_vm_info * vm) {
 }
 
 
-int v3_dev_mgr_deinit(struct v3_vm_info * vm) {
-    struct vm_device * dev;
+int v3_free_vm_devices(struct v3_vm_info * vm) {
     struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
+    struct vm_device * dev;
     struct vm_device * tmp;
 
     list_for_each_entry_safe(dev, tmp, &(mgr->dev_list), dev_link) {
        v3_remove_device(dev);
     }
 
+    return 0;
+}
+
+int v3_deinit_dev_mgr(struct v3_vm_info * vm) {
+    struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
+
     v3_free_htable(mgr->blk_table, 0, 0);
     v3_free_htable(mgr->net_table, 0, 0);
     v3_free_htable(mgr->char_table, 0, 0);