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.


Cache information interface and implementation for AMD and Intel on Linux
[palacios.git] / palacios / src / vnet / vnet_host.c
index b537e2a..5d0c3bf 100644 (file)
@@ -24,7 +24,14 @@ struct vnet_host_hooks * host_hooks;
 
 struct vnet_thread * vnet_start_thread(int (*func)(void *), void *arg, char * name){
     if((host_hooks) && host_hooks->thread_start){
+
        struct vnet_thread * thread = Vnet_Malloc(sizeof(struct vnet_thread));
+
+       if (!thread) {
+           PrintError(VM_NONE, VCORE_NONE, "Cannot allocate space to create a vnet thread\n");
+           return NULL;
+       }
+
        thread->host_thread = host_hooks->thread_start(func, arg, name);
 
        if(thread->host_thread){
@@ -42,7 +49,14 @@ struct vnet_timer * vnet_create_timer(unsigned long interval,
                                      void * priv_data){
     if((host_hooks) && host_hooks->timer_create){
        struct vnet_timer * timer = Vnet_Malloc(sizeof(struct vnet_timer));
+
+       if (!timer) {
+           PrintError(VM_NONE, VCORE_NONE, "Cannot allocate space to create a vnet timer\n");
+           return NULL;
+       }
+
        timer->host_timer = host_hooks->timer_create(interval, timer_fun, priv_data);
+
        return timer;
     }