From: Takahiro Hirofuchi Date: Thu, 31 Jan 2013 21:09:58 +0000 (+0100) Subject: fix vm_ws_destroy() X-Git-Tag: v3_11_beta~297^2^2~117 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b9b20b8f5ea36093cce3c835ea9a9453b5df6daa?hp=0d0ad166ad6666d099d13c62c840159ce7f3270e fix vm_ws_destroy() --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 3749e61bd4..2c28873970 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -278,11 +278,11 @@ typedef struct surf_workstation_model_extension_public { typedef struct surf_vm_workstation_model_extension_public { s_surf_model_extension_workstation_t basic; - void* (*create) (const char *name, void *workstation); // First operation of the VM model + void* (*create) (const char *name, void *ind_phys_workstation); // First operation of the VM model // start does not appear here as it corresponds to turn the state from created to running (see smx_vm.c) - int (*get_state) (void *workstation); - void (*set_state) (void *workstation, int state); - void (*destroy) (smx_host_t *host); // destory the vm-specific data + int (*get_state) (void *ind_phys_workstation); + void (*set_state) (void *ind_phys_workstation, int state); + void (*destroy) (void *ind_phys_workstation); // will be vm_ws_destroy(), which destroies the vm-specific data } s_surf_model_extension_vm_workstation_t; /** \ingroup SURF_models diff --git a/src/surf/vm_workstation.c b/src/surf/vm_workstation.c index 00d9dc5286..8c1326c8b3 100644 --- a/src/surf/vm_workstation.c +++ b/src/surf/vm_workstation.c @@ -22,7 +22,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm_workstation, surf, surf_model_t surf_vm_workstation_model = NULL; -static void vm_ws_create (const char *name, void *ind_phys_workstation) +static void vm_ws_create(const char *name, void *ind_phys_workstation) { workstation_VM2013_t vm_ws = xbt_new0(s_workstation_VM2013_t, 1); // TODO Complete the surf vm workstation model @@ -39,14 +39,14 @@ static void vm_ws_create (const char *name, void *ind_phys_workstation) * A physical host does not disapper in the current SimGrid code, but a VM may * disapper during a simulation. */ -static void vm_ws_destroy(smx_host_t host) +static void vm_ws_destroy(void *ind_phys_workstation) { - workstation_VM2013_t vm_ws = surf_workstation_resource_priv(host); + /* ind_phys_workstation equals to smx_host_t */ + workstation_VM2013_t vm_ws = surf_workstation_resource_priv(ind_phys_workstation); xbt_assert(vm_ws); xbt_assert(vm_ws->generic_resource.model == surf_vm_workstation_model); const char *name = vm_ws->generic_resource.name; - /* not defined yet, but we should have */ /* this will call surf_resource_free() */ xbt_lib_unset(host_lib, name, SURF_WKS_LEVEL);