OCF: add support of dump_info_json
Add some information to vbdev_ocf json config Change-Id: I3b19e1187e833648fe68e8f56a1cddf8ade9fffb Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com> Reviewed-on: https://review.gerrithub.io/c/435773 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
5cefef8039
commit
cab1ea1c05
@ -395,8 +395,20 @@ vbdev_ocf_get_io_channel(void *opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vbdev_ocf_dump_config_info(void *opaque, struct spdk_json_write_ctx *w)
|
vbdev_ocf_dump_info_json(void *opaque, struct spdk_json_write_ctx *w)
|
||||||
{
|
{
|
||||||
|
struct vbdev_ocf *vbdev = opaque;
|
||||||
|
|
||||||
|
spdk_json_write_named_string(w, "cache_device", vbdev->cache.name);
|
||||||
|
spdk_json_write_named_string(w, "core_device", vbdev->core.name);
|
||||||
|
|
||||||
|
spdk_json_write_named_string(w, "mode",
|
||||||
|
ocf_get_cache_modename(ocf_cache_get_mode(vbdev->ocf_cache)));
|
||||||
|
spdk_json_write_named_uint32(w, "cache_line_size",
|
||||||
|
ocf_cache_get_line_size(vbdev->ocf_cache));
|
||||||
|
spdk_json_write_named_bool(w, "metadata_volatile",
|
||||||
|
vbdev->cfg.cache.metadata_volatile);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,8 +439,8 @@ static struct spdk_bdev_fn_table cache_dev_fn_table = {
|
|||||||
.io_type_supported = vbdev_ocf_io_type_supported,
|
.io_type_supported = vbdev_ocf_io_type_supported,
|
||||||
.submit_request = vbdev_ocf_submit_request,
|
.submit_request = vbdev_ocf_submit_request,
|
||||||
.get_io_channel = vbdev_ocf_get_io_channel,
|
.get_io_channel = vbdev_ocf_get_io_channel,
|
||||||
.dump_info_json = vbdev_ocf_dump_config_info,
|
|
||||||
.write_config_json = vbdev_ocf_write_json_config,
|
.write_config_json = vbdev_ocf_write_json_config,
|
||||||
|
.dump_info_json = vbdev_ocf_dump_info_json,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Start OCF cache, attach caching device */
|
/* Start OCF cache, attach caching device */
|
||||||
|
Loading…
Reference in New Issue
Block a user