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 over 2 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 over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit d48defc5a82c2bc955d3c8c9a5a3c7ccea87d5d4 Author: Hans Rosenfeld <firstname.lastname@example.org> Date: 2018-09-26T19:30:14.000Z 9793 vioblk attach doesn't always fail when it should Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Patrick Mooney <firstname.lastname@example.org> Reviewed by: Toomas Soome <email@example.com> Reviewed by: Andy Fiddaman <firstname.lastname@example.org> Approved by: Garrett D'Amore <email@example.com>