Spdk/include/spdk/ublk.h
Yifan Bian ed2b53f389 ublk: add configure and event/subsystem
ublk backend could support ublk driver with kernel. Specify
configuration parameter to start it up.

Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Co-authored-by: Xiaodong Liu <xiaodong.liu@intel.com>
Change-Id: I55e7d757e04315b25e9bfab5fdcbb6621be3e29e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15680
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-20 07:48:25 +00:00

43 lines
809 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (C) 2022 Intel Corporation.
* All rights reserved.
*/
#ifndef SPDK_UBLK_H_
#define SPDK_UBLK_H_
#include "spdk/json.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*spdk_ublk_fini_cb)(void *arg);
/**
* Initialize the ublk library.
*/
void spdk_ublk_init(void);
/**
* Stop the ublk layer and close all running ublk block devices.
*
* \param cb_fn Callback to be always called.
* \param cb_arg Passed to cb_fn.
* \return 0 on success.
*/
int spdk_ublk_fini(spdk_ublk_fini_cb cb_fn, void *cb_arg);
/**
* Write UBLK subsystem configuration into provided JSON context.
*
* \param w JSON write context
*/
void spdk_ublk_write_config_json(struct spdk_json_write_ctx *w);
#ifdef __cplusplus
}
#endif
#endif /* SPDK_UBLK_H_ */