Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[msg] Switch MSG to .cpp
[simgrid.git] / src / msg / msg_io.cpp
1 /* Copyright (c) 2004-2015. 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 "msg_private.h"
8 #include "xbt/log.h"
9 #include "msg_mailbox.h"
10
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg,
12                                 "Logging specific to MSG (io)");
13
14 /** @addtogroup msg_file_management
15  * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
16  * (#msg_file_t) and the functions for managing it.
17  *
18  *  \see #msg_file_t
19  */
20
21
22 /********************************* File **************************************/
23 void __MSG_file_get_info(msg_file_t fd){
24
25   msg_file_priv_t priv = MSG_file_priv(fd);
26   xbt_dynar_t info = simcall_file_get_info(priv->simdata->smx_file);
27   sg_size_t *psize;
28
29   priv->content_type = xbt_dynar_pop_as(info, char *);
30   priv->storage_type = xbt_dynar_pop_as(info, char *);
31   priv->storageId = xbt_dynar_pop_as(info, char *);
32   priv->mount_point = xbt_dynar_pop_as(info, char *);
33   psize = xbt_dynar_pop_as(info, sg_size_t*);
34   priv->size = *psize;
35   xbt_free(psize);
36   xbt_dynar_free_container(&info);
37 }
38
39 /** \ingroup msg_file_management
40  *
41  * \brief Set the user data of a #msg_file_t.
42  *
43  * This functions checks whether some data has already been associated to \a file
44    or not and attach \a data to \a file if it is possible.
45  */
46 msg_error_t MSG_file_set_data(msg_file_t fd, void *data)
47 {
48   msg_file_priv_t priv = MSG_file_priv(fd);
49   priv->data = data;
50   return MSG_OK;
51 }
52
53 /** \ingroup msg_file_management
54  *
55  * \brief Return the user data of a #msg_file_t.
56  *
57  * This functions checks whether \a file is a valid pointer or not and return
58    the user data associated to \a file if it is possible.
59  */
60 void *MSG_file_get_data(msg_file_t fd)
61 {
62   msg_file_priv_t priv = MSG_file_priv(fd);
63   return priv->data;
64 }
65
66 /** \ingroup msg_file_management
67  * \brief Display information related to a file descriptor
68  *
69  * \param fd is a the file descriptor
70  */
71
72 void MSG_file_dump (msg_file_t fd){
73   /* Update the cached information first */
74   __MSG_file_get_info(fd);
75
76   msg_file_priv_t priv = MSG_file_priv(fd);
77   XBT_INFO("File Descriptor information:\n"
78            "\t\tFull path: '%s'\n"
79            "\t\tSize: %llu\n"
80            "\t\tMount point: '%s'\n"
81            "\t\tStorage Id: '%s'\n"
82            "\t\tStorage Type: '%s'\n"
83            "\t\tContent Type: '%s'\n"
84            "\t\tFile Descriptor Id: %d",
85            priv->fullpath, priv->size, priv->mount_point,
86            priv->storageId, priv->storage_type,
87            priv->content_type, priv->desc_id);
88 }
89
90 /** \ingroup msg_file_management
91  * \brief Read a file (local or remote)
92  *
93  * \param size of the file to read
94  * \param fd is a the file descriptor
95  * \return the number of bytes successfully read or -1 if an error occurred
96  */
97 sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
98 {
99   msg_file_priv_t file_priv = MSG_file_priv(fd);
100   sg_size_t read_size;
101
102   /* Find the host where the file is physically located and read it */
103   msg_storage_t storage_src =(msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, file_priv->storageId);
104   msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
105   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
106   read_size = simcall_file_read(file_priv->simdata->smx_file, size, attached_host);
107
108   if(strcmp(storage_priv_src->hostname, MSG_host_get_name(MSG_host_self()))){
109     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
110     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, read_size);
111     msg_host_t *m_host_list = NULL;
112     m_host_list = (msg_host_t*) calloc(2, sizeof(msg_host_t));
113
114     m_host_list[0] = MSG_host_self();
115     m_host_list[1] = attached_host;
116     double flops_amount[] = { 0, 0 };
117     double bytes_amount[] = { 0, 0, (double)read_size, 0 };
118
119     msg_task_t task = MSG_parallel_task_create("file transfer for read", 2, m_host_list, flops_amount, bytes_amount, NULL);
120     msg_error_t transfer = MSG_parallel_task_execute(task);
121     MSG_task_destroy(task);
122     free(m_host_list);
123     if(transfer != MSG_OK){
124       if (transfer == MSG_HOST_FAILURE)
125         XBT_WARN("Transfer error, %s remote host just turned off!", MSG_host_get_name(attached_host));
126       if (transfer == MSG_TASK_CANCELED)
127         XBT_WARN("Transfer error, task has been canceled!");
128
129       return -1;
130     }
131   }
132   return read_size;
133 }
134
135 /** \ingroup msg_file_management
136  * \brief Write into a file (local or remote)
137  *
138  * \param size of the file to write
139  * \param fd is a the file descriptor
140  * \return the number of bytes successfully write or -1 if an error occurred
141  */
142 sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
143 {
144   msg_file_priv_t file_priv = MSG_file_priv(fd);
145   sg_size_t write_size, offset;
146
147   /* Find the host where the file is physically located (remote or local)*/
148   msg_storage_t storage_src =(msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, file_priv->storageId);
149   msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
150   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
151
152   if(strcmp(storage_priv_src->hostname, MSG_host_get_name(MSG_host_self()))){
153     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
154     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", storage_priv_src->hostname, size);
155     msg_host_t *m_host_list = NULL;
156     m_host_list = (msg_host_t*) calloc(2, sizeof(msg_host_t));
157
158     m_host_list[0] = MSG_host_self();
159     m_host_list[1] = attached_host;
160     double flops_amount[] = { 0, 0 };
161     double bytes_amount[] = { 0, (double)size, 0, 0 };
162
163     msg_task_t task = MSG_parallel_task_create("file transfer for write", 2, m_host_list, flops_amount, bytes_amount, NULL);
164     msg_error_t transfer = MSG_parallel_task_execute(task);
165     MSG_task_destroy(task);
166     free(m_host_list);
167     if(transfer != MSG_OK){
168       if (transfer == MSG_HOST_FAILURE)
169         XBT_WARN("Transfer error, %s remote host just turned off!", MSG_host_get_name(attached_host));
170       if (transfer == MSG_TASK_CANCELED)
171         XBT_WARN("Transfer error, task has been canceled!");
172
173       return -1;
174     }
175   }
176   /* Write file on local or remote host */
177   offset = simcall_file_tell(file_priv->simdata->smx_file);
178   write_size = simcall_file_write(file_priv->simdata->smx_file, size, attached_host);
179   file_priv->size = offset+write_size;
180
181   return write_size;
182 }
183
184 /** \ingroup msg_file_management
185  * \brief Opens the file whose name is the string pointed to by path
186  *
187  * \param fullpath is the file location on the storage
188  * \param data user data to attach to the file
189  *
190  * \return An #msg_file_t associated to the file
191  */
192 msg_file_t MSG_file_open(const char* fullpath, void* data)
193 {
194   char *name;
195   msg_file_priv_t priv = xbt_new(s_msg_file_priv_t, 1);
196   priv->data = data;
197   priv->fullpath = xbt_strdup(fullpath);
198   priv->simdata = xbt_new0(s_simdata_file_t,1);
199   priv->simdata->smx_file = simcall_file_open(fullpath, MSG_host_self());
200   priv->desc_id = __MSG_host_get_file_descriptor_id(MSG_host_self());
201
202   name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_get_name(MSG_host_self()),
203                              priv->desc_id);
204
205   xbt_lib_set(file_lib, name, MSG_FILE_LEVEL, priv);
206   msg_file_t fd = (msg_file_t) xbt_lib_get_elm_or_null(file_lib, name);
207   __MSG_file_get_info(fd);
208   xbt_free(name);
209
210   return fd;
211 }
212
213 /** \ingroup msg_file_management
214  * \brief Close the file
215  *
216  * \param fd is the file to close
217  * \return 0 on success or 1 on error
218  */
219 int MSG_file_close(msg_file_t fd)
220 {
221   char *name;
222   msg_file_priv_t priv = MSG_file_priv(fd);
223   if (priv->data)
224     xbt_free(priv->data);
225
226   int res = simcall_file_close(priv->simdata->smx_file, MSG_host_self());
227   name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_get_name(MSG_host_self()),
228                              priv->desc_id);
229   __MSG_host_release_file_descriptor_id(MSG_host_self(), priv->desc_id);
230   xbt_lib_unset(file_lib, name, MSG_FILE_LEVEL, 1);
231   xbt_free(name);
232   return res;
233 }
234
235 /** \ingroup msg_file_management
236  * \brief Unlink the file pointed by fd
237  *
238  * \param fd is the file descriptor (#msg_file_t)
239  * \return 0 on success or 1 on error
240  */
241 msg_error_t MSG_file_unlink(msg_file_t fd)
242 {
243   msg_file_priv_t file_priv = MSG_file_priv(fd);
244   /* Find the host where the file is physically located (remote or local)*/
245   msg_storage_t storage_src =
246       (msg_storage_t) xbt_lib_get_elm_or_null(storage_lib,
247                                               file_priv->storageId);
248   msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
249   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
250   int res = simcall_file_unlink(file_priv->simdata->smx_file, attached_host);
251   return (msg_error_t) res;
252 }
253
254 /** \ingroup msg_file_management
255  * \brief Return the size of a file
256  *
257  * \param fd is the file descriptor (#msg_file_t)
258  * \return the size of the file (as a #sg_size_t)
259  */
260 sg_size_t MSG_file_get_size(msg_file_t fd){
261   msg_file_priv_t priv = MSG_file_priv(fd);
262   return simcall_file_get_size(priv->simdata->smx_file);
263 }
264
265 /**
266  * \ingroup msg_file_management
267  * \brief Set the file position indicator in the msg_file_t by adding offset bytes
268  * to the position specified by origin (either SEEK_SET, SEEK_CUR, or SEEK_END).
269  *
270  * \param fd : file object that identifies the stream
271  * \param offset : number of bytes to offset from origin
272  * \param origin : Position used as reference for the offset. It is specified by
273  * one of the following constants defined in \<stdio.h\> exclusively to be used as
274  * arguments for this function (SEEK_SET = beginning of file, SEEK_CUR = current
275  * position of the file pointer, SEEK_END = end of file)
276  *
277  * \return If successful, the function returns MSG_OK (=0). Otherwise, it returns
278  * MSG_TASK_CANCELED (=8).
279  *
280  */
281 msg_error_t MSG_file_seek(msg_file_t fd, sg_offset_t offset, int origin)
282 {
283   msg_file_priv_t priv = MSG_file_priv(fd);
284   return (msg_error_t) simcall_file_seek(priv->simdata->smx_file, offset, origin);
285 }
286
287 /**
288  * \ingroup msg_file_management
289  * \brief Returns the current value of the position indicator of the file
290  *
291  * \param fd : file object that identifies the stream
292  * \return On success, the current value of the position indicator is returned.
293  *
294  */
295 sg_size_t MSG_file_tell(msg_file_t fd)
296 {
297   msg_file_priv_t priv = MSG_file_priv(fd);
298   return simcall_file_tell(priv->simdata->smx_file);
299 }
300
301 const char *MSG_file_get_name(msg_file_t fd) {
302   xbt_assert((fd != NULL), "Invalid parameters");
303   msg_file_priv_t priv = MSG_file_priv(fd);
304   return priv->fullpath;
305 }
306
307 /**
308  * \ingroup msg_file_management
309  * \brief Move a file to another location on the *same mount point*.
310  *
311  */
312 msg_error_t MSG_file_move (msg_file_t fd, const char* fullpath)
313 {
314   msg_file_priv_t priv = MSG_file_priv(fd);
315   return (msg_error_t) simcall_file_move(priv->simdata->smx_file, fullpath);
316 }
317
318 /**
319  * \ingroup msg_file_management
320  * \brief Copy a file to another location on a remote host.
321  * \param file : the file to move
322  * \param host : the remote host where the file has to be copied
323  * \param fullpath : the complete path destination on the remote host
324  * \return If successful, the function returns MSG_OK. Otherwise, it returns
325  * MSG_TASK_CANCELED.
326  */
327 msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpath)
328 {
329   msg_file_priv_t file_priv = MSG_file_priv(file);
330   sg_size_t read_size;
331
332   /* Find the host where the file is physically located and read it */
333   msg_storage_t storage_src =(msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, file_priv->storageId);
334   msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
335   msg_host_t attached_host = MSG_host_by_name(storage_priv_src->hostname);
336   MSG_file_seek(file, 0, SEEK_SET);
337   read_size = simcall_file_read(file_priv->simdata->smx_file, file_priv->size, attached_host);
338
339   /* Find the real host destination where the file will be physically stored */
340   xbt_dict_cursor_t cursor = NULL;
341   char *mount_name, *storage_name, *file_mount_name, *host_name_dest;
342   msg_storage_t storage_dest = NULL;
343   msg_host_t host_dest;
344   size_t longest_prefix_length = 0;
345
346   xbt_dict_t storage_list = simcall_host_get_mounted_storage_list(host);
347   xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
348     file_mount_name = (char *) xbt_malloc ((strlen(mount_name)+1));
349     strncpy(file_mount_name,fullpath,strlen(mount_name)+1);
350     file_mount_name[strlen(mount_name)] = '\0';
351
352     if(!strcmp(file_mount_name,mount_name) && strlen(mount_name)>longest_prefix_length){
353       /* The current mount name is found in the full path and is bigger than the previous*/
354       longest_prefix_length = strlen(mount_name);
355       storage_dest = (msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, storage_name);
356     }
357     free(file_mount_name);
358   }
359   xbt_dict_free(&storage_list);
360
361   if(longest_prefix_length>0){
362     /* Mount point found, retrieve the host the storage is attached to */
363     msg_storage_priv_t storage_dest_priv = MSG_storage_priv(storage_dest);
364     host_name_dest = (char*)storage_dest_priv->hostname;
365     host_dest = MSG_host_by_name(host_name_dest);
366
367   }else{
368     XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, SIMIX_host_get_name(host));
369     return MSG_TASK_CANCELED;
370   }
371
372   XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, storage_priv_src->hostname, host_name_dest);
373   msg_host_t *m_host_list = NULL;
374   m_host_list = (msg_host_t*) calloc(2, sizeof(msg_host_t));
375
376   m_host_list[0] = attached_host;
377   m_host_list[1] = host_dest;
378   double flops_amount[] = { 0, 0 };
379   double bytes_amount[] = { 0, (double)read_size, 0, 0 };
380
381   msg_task_t task = MSG_parallel_task_create("file transfer for write", 2, m_host_list, flops_amount, bytes_amount, NULL);
382   msg_error_t transfer = MSG_parallel_task_execute(task);
383   MSG_task_destroy(task);
384   free(m_host_list);
385   if(transfer != MSG_OK){
386     if (transfer == MSG_HOST_FAILURE)
387       XBT_WARN("Transfer error, %s remote host just turned off!", host_name_dest);
388     if (transfer == MSG_TASK_CANCELED)
389       XBT_WARN("Transfer error, task has been canceled!");
390
391     return (msg_error_t) -1;
392   }
393
394   /* Create file on remote host, write it and close it */
395   smx_file_t smx_file = simcall_file_open(fullpath, host_dest);
396   simcall_file_write(smx_file, read_size, host_dest);
397   simcall_file_close(smx_file, host_dest);
398   return MSG_OK;
399
400 }
401
402 /**
403  * \ingroup msg_file_management
404  * \brief Move a file to another location on a remote host.
405  * \param file : the file to move
406  * \param host : the remote host where the file has to be moved
407  * \param fullpath : the complete path destination on the remote host
408  * \return If successful, the function returns MSG_OK. Otherwise, it returns
409  * MSG_TASK_CANCELED.
410  */
411 msg_error_t MSG_file_rmove (msg_file_t file, msg_host_t host, const char* fullpath)
412 {
413   msg_error_t res = MSG_file_rcopy(file, host, fullpath);
414   MSG_file_unlink(file);
415   return res;
416 }
417
418 /**
419  * \brief Destroys a file (internal call only)
420  */
421 void __MSG_file_destroy(msg_file_priv_t file) {
422   xbt_free(file->fullpath);
423   xbt_free(file->simdata);
424   xbt_free(file);
425 }
426 /********************************* Storage **************************************/
427
428 /** @addtogroup msg_storage_management
429  * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Storages" --> \endhtmlonly
430  * (#msg_storage_t) and the functions for managing it.
431  *
432  */
433
434 msg_storage_t __MSG_storage_create(smx_storage_t storage)
435 {
436   const char *name = SIMIX_storage_get_name(storage);
437   const char *host = SIMIX_storage_get_host(storage);
438   msg_storage_priv_t storage_private = xbt_new0(s_msg_storage_priv_t, 1);
439   storage_private->hostname = host;
440   xbt_lib_set(storage_lib,name,MSG_STORAGE_LEVEL,storage_private);
441   return xbt_lib_get_elm_or_null(storage_lib, name);
442 }
443
444 /**
445  * \brief Destroys a storage (internal call only)
446  */
447 void __MSG_storage_destroy(msg_storage_priv_t storage) {
448   free(storage);
449 }
450
451
452 /** \ingroup msg_storage_management
453  *
454  * \brief Returns the name of the #msg_storage_t.
455  *
456  * This functions checks whether a storage is a valid pointer or not and return its name.
457  */
458 const char *MSG_storage_get_name(msg_storage_t storage) {
459   xbt_assert((storage != NULL), "Invalid parameters");
460   return SIMIX_storage_get_name(storage);
461 }
462
463 /** \ingroup msg_storage_management
464  * \brief Returns the free space size of a storage element
465  * \param storage a storage
466  * \return the free space size of the storage element (as a #sg_size_t)
467  */
468 sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
469   return simcall_storage_get_free_size(storage);
470 }
471
472 /** \ingroup msg_storage_management
473  * \brief Returns the used space size of a storage element
474  * \param storage a storage
475  * \return the used space size of the storage element (as a #sg_size_t)
476  */
477 sg_size_t MSG_storage_get_used_size(msg_storage_t storage){
478   return simcall_storage_get_used_size(storage);
479 }
480
481 /** \ingroup msg_storage_management
482  * \brief Returns a xbt_dict_t consisting of the list of properties assigned to this storage
483  * \param storage a storage
484  * \return a dict containing the properties
485  */
486 xbt_dict_t MSG_storage_get_properties(msg_storage_t storage)
487 {
488   xbt_assert((storage != NULL), "Invalid parameters (storage is NULL)");
489   return (simcall_storage_get_properties(storage));
490 }
491
492 /** \ingroup msg_storage_management
493  * \brief Change the value of a given storage property
494  *
495  * \param storage a storage
496  * \param name a property name
497  * \param value what to change the property to
498  * \param free_ctn the freeing function to use to kill the value on need
499  */
500 void MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn) {
501   xbt_dict_set(MSG_storage_get_properties(storage), name, value,free_ctn);
502 }
503
504 /** \ingroup m_storage_management
505  * \brief Returns the value of a given storage property
506  *
507  * \param storage a storage
508  * \param name a property name
509  * \return value of a property (or NULL if property not set)
510  */
511 const char *MSG_storage_get_property_value(msg_storage_t storage, const char *name)
512 {
513   return (char*) xbt_dict_get_or_null(MSG_storage_get_properties(storage), name);
514 }
515
516
517 /** \ingroup msg_storage_management
518  * \brief Finds a msg_storage_t using its name.
519  * \param name the name of a storage
520  * \return the corresponding storage
521  */
522 msg_storage_t MSG_storage_get_by_name(const char *name)
523 {
524   return (msg_storage_t) xbt_lib_get_elm_or_null(storage_lib,name);
525 }
526
527 /** \ingroup msg_storage_management
528  * \brief Returns a dynar containing all the storage elements declared at a given point of time
529  *
530  */
531 xbt_dynar_t MSG_storages_as_dynar(void) {
532
533   xbt_lib_cursor_t cursor;
534   char *key;
535   void **data;
536   xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),NULL);
537
538   xbt_lib_foreach(storage_lib, cursor, key, data) {
539           if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) {
540       xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor);
541       xbt_dynar_push(res, &elm);
542     }
543   }
544   return res;
545 }
546
547 /** \ingroup msg_storage_management
548  *
549  * \brief Set the user data of a #msg_storage_t.
550  * This functions checks whether some data has already been associated to \a storage
551    or not and attach \a data to \a storage if it is possible.
552  */
553 msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data)
554 {
555   msg_storage_priv_t priv = MSG_storage_priv(storage);
556   priv->data = data;
557   return MSG_OK;
558 }
559
560 /** \ingroup m_host_management
561  *
562  * \brief Returns the user data of a #msg_storage_t.
563  *
564  * This functions checks whether \a storage is a valid pointer or not and returns
565    the user data associated to \a storage if it is possible.
566  */
567 void *MSG_storage_get_data(msg_storage_t storage)
568 {
569   xbt_assert((storage != NULL), "Invalid parameters");
570   msg_storage_priv_t priv = MSG_storage_priv(storage);
571   return priv->data;
572 }
573
574 /** \ingroup msg_storage_management
575  *
576  * \brief Returns the content (file list) of a #msg_storage_t.
577  * \param storage a storage
578  * \return The content of this storage element as a dict (full path file => size)
579  */
580 xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
581 {
582   return SIMIX_storage_get_content(storage);
583 }
584
585 /** \ingroup msg_storage_management
586  *
587  * \brief Returns the size of a #msg_storage_t.
588  * \param storage a storage
589  * \return The size of the storage
590  */
591 sg_size_t MSG_storage_get_size(msg_storage_t storage)
592 {
593   return SIMIX_storage_get_size(storage);
594 }
595
596 /** \ingroup msg_storage_management
597  *
598  * \brief Returns the host name the storage is attached to
599  *
600  * This functions checks whether a storage is a valid pointer or not and return its name.
601  */
602 const char *MSG_storage_get_host(msg_storage_t storage) {
603   xbt_assert((storage != NULL), "Invalid parameters");
604   msg_storage_priv_t priv = MSG_storage_priv(storage);
605   return priv->hostname;
606 }