bdev/pmem: add JSON config dump
Change-Id: Ife5ed73d6c3eacb24ea33237c843ec68914796fd Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/401222 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
523b208f17
commit
e301860fb3
@ -278,12 +278,30 @@ bdev_pmem_destroy_cb(void *io_device, void *ctx_buf)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
bdev_pmem_write_config_json(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w)
|
||||
{
|
||||
struct pmem_disk *disk = bdev->ctxt;
|
||||
|
||||
spdk_json_write_object_begin(w);
|
||||
|
||||
spdk_json_write_named_string(w, "method", "construct_pmem_bdev");
|
||||
|
||||
spdk_json_write_named_object_begin(w, "params");
|
||||
spdk_json_write_named_string(w, "name", bdev->name);
|
||||
spdk_json_write_named_string(w, "pmem_file", disk->pmem_file);
|
||||
spdk_json_write_object_end(w);
|
||||
|
||||
spdk_json_write_object_end(w);
|
||||
}
|
||||
|
||||
static const struct spdk_bdev_fn_table pmem_fn_table = {
|
||||
.destruct = bdev_pmem_destruct,
|
||||
.submit_request = bdev_pmem_submit_request,
|
||||
.io_type_supported = bdev_pmem_io_type_supported,
|
||||
.get_io_channel = bdev_pmem_get_io_channel,
|
||||
.dump_info_json = bdev_pmem_dump_info_json,
|
||||
.write_config_json = bdev_pmem_write_config_json,
|
||||
};
|
||||
|
||||
int
|
||||
|
Loading…
x
Reference in New Issue
Block a user