blockdev: add a function to parse enum ids from strings