Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into hypervisor
[simgrid.git] / src / include / surf / surf.h
index 5a612ac..441070f 100644 (file)
@@ -276,8 +276,14 @@ typedef struct surf_workstation_model_extension_public {
 
 } s_surf_model_extension_workstation_t;
 
-
-
+typedef struct surf_vm_workstation_model_extension_public {
+  s_surf_model_extension_workstation_t basic;
+  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 *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
  *  \brief Model datatype
@@ -323,6 +329,8 @@ typedef struct surf_model {
     s_surf_model_extension_network_t network;
     s_surf_model_extension_storage_t storage;
     s_surf_model_extension_workstation_t workstation;
+    // TODO Implement the corresponding model
+    s_surf_model_extension_vm_workstation_t vm_workstation;
     /*******************************************/
     /* TUTORIAL: New model                     */
     s_surf_model_extension_new_model_t new_model;
@@ -600,6 +608,16 @@ XBT_PUBLIC_DATA(s_surf_model_description_t) surf_storage_model_description[];
  */
 XBT_PUBLIC_DATA(surf_model_t) surf_workstation_model;
 
+/** \ingroup SURF_models
+ *  \brief The vm_workstation model
+ *
+ *  Note that when you create an API on top of SURF,
+ *  the vm_workstation model should be the only one you use
+ *  because depending on the platform model, the network model and the CPU model
+ *  may not exist.
+ */
+XBT_PUBLIC_DATA(surf_model_t) surf_vm_workstation_model;
+
 /** \ingroup SURF_models
  *  \brief Initializes the platform with a compound workstation model
  *