-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opae.io: Fix error handling when binding the vfio-pci driver fails #3095
Conversation
Pull Request Test Coverage Report for Build 7818328836
💛 - Coveralls |
binaries/opae.io/opae/io/utils.py
Outdated
@@ -145,6 +145,10 @@ def vfio_init(pci_addr, new_owner='', force=False, **kwargs): | |||
msg = '(0x{:04x},0x{:04x}) at {}'.format( | |||
int(vid_did[0], 16), int(vid_did[1], 16), pci_addr) | |||
|
|||
if not iommu_enabled(): | |||
LOG.error("IOMMU is disabled. Binding failed.") | |||
raise SystemExit("IOMMU is disabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LOG.error message is not exactly correct because the binding "will" fail. How about "Binding to vfio-pci will fail because IOMMU is disabled."
Does the Log.error call and the raise SystemExit result in two messages being printed? We only need error message and a non-zero exit.
Can we improve the commit message to something like the following? opae.io: Fix error handling when binding the vfio-pci driver fails The 'opae.io init' command can fail to bind the vfio-pci driver when the IOMMU is disabled, leaving the system seemingly unable to bind another driver. The fix is to check if the IOMMU is enabled before even attempting to bind the vfio-pci driver. |
The 'opae.io init' command can fail to bind the vfio-pci driver when the IOMMU is disabled, leaving the system seemingly unable to bind another driver. The fix is to check if the IOMMU is enabled before even attempting to bind the vfio-pci driver. Signed-off-by: anandaravuri <[email protected]>
c7125b3
to
000d54d
Compare
The 'opae.io init' command can fail to bind the vfio-pci driver when the IOMMU is disabled, leaving the system seemingly unable to bind another driver. The fix is to check if the IOMMU is enabled before even attempting to bind the vfio-pci driver.