*/
XBT_PUBLIC(sg_size_t) surf_host_get_used_size(sg_host_t resource, const char* name);
-/**
- * @brief Destroy a VM
- *
- * @param resource The surf vm
- */
-XBT_PUBLIC(void) surf_vm_destroy(sg_host_t resource);
-
/** @brief Suspend a VM */
XBT_PUBLIC(void) surf_vm_suspend(sg_host_t resource);
void SIMIX_vm_destroy(sg_host_t vm)
{
/* this code basically performs a similar thing like SIMIX_host_destroy() */
-
- const char *hostname = sg_host_get_name(vm);
-
- XBT_DEBUG("destroy %s", hostname);
+ XBT_DEBUG("destroy %s", sg_host_get_name(vm));
/* this will call the registered callback function, i.e., SIMIX_host_destroy(). */
sg_host_simix_destroy(vm);
- /* jump to vm_ws_destroy(). The surf level resource will be freed. */
- surf_vm_destroy(vm);
+ /* Don't free these things twice: they are the ones of my physical host */
+ vm->pimpl_cpu = nullptr;
+ vm->pimpl_netcard = nullptr;
}
return get_casted_host(host)->fileMove(fd, fullpath);
}
-void surf_vm_destroy(sg_host_t vm){ // FIXME:DEADCODE
- vm->pimpl_cpu = nullptr;
- vm->pimpl_netcard = nullptr;
-}
-
void surf_vm_suspend(sg_host_t vm){
get_casted_vm(vm)->suspend();
}