From 99677e68549e840ea8d896c4ce292040b1db614c Mon Sep 17 00:00:00 2001 From: Takahiro Hirofuchi Date: Mon, 11 Mar 2013 15:39:55 +0100 Subject: [PATCH] Use SIMIX_host_create also for a VM --- src/simix/smx_vm.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/simix/smx_vm.c b/src/simix/smx_vm.c index 9eac836efd..194d658c0f 100644 --- a/src/simix/smx_vm.c +++ b/src/simix/smx_vm.c @@ -22,25 +22,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX (vms */ smx_host_t SIMIX_vm_create(const char *name, smx_host_t ind_phys_host) { - - smx_host_priv_t smx_host = xbt_new0(s_smx_host_priv_t, 1); - s_smx_process_t proc; - - // TODO check why we do not have any VM here and why we have the host_proc_hookup ? - - /* Host structure */ - smx_host->data = NULL; - smx_host->process_list = - xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup)); - - /* Update global variables */ - xbt_lib_set(host_lib, name, SIMIX_HOST_LEVEL, smx_host); - /* Create surf associated resource */ - // TODO change phys_host into the right workstation surf model surf_vm_workstation_model->extension.vm_workstation.create(name, ind_phys_host); - return xbt_lib_get_elm_or_null(host_lib, name); + smx_host_t smx_host = SIMIX_host_create(name, ind_phys_host, NULL); + + /* We will be able to register the VM to its physical host, so that we can promptly + * retrieve the list VMs on the physical host. */ + + return smx_host; } -- 2.30.2