Skip to content

Ha lib integration#3

Merged
rohan-puri merged 9 commits intomasterfrom
ha-lib-integration
Apr 6, 2018
Merged

Ha lib integration#3
rohan-puri merged 9 commits intomasterfrom
ha-lib-integration

Conversation

@rohan-puri
Copy link

No description provided.

root and others added 5 commits April 2, 2018 06:46
Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
now basic execution flow is tested, tgt rest api target create
is getting called.

Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
target_create, lun_create
testing pending, ha-lib issue

Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
Rohan Puri added 3 commits April 6, 2018 02:38
Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
This is now achieved by using json_auto_t type, which dereferences
the object at end of scope.

Thanks to Sumit Kapoor, for informing me about this.

Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
Removed unnecessary logs.

Signed-off-by: Rohan Puri <rohan.puri@primaryio.com>
@rohan-puri rohan-puri merged commit feb3aab into master Apr 6, 2018
}

memset(cmd, 0, sizeof(cmd));
snprintf(cmd, sizeof(cmd), "tgtadm --lld iscsi --mode target --op new"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to check return value of snprintf. If thing u wanted in string wrapped.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

}

memset(cmd, 0, sizeof(cmd));
snprintf(cmd, sizeof(cmd), "tgtadm --lld iscsi --mode logicalunit --op new"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check return value of snprintf

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

{
struct _ha_instance *hap = (struct _ha_instance *) userp;

pthread_create(&ha_hb_tid, NULL, &ha_heartbeat, (void *)hap);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check return value. What if thread didn't start?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when this can is called multiple times?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return value checked, if failed, we return error. handled multiple times occurence too.

return HA_CALLBACK_CONTINUE;
}

int tgt_ha_stop_cb(const _ha_request *reqp,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when this cb is called multiple times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants