/[dynamips]/trunk/vm.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/vm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7-RC1/vm.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC upstream/dynamips-0.2.7/vm.c revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC
# Line 107  void vm_object_free_list(vm_instance_t * Line 107  void vm_object_free_list(vm_instance_t *
107     vm->vm_object_list = NULL;     vm->vm_object_list = NULL;
108  }  }
109    
110    /* Rebuild the object list pointers */
111    static void vm_object_rebuild_list(vm_instance_t *vm)
112    {
113       vm_obj_t **obj;
114    
115       for(obj=&vm->vm_object_list;*obj;obj=&(*obj)->next)
116          (*obj)->pprev = obj;
117    }
118    
119  /* Dump the object list of an instance */  /* Dump the object list of an instance */
120  void vm_object_dump(vm_instance_t *vm)  void vm_object_dump(vm_instance_t *vm)
121  {  {
# Line 145  char *vm_get_type(vm_instance_t *vm) Line 154  char *vm_get_type(vm_instance_t *vm)
154       case VM_TYPE_C2600:       case VM_TYPE_C2600:
155           machine = "c2600";           machine = "c2600";
156           break;           break;
157         case VM_TYPE_MSFC1:
158             machine = "msfc1";
159             break;
160       case VM_TYPE_PPC32_TEST:       case VM_TYPE_PPC32_TEST:
161           machine = "ppc32_test";           machine = "ppc32_test";
162           break;           break;
# Line 180  char *vm_get_platform_type(vm_instance_t Line 192  char *vm_get_platform_type(vm_instance_t
192        case VM_TYPE_C2600:        case VM_TYPE_C2600:
193           machine = "C2600";           machine = "C2600";
194           break;           break;
195       case VM_TYPE_PPC32_TEST:        case VM_TYPE_MSFC1:
196             machine = "MSFC1";
197             break;
198          case VM_TYPE_PPC32_TEST:
199           machine = "PPC32_TEST";           machine = "PPC32_TEST";
200           break;           break;
201        default:        default:
# Line 372  vm_instance_t *vm_create(char *name,int Line 387  vm_instance_t *vm_create(char *name,int
387     }     }
388        
389     memset(vm,0,sizeof(*vm));     memset(vm,0,sizeof(*vm));
390     vm->instance_id    = instance_id;     vm->instance_id          = instance_id;
391     vm->type           = machine_type;     vm->type                 = machine_type;
392     vm->status         = VM_STATUS_HALTED;     vm->status               = VM_STATUS_HALTED;
393     vm->jit_use        = JIT_SUPPORT;     vm->jit_use              = JIT_SUPPORT;
394     vm->vtty_con_type  = VTTY_TYPE_TERM;     vm->exec_blk_direct_jump = TRUE;
395     vm->vtty_aux_type  = VTTY_TYPE_NONE;     vm->vtty_con_type        = VTTY_TYPE_TERM;
396     vm->timer_irq_check_itv = VM_TIMER_IRQ_CHECK_ITV;     vm->vtty_aux_type        = VTTY_TYPE_NONE;
397     vm->log_file_enabled = TRUE;     vm->timer_irq_check_itv  = VM_TIMER_IRQ_CHECK_ITV;
398       vm->log_file_enabled     = TRUE;
399    
400     if (!(vm->name = strdup(name))) {     if (!(vm->name = strdup(name))) {
401        fprintf(stderr,"VM %s: unable to store instance name!\n",name);        fprintf(stderr,"VM %s: unable to store instance name!\n",name);
# Line 591  int vm_unbind_device(vm_instance_t *vm,s Line 607  int vm_unbind_device(vm_instance_t *vm,s
607  {  {
608     u_int i;     u_int i;
609    
610     if (!dev->pprev)     if (!dev || !dev->pprev)
611        return(-1);        return(-1);
612    
613     /* Remove the device from the linked list */     /* Remove the device from the linked list */

Legend:
Removed from v.7  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26