vioblk attach doesn't always fail when it should
The attach function in vioblk is quite broken w.r.t. the error code it returns. On error (but not success) it will return 'ret', which defaults to DDI_SUCCESS and is set to DDI_FAILURE (or any other value indicating failure) in some places. Of course it doesn't always set it to DDI_FAILURE, like when interrupt allocation fails. This means vioblk will attach despite attach() failing, leaving the driver in an unitialized state and causing issues on detach() and quiesce().
Updated by Hans Rosenfeld about 3 years ago
Testing: I ran this on bhyve. With just the fix for 9790 (but not 9792) attach would no longer panic, but also wouldn't return failure despite not being able to get interrupts. This half-attached state in turn would cause a panic when rebooting in vioblk_quiesce(). With this change on top of 9790 it will properly fail the attach and nothing unexpected happens when rebooting.
Updated by Electric Monk about 3 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit d48defc5a82c2bc955d3c8c9a5a3c7ccea87d5d4 Author: Hans Rosenfeld <email@example.com> Date: 2018-09-26T19:30:14.000Z 9793 vioblk attach doesn't always fail when it should Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Reviewed by: Patrick Mooney <email@example.com> Reviewed by: Toomas Soome <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Approved by: Garrett D'Amore <firstname.lastname@example.org>