init: apply settings to context in iscsi_parse_url

if iscsi_context is not NULL we apply the parsed settings
to the context.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2015-03-26 10:32:19 +01:00
parent a45094b7a7
commit 2955b2c616
9 changed files with 20 additions and 88 deletions

View File

@@ -599,6 +599,14 @@ iscsi_parse_url(struct iscsi_context *iscsi, const char *url, int full)
iscsi_decode_url_string(&iscsi_url->target[0]);
/* NOTE: iscsi is allowed to be NULL. Especially qemu does call us with iscsi == NULL.
* If we receive iscsi != NULL we apply the parsed settings to the context. */
if (iscsi) {
iscsi_set_targetname(iscsi, iscsi_url->target);
iscsi_set_initiator_username_pwd(iscsi, iscsi_url->user, iscsi_url->passwd);
iscsi_set_target_username_pwd(iscsi, iscsi_url->target_user, iscsi_url->target_passwd);
}
return iscsi_url;
}