While experimenting with this project, I encountered some errors (most were user error on my part). I've put together this batch of targeted changes to add more detail to some of the error messages I encountered, and to address issues with potential leaks and uninitialized variables that I encountered in other cases.
Specifically:
demo_event.c and demo_null.c had some minor potential leaks in a few failure paths.
Trying to add a device with an unknown type resulted in a NULL dereference.
Added error messages in a few cases that failed silently (e.g., no device type given on the command line).
Added errno/return value to a few error messages (most notably, the error that shows up if /dev/ublk-control can't be opened)
Tweaked logic in main to be able to display command usage help in more cases.
Please do let me know if you'd prefer that any of this get split up into separate changes, or really any feedback you have. I'm new to using this project and looking to learn. (Thanks!)
While experimenting with this project, I encountered some errors (most were user error on my part). I've put together this batch of targeted changes to add more detail to some of the error messages I encountered, and to address issues with potential leaks and uninitialized variables that I encountered in other cases.
Specifically:
demo_event.c
anddemo_null.c
had some minor potential leaks in a few failure paths.NULL
dereference.errno
/return value to a few error messages (most notably, the error that shows up if/dev/ublk-control
can't be opened)main
to be able to display command usage help in more cases.Please do let me know if you'd prefer that any of this get split up into separate changes, or really any feedback you have. I'm new to using this project and looking to learn. (Thanks!)