Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / simix / smx_host.c
1 /* Copyright (c) 2007-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "smx_private.h"
8 #include "xbt/sysdep.h"
9 #include "xbt/log.h"
10 #include "xbt/dict.h"
11 #include "mc/mc.h"
12 #include "mc/mc_replay.h"
13
14 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix,
15                                 "SIMIX hosts");
16
17 static void SIMIX_execution_finish(smx_synchro_t synchro);
18
19 /**
20  * \brief Internal function to create a SIMIX host.
21  * \param name name of the host to create
22  * \param workstation the SURF workstation to encapsulate
23  * \param data some user data (may be NULL)
24  */
25 smx_host_t SIMIX_host_create(const char *name,
26                                void *workstation, void *data)
27 {
28   smx_host_priv_t smx_host = xbt_new0(s_smx_host_priv_t, 1);
29   s_smx_process_t proc;
30
31   /* Host structure */
32   smx_host->process_list =
33       xbt_swag_new(xbt_swag_offset(proc, host_proc_hookup));
34
35   /* Update global variables */
36   xbt_lib_set(host_lib,name,SIMIX_HOST_LEVEL,smx_host);
37
38   return xbt_lib_get_elm_or_null(host_lib, name);
39 }
40
41 /**
42  * \brief Start the host if it is off
43  *
44  */
45 void SIMIX_host_on(smx_host_t h)
46 {
47   smx_host_priv_t host = SIMIX_host_priv(h);
48
49   xbt_assert((host != NULL), "Invalid parameters");
50
51   if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_OFF) {
52     surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_ON);
53
54     unsigned int cpt;
55     smx_process_arg_t arg;
56     xbt_dynar_foreach(host->boot_processes,cpt,arg) {
57       smx_process_t process;
58
59       char** argv = xbt_new(char*, arg->argc);
60       for (int i=0; i<arg->argc; i++)
61         argv[i] = xbt_strdup(arg->argv[i]);
62
63       XBT_DEBUG("Booting Process %s(%s) right now", arg->argv[0], arg->hostname);
64       if (simix_global->create_process_function) {
65         simix_global->create_process_function(&process,
66                                               argv[0],
67                                               arg->code,
68                                               NULL,
69                                               arg->hostname,
70                                               arg->kill_time,
71                                               arg->argc,
72                                               argv,
73                                               arg->properties,
74                                               arg->auto_restart,
75                                               NULL);
76       } else {
77         simcall_process_create(&process,
78                                arg->argv[0],
79                                arg->code,
80                                NULL,
81                                arg->hostname,
82                                arg->kill_time,
83                                arg->argc,
84                                argv,
85                                arg->properties,
86                                arg->auto_restart);
87       }
88     }
89   }
90 }
91
92 void simcall_HANDLER_host_off(smx_simcall_t simcall, smx_host_t h)
93 {
94  SIMIX_host_off(h, simcall->issuer);
95 }
96
97 /**
98  * \brief Stop the host if it is on
99  *
100  */
101 void SIMIX_host_off(smx_host_t h, smx_process_t issuer)
102 {
103   smx_host_priv_t host = SIMIX_host_priv(h);
104
105   xbt_assert((host != NULL), "Invalid parameters");
106
107   if (surf_resource_get_state(surf_workstation_resource_priv(h))==SURF_RESOURCE_ON) {
108         surf_resource_set_state(surf_workstation_resource_priv(h), SURF_RESOURCE_OFF);
109
110     /* Clean Simulator data */
111     if (xbt_swag_size(host->process_list) != 0) {
112       smx_process_t process = NULL;
113       xbt_swag_foreach(process, host->process_list) {
114         SIMIX_process_kill(process, issuer);
115         XBT_DEBUG("Killing %s on %s by %s", process->name,  sg_host_name(process->smx_host), issuer->name);
116       }
117     }
118   }
119 }
120
121 /**
122  * \brief Internal function to destroy a SIMIX host.
123  *
124  * \param h the host to destroy (a smx_host_t)
125  */
126 void SIMIX_host_destroy(void *h)
127 {
128   smx_host_priv_t host = (smx_host_priv_t) h;
129
130   xbt_assert((host != NULL), "Invalid parameters");
131
132   /* Clean Simulator data */
133   if (xbt_swag_size(host->process_list) != 0) {
134     char *msg = xbt_strdup("Shutting down host, but it's not empty:");
135     char *tmp;
136     smx_process_t process = NULL;
137
138     xbt_swag_foreach(process, host->process_list) {
139       tmp = bprintf("%s\n\t%s", msg, process->name);
140       free(msg);
141       msg = tmp;
142     }
143     SIMIX_display_process_status();
144     THROWF(arg_error, 0, "%s", msg);
145   }
146   xbt_dynar_free(&host->auto_restart_processes);
147   xbt_dynar_free(&host->boot_processes);
148   xbt_swag_free(host->process_list);
149
150   /* Clean host structure */
151   free(host);
152   return;
153 }
154
155 smx_host_t SIMIX_host_get_by_name(const char *name){
156   xbt_assert(((simix_global != NULL)
157                && (host_lib != NULL)),
158               "Environment not set yet");
159
160   return xbt_lib_get_elm_or_null(host_lib, name);
161 }
162
163 smx_host_t SIMIX_host_self(void)
164 {
165   smx_process_t process = SIMIX_process_self();
166   return (process == NULL) ? NULL : SIMIX_process_get_host(process);
167 }
168
169 /* needs to be public and without simcall because it is called
170    by exceptions and logging events */
171 const char* SIMIX_host_self_get_name(void)
172 {
173   smx_host_t host = SIMIX_host_self();
174   if (host == NULL || SIMIX_process_self() == simix_global->maestro_process)
175     return "";
176
177   return SIMIX_host_get_name(host);
178 }
179
180 const char* SIMIX_host_get_name(smx_host_t host){
181   xbt_assert((host != NULL), "Invalid parameters");
182
183   return sg_host_name(host);
184 }
185
186 xbt_dict_t SIMIX_host_get_properties(smx_host_t host){
187   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
188
189   return surf_resource_get_properties(surf_workstation_resource_priv(host));
190 }
191
192 double SIMIX_host_get_speed(smx_host_t host){
193   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
194   return surf_workstation_get_speed(host, 1.0);
195 }
196
197 int SIMIX_host_get_core(smx_host_t host){
198   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
199
200   return surf_workstation_get_core(host);
201 }
202
203 xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
204   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
205   smx_host_priv_t host_priv = SIMIX_host_priv(host);
206
207   return host_priv->process_list;
208 }
209
210
211 double SIMIX_host_get_available_speed(smx_host_t host){
212   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
213
214   return surf_workstation_get_available_speed(host);
215 }
216
217 double SIMIX_host_get_current_power_peak(smx_host_t host) {
218           xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
219           return surf_workstation_get_current_power_peak(host);
220 }
221
222 double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index) {
223           xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
224
225           return surf_workstation_get_power_peak_at(host, pstate_index);
226 }
227
228 int SIMIX_host_get_nb_pstates(smx_host_t host) {
229           xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
230
231           return surf_workstation_get_nb_pstates(host);
232 }
233
234
235 void SIMIX_host_set_pstate(smx_host_t host, int pstate_index) {
236           xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
237
238           surf_workstation_set_pstate(host, pstate_index);
239 }
240 int SIMIX_host_get_pstate(smx_host_t host) {
241           return surf_workstation_get_pstate(host);
242 }
243
244 double SIMIX_host_get_consumed_energy(smx_host_t host) {
245           xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
246           return surf_workstation_get_consumed_energy(host);
247 }
248 double SIMIX_host_get_wattmin_at(smx_host_t host,int pstate) {
249           return surf_workstation_get_wattmin_at(host,pstate);
250 }
251 double SIMIX_host_get_wattmax_at(smx_host_t host,int pstate) {
252           return surf_workstation_get_wattmax_at(host,pstate);
253 }
254
255 int SIMIX_host_get_state(smx_host_t host){
256   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
257
258   return surf_resource_get_state(surf_workstation_resource_priv(host));
259 }
260
261 void _SIMIX_host_free_process_arg(void *data)
262 {
263   smx_process_arg_t arg = *(void**)data;
264   int i;
265   for (i = 0; i < arg->argc; i++)
266     xbt_free(arg->argv[i]);
267   xbt_free(arg->argv);
268   xbt_free(arg->name);
269   xbt_free(arg);
270 }
271 /**
272  * \brief Add a process to the list of the processes that the host will restart when it comes back
273  * This function add a process to the list of the processes that will be restarted when the host comes
274  * back. It is expected that this function is called when the host is down.
275  * The processes will only be restarted once, meaning that you will have to register the process
276  * again to restart the process again.
277  */
278 void SIMIX_host_add_auto_restart_process(smx_host_t host,
279                                          const char *name,
280                                          xbt_main_func_t code,
281                                          void *data,
282                                          const char *hostname,
283                                          double kill_time,
284                                          int argc, char **argv,
285                                          xbt_dict_t properties,
286                                          int auto_restart)
287 {
288   if (!SIMIX_host_priv(host)->auto_restart_processes) {
289     SIMIX_host_priv(host)->auto_restart_processes = xbt_dynar_new(sizeof(smx_process_arg_t),_SIMIX_host_free_process_arg);
290   }
291   smx_process_arg_t arg = xbt_new(s_smx_process_arg_t,1);
292   arg->name = xbt_strdup(name);
293   arg->code = code;
294   arg->data = data;
295   arg->hostname = hostname;
296   arg->kill_time = kill_time;
297   arg->argc = argc;
298
299   arg->argv = xbt_new(char*,argc + 1);
300
301   int i;
302   for (i = 0; i < argc; i++) {
303     arg->argv[i] = xbt_strdup(argv[i]);
304   }
305   arg->argv[argc] = NULL;
306
307   arg->properties = properties;
308   arg->auto_restart = auto_restart;
309
310   if( SIMIX_host_get_state(host) == SURF_RESOURCE_OFF
311       && !xbt_dict_get_or_null(watched_hosts_lib,sg_host_name(host))){
312     xbt_dict_set(watched_hosts_lib,sg_host_name(host),host,NULL);
313     XBT_DEBUG("Have pushed host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF",sg_host_name(host));
314   }
315   xbt_dynar_push_as(SIMIX_host_priv(host)->auto_restart_processes,smx_process_arg_t,arg);
316 }
317 /**
318  * \brief Restart the list of processes that have been registered to the host
319  */
320 void SIMIX_host_restart_processes(smx_host_t host)
321 {
322   unsigned int cpt;
323   smx_process_arg_t arg;
324   xbt_dynar_t process_list = SIMIX_host_priv(host)->auto_restart_processes;
325   if (!process_list)
326     return;
327
328   xbt_dynar_foreach (process_list, cpt, arg) {
329
330     smx_process_t process;
331
332     XBT_DEBUG("Restarting Process %s(%s) right now", arg->argv[0], arg->hostname);
333     if (simix_global->create_process_function) {
334       simix_global->create_process_function(&process,
335                                             arg->argv[0],
336                                             arg->code,
337                                             NULL,
338                                             arg->hostname,
339                                             arg->kill_time,
340                                             arg->argc,
341                                             arg->argv,
342                                             arg->properties,
343                                             arg->auto_restart,
344                                             NULL);
345     } else {
346       simcall_process_create(&process,
347                              arg->argv[0],
348                              arg->code,
349                              NULL,
350                              arg->hostname,
351                              arg->kill_time,
352                              arg->argc,
353                              arg->argv,
354                              arg->properties,
355                              arg->auto_restart);
356
357     }
358     /* arg->argv is used by the process created above.  Hide it to
359      * _SIMIX_host_free_process_arg() which is called by xbt_dynar_reset()
360      * below. */
361     arg->argc = 0;
362     arg->argv = NULL;
363   }
364   xbt_dynar_reset(process_list);
365 }
366
367 void SIMIX_host_autorestart(smx_host_t host)
368 {
369   if(simix_global->autorestart)
370     simix_global->autorestart(host);
371   else
372     xbt_die("No function for simix_global->autorestart");
373 }
374
375 smx_synchro_t SIMIX_host_execute(const char *name,
376     smx_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask){
377
378   /* alloc structures and initialize */
379   smx_synchro_t synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
380   synchro->type = SIMIX_SYNC_EXECUTE;
381   synchro->name = xbt_strdup(name);
382   synchro->state = SIMIX_RUNNING;
383   synchro->execution.host = host;
384   synchro->category = NULL;
385
386   /* set surf's action */
387   if (!MC_is_active() && !MC_record_replay_is_active()) {
388
389     synchro->execution.surf_exec = surf_workstation_execute(host, flops_amount);
390     surf_action_set_data(synchro->execution.surf_exec, synchro);
391     surf_action_set_priority(synchro->execution.surf_exec, priority);
392
393     /* Note (hypervisor): for multicore, the bound value being passed to the
394      * surf layer should not be zero (i.e., unlimited). It should be the
395      * capacity of a CPU core. */
396     if (bound == 0)
397       surf_cpu_action_set_bound(synchro->execution.surf_exec, SIMIX_host_get_speed(host));
398     else
399       surf_cpu_action_set_bound(synchro->execution.surf_exec, bound);
400
401     if (affinity_mask != 0) {
402       /* just a double check to confirm that this host is the host where this task is running. */
403       xbt_assert(synchro->execution.host == host);
404       surf_cpu_action_set_affinity(synchro->execution.surf_exec, host, affinity_mask);
405     }
406   }
407
408   XBT_DEBUG("Create execute synchro %p: %s", synchro, synchro->name);
409
410   return synchro;
411 }
412
413 smx_synchro_t SIMIX_host_parallel_execute(const char *name,
414     int host_nb, smx_host_t *host_list,
415     double *flops_amount, double *bytes_amount,
416     double amount, double rate){
417
418   void **workstation_list = NULL;
419   int i;
420
421   /* alloc structures and initialize */
422   smx_synchro_t synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
423   synchro->type = SIMIX_SYNC_PARALLEL_EXECUTE;
424   synchro->name = xbt_strdup(name);
425   synchro->state = SIMIX_RUNNING;
426   synchro->execution.host = NULL; /* FIXME: do we need the list of hosts? */
427   synchro->category = NULL;
428
429   /* set surf's synchro */
430   workstation_list = xbt_new0(void *, host_nb);
431   for (i = 0; i < host_nb; i++)
432     workstation_list[i] = surf_workstation_resource_priv(host_list[i]);
433
434
435   /* FIXME: what happens if host_list contains VMs and PMs. If
436    * execute_parallel_task() does not change the state of the model, we can mix
437    * them. */
438   surf_model_t ws_model = surf_resource_model(host_list[0], SURF_WKS_LEVEL);
439   for (i = 1; i < host_nb; i++) {
440     surf_model_t ws_model_tmp = surf_resource_model(host_list[i], SURF_WKS_LEVEL);
441     if (ws_model_tmp != ws_model) {
442       XBT_CRITICAL("mixing VMs and PMs is not supported");
443       DIE_IMPOSSIBLE;
444     }
445   }
446
447   /* set surf's synchro */
448   if (!MC_is_active() && !MC_record_replay_is_active()) {
449     synchro->execution.surf_exec =
450       surf_workstation_model_execute_parallel_task((surf_workstation_model_t)surf_workstation_model,
451                   host_nb, workstation_list, flops_amount, bytes_amount, rate);
452
453     surf_action_set_data(synchro->execution.surf_exec, synchro);
454   }
455   XBT_DEBUG("Create parallel execute synchro %p", synchro);
456
457   return synchro;
458 }
459
460 void SIMIX_host_execution_destroy(smx_synchro_t synchro){
461   XBT_DEBUG("Destroy synchro %p", synchro);
462
463   if (synchro->execution.surf_exec) {
464     surf_action_unref(synchro->execution.surf_exec);
465     synchro->execution.surf_exec = NULL;
466   }
467   xbt_free(synchro->name);
468   xbt_mallocator_release(simix_global->synchro_mallocator, synchro);
469 }
470
471 void SIMIX_host_execution_cancel(smx_synchro_t synchro){
472   XBT_DEBUG("Cancel synchro %p", synchro);
473
474   if (synchro->execution.surf_exec)
475     surf_action_cancel(synchro->execution.surf_exec);
476 }
477
478 double SIMIX_host_execution_get_remains(smx_synchro_t synchro){
479   double result = 0.0;
480
481   if (synchro->state == SIMIX_RUNNING)
482     result = surf_action_get_remains(synchro->execution.surf_exec);
483
484   return result;
485 }
486
487 e_smx_state_t SIMIX_host_execution_get_state(smx_synchro_t synchro){
488   return synchro->state;
489 }
490
491 void SIMIX_host_execution_set_priority(smx_synchro_t synchro, double priority){
492
493   if(synchro->execution.surf_exec)
494         surf_action_set_priority(synchro->execution.surf_exec, priority);
495 }
496
497 void SIMIX_host_execution_set_bound(smx_synchro_t synchro, double bound){
498
499   if(synchro->execution.surf_exec)
500         surf_cpu_action_set_bound(synchro->execution.surf_exec, bound);
501 }
502
503 void SIMIX_host_execution_set_affinity(smx_synchro_t synchro, smx_host_t host, unsigned long mask){
504   xbt_assert(synchro->type == SIMIX_SYNC_EXECUTE);
505
506   if (synchro->execution.surf_exec) {
507     /* just a double check to confirm that this host is the host where this task is running. */
508     xbt_assert(synchro->execution.host == host);
509     surf_cpu_action_set_affinity(synchro->execution.surf_exec, host, mask);
510   }
511 }
512
513 void simcall_HANDLER_host_execution_wait(smx_simcall_t simcall, smx_synchro_t synchro){
514
515   XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state);
516
517   /* Associate this simcall to the synchro */
518   xbt_fifo_push(synchro->simcalls, simcall);
519   simcall->issuer->waiting_synchro = synchro;
520
521   /* set surf's synchro */
522   if (MC_is_active() || MC_record_replay_is_active()) {
523     synchro->state = SIMIX_DONE;
524     SIMIX_execution_finish(synchro);
525     return;
526   }
527
528   /* If the synchro is already finished then perform the error handling */
529   if (synchro->state != SIMIX_RUNNING)
530     SIMIX_execution_finish(synchro);
531 }
532
533 void SIMIX_host_execution_suspend(smx_synchro_t synchro)
534 {
535   if(synchro->execution.surf_exec)
536     surf_action_suspend(synchro->execution.surf_exec);
537 }
538
539 void SIMIX_host_execution_resume(smx_synchro_t synchro)
540 {
541   if(synchro->execution.surf_exec)
542     surf_action_resume(synchro->execution.surf_exec);
543 }
544
545 void SIMIX_execution_finish(smx_synchro_t synchro)
546 {
547   xbt_fifo_item_t item;
548   smx_simcall_t simcall;
549
550   xbt_fifo_foreach(synchro->simcalls, item, simcall, smx_simcall_t) {
551
552     switch (synchro->state) {
553
554       case SIMIX_DONE:
555         /* do nothing, synchro done */
556         XBT_DEBUG("SIMIX_execution_finished: execution successful");
557         break;
558
559       case SIMIX_FAILED:
560         XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", sg_host_name(simcall->issuer->smx_host));
561         simcall->issuer->context->iwannadie = 1;
562         SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
563         break;
564
565       case SIMIX_CANCELED:
566         XBT_DEBUG("SIMIX_execution_finished: execution canceled");
567         SMX_EXCEPTION(simcall->issuer, cancel_error, 0, "Canceled");
568         break;
569
570       default:
571         xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d",
572             (int)synchro->state);
573     }
574     /* check if the host is down */
575     if (surf_resource_get_state(surf_workstation_resource_priv(simcall->issuer->smx_host)) != SURF_RESOURCE_ON) {
576       simcall->issuer->context->iwannadie = 1;
577     }
578
579     simcall->issuer->waiting_synchro =    NULL;
580     simcall_host_execution_wait__set__result(simcall, synchro->state);
581     SIMIX_simcall_answer(simcall);
582   }
583
584   /* We no longer need it */
585   SIMIX_host_execution_destroy(synchro);
586 }
587
588
589 void SIMIX_post_host_execute(smx_synchro_t synchro)
590 {
591   if (synchro->type == SIMIX_SYNC_EXECUTE && /* FIMXE: handle resource failure
592                                                * for parallel tasks too */
593       surf_resource_get_state(surf_workstation_resource_priv(synchro->execution.host)) == SURF_RESOURCE_OFF) {
594     /* If the host running the synchro failed, notice it so that the asking
595      * process can be killed if it runs on that host itself */
596     synchro->state = SIMIX_FAILED;
597   } else if (surf_action_get_state(synchro->execution.surf_exec) == SURF_ACTION_FAILED) {
598     /* If the host running the synchro didn't fail, then the synchro was
599      * canceled */
600     synchro->state = SIMIX_CANCELED;
601   } else {
602     synchro->state = SIMIX_DONE;
603   }
604
605   if (synchro->execution.surf_exec) {
606     surf_action_unref(synchro->execution.surf_exec);
607     synchro->execution.surf_exec = NULL;
608   }
609
610   /* If there are simcalls associated with the synchro, then answer them */
611   if (xbt_fifo_size(synchro->simcalls)) {
612     SIMIX_execution_finish(synchro);
613   }
614 }
615
616
617 void SIMIX_set_category(smx_synchro_t synchro, const char *category)
618 {
619   if (synchro->state != SIMIX_RUNNING) return;
620   if (synchro->type == SIMIX_SYNC_EXECUTE){
621     surf_action_set_category(synchro->execution.surf_exec, category);
622   }else if (synchro->type == SIMIX_SYNC_COMMUNICATE){
623     surf_action_set_category(synchro->comm.surf_comm, category);
624   }
625 }
626
627 /**
628  * \brief Function to get the parameters of the given the SIMIX host.
629  *
630  * \param host the host to get_phys_host (a smx_host_t)
631  * \param param the parameter object space to be overwritten (a ws_params_t)
632  */
633 void SIMIX_host_get_params(smx_host_t ind_vm, ws_params_t params)
634 {
635   /* jump to ws_get_params(). */
636   surf_workstation_get_params(ind_vm, params);
637 }
638
639 void SIMIX_host_set_params(smx_host_t ind_vm, ws_params_t params)
640 {
641   /* jump to ws_set_params(). */
642   surf_workstation_set_params(ind_vm, params);
643 }
644
645 xbt_dict_t SIMIX_host_get_mounted_storage_list(smx_host_t host){
646   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
647
648   return surf_workstation_get_mounted_storage_list(host);
649 }
650
651 xbt_dynar_t SIMIX_host_get_attached_storage_list(smx_host_t host){
652   xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
653
654   return surf_workstation_get_attached_storage_list(host);
655 }