xref: /spdk/module/bdev/passthru/vbdev_passthru.h (revision cf151d60e64ad49fcad18dc82ca4f02500b6f07d)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (C) 2018 Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 #ifndef SPDK_VBDEV_PASSTHRU_H
7 #define SPDK_VBDEV_PASSTHRU_H
8 
9 #include "spdk/stdinc.h"
10 
11 #include "spdk/bdev.h"
12 #include "spdk/bdev_module.h"
13 
14 /**
15  * Create new pass through bdev.
16  *
17  * \param bdev_name Bdev on which pass through vbdev will be created.
18  * \param vbdev_name Name of the pass through bdev.
19  * \param uuid Optional UUID to assign to the pass through bdev.
20  * \return 0 on success, other on failure.
21  */
22 int bdev_passthru_create_disk(const char *bdev_name, const char *vbdev_name,
23 			      const struct spdk_uuid *uuid);
24 
25 /**
26  * Delete passthru bdev.
27  *
28  * \param bdev_name Name of the pass through bdev.
29  * \param cb_fn Function to call after deletion.
30  * \param cb_arg Argument to pass to cb_fn.
31  */
32 void bdev_passthru_delete_disk(const char *bdev_name, spdk_bdev_unregister_cb cb_fn,
33 			       void *cb_arg);
34 
35 #endif /* SPDK_VBDEV_PASSTHRU_H */
36