2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2018-04-05 21:41:19 +00:00
|
|
|
* Copyright (c) Intel Corporation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPDK_BDEV_ISCSI_H
|
|
|
|
#define SPDK_BDEV_ISCSI_H
|
|
|
|
|
|
|
|
#include "spdk/bdev.h"
|
|
|
|
|
2022-08-18 09:48:32 +00:00
|
|
|
struct spdk_bdev_iscsi_opts {
|
|
|
|
uint64_t timeout;
|
|
|
|
uint64_t timeout_poller_period_us;
|
|
|
|
};
|
|
|
|
|
2018-06-18 08:07:33 +00:00
|
|
|
typedef void (*spdk_delete_iscsi_complete)(void *cb_arg, int bdeverrno);
|
|
|
|
|
2018-04-05 21:41:19 +00:00
|
|
|
/**
|
|
|
|
* SPDK bdev iSCSI callback type.
|
|
|
|
*
|
|
|
|
* \param cb_arg Completion callback custom arguments
|
|
|
|
* \param bdev created bdev
|
|
|
|
* \param status operation status. Zero on success.
|
|
|
|
*/
|
|
|
|
typedef void (*spdk_bdev_iscsi_create_cb)(void *cb_arg, struct spdk_bdev *bdev, int status);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create new iSCSI bdev.
|
|
|
|
*
|
|
|
|
* \warning iSCSI URL allow providing login and password. Be careful because
|
|
|
|
* they will show up in configuration dump.
|
|
|
|
*
|
|
|
|
* \param name name for new bdev.
|
|
|
|
* \param url iSCSI URL string.
|
2019-11-20 06:49:09 +00:00
|
|
|
* \param initiator_iqn connection iqn name we identify to target as
|
2018-04-05 21:41:19 +00:00
|
|
|
* \param cb_fn Completion callback
|
|
|
|
* \param cb_arg Completion callback custom arguments
|
|
|
|
* \return 0 on success or negative error code. If success bdev with provided name was created.
|
|
|
|
*/
|
2019-11-20 06:49:09 +00:00
|
|
|
int create_iscsi_disk(const char *bdev_name, const char *url, const char *initiator_iqn,
|
2018-04-05 21:41:19 +00:00
|
|
|
spdk_bdev_iscsi_create_cb cb_fn, void *cb_arg);
|
|
|
|
|
2018-06-18 08:07:33 +00:00
|
|
|
/**
|
|
|
|
* Delete iSCSI bdev.
|
|
|
|
*
|
2022-03-29 05:55:53 +00:00
|
|
|
* \param bdev_name Name of iSCSI bdev.
|
2018-06-18 08:07:33 +00:00
|
|
|
* \param cb_fn Completion callback
|
|
|
|
* \param cb_arg Completion callback custom arguments
|
|
|
|
*/
|
2022-03-29 05:55:53 +00:00
|
|
|
void delete_iscsi_disk(const char *bdev_name, spdk_delete_iscsi_complete cb_fn, void *cb_arg);
|
2022-08-18 09:48:32 +00:00
|
|
|
void bdev_iscsi_get_opts(struct spdk_bdev_iscsi_opts *opts);
|
|
|
|
int bdev_iscsi_set_opts(struct spdk_bdev_iscsi_opts *opts);
|
2018-10-29 02:45:42 +00:00
|
|
|
#endif /* SPDK_BDEV_ISCSI_H */
|