For 1st question, the bdev close/destruct is usually in the aysnc mode if there are ongoing IOs. The SPDK bdev framework will handle that from my understanding. For 2nd question, take nvme bdev as example, there is a config_json function pointer for the json related configuration. And for the specific log related, you could take a look at SPDK_LOG_REGISTER_COMPONENT macro first. static struct spdk_bdev_module nvme_if = { .name = "nvme", .async_fini = true, .module_init = bdev_nvme_library_init, .module_fini = bdev_nvme_library_fini, .config_json = bdev_nvme_config_json, .get_ctx_size = bdev_nvme_get_ctx_size, }; SPDK_BDEV_MODULE_REGISTER(nvme, &nvme_if) -----Original Message----- From: liushengchao02(a)meituan.com Sent: Thursday, February 10, 2022 11:18 To: spdk(a)lists.01.org Subject: [SPDK] Some questions about SPDK bdev module I have read the source code of SPDK and implemented my own bdev module by referencing official bdev modules like null, malloc and aio. But I still have some questions and hope someone can explain. 1.When a bdev is deleted, the 'destruct' function pointer of spdk_bdev_fn_table is called and the block device is closed. I find that ongoing spdk_bdev_io is not explicitly completed by calling spdk_bdev_io_complete(). Are these spdk_bdev_io cleaned automatically by SPDK framework? 2.How to write the json config that corresponds to the rpc call of 'log_set_flag'? I have tried many ways but still can not work and I have to implement my own version of rpc call in my own bdev module to enable json config. Thanks! _______________________________________________ SPDK mailing list -- spdk(a)lists.01.org To unsubscribe send an email to spdk-leave(a)lists.01.org