diff options
author | sr | 2012-12-19 19:35:32 +0100 |
---|---|---|
committer | sr | 2012-12-19 19:35:32 +0100 |
commit | fb6432cb3de7fc8dde366805b5cb9f4a82b85660 (patch) | |
tree | 813430ae0dde9a2ee6553736b0b6dabf22a5f985 /src/server/saveload.c | |
parent | [SERVER] Remove unix socket support for RPC interface (diff) | |
download | dnbd3-fb6432cb3de7fc8dde366805b5cb9f4a82b85660.tar.gz dnbd3-fb6432cb3de7fc8dde366805b5cb9f4a82b85660.tar.xz dnbd3-fb6432cb3de7fc8dde366805b5cb9f4a82b85660.zip |
[SERVER] Refactor code
[SERVER] Return List of Alt Servers on RPC_IMG_LIST
Diffstat (limited to 'src/server/saveload.c')
-rw-r--r-- | src/server/saveload.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/saveload.c b/src/server/saveload.c index 18dbae9..9b5318a 100644 --- a/src/server/saveload.c +++ b/src/server/saveload.c @@ -66,7 +66,7 @@ void dnbd3_load_config() srand(time(NULL)); - _ipc_password = g_key_file_get_string(_config_handle, "settings", "password", NULL); + _rpc_password = g_key_file_get_string(_config_handle, "settings", "password", NULL); _cache_dir = g_key_file_get_string(_config_handle, "settings", "cache_dir", NULL); if (_cache_dir == NULL) @@ -154,7 +154,7 @@ int dnbd3_add_image(dnbd3_image_t *image) close(fh); } // Lock here to prevent concurrent add calls to mess rids up. Cannot happen currently - // as IPC clients are not threaded and they're the only place where this is called, + // as RPC clients are not threaded and they're the only place where this is called, // but better be safe for the future... pthread_spin_lock(&_spinlock); if (image->rid == 0) @@ -371,13 +371,15 @@ static dnbd3_image_t *prepare_image(char *image_name, int rid, char *image_file, image->low_name = strdup(image_name); } + strtolower(image->low_name); + memlogf("[INFO] Loading image '%s'", image->low_name); + if (dnbd3_get_image(image->low_name, rid, 0)) { memlogf("[ERROR] Duplicate image in config: '%s' rid:%d", image_name, rid); goto error; } - strtolower(image->low_name); image->config_group = strdup(image_name); image->rid = rid; |