Skip to content

Commit

Permalink
Fix review comment.
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Whisonant <[email protected]>
  • Loading branch information
Tim Whisonant committed Nov 8, 2023
1 parent 4b208f0 commit 18a0ca7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions binaries/opae.io/opae/io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,16 @@ def chown_pci_sva(pci_addr, uid, gid):

def enable_sriov(enable):
sriov = '/sys/module/vfio_pci/parameters/enable_sriov'
if os.path.exists(sriov):
LOG.info('Enabling SR-IOV for vfio-pci')
try:
with open(sriov, 'w') as outf:
outf.write('Y' if enable else 'N')
except OSError:
return False
return True
return False
if not os.path.exists(sriov):
return False

LOG.info('Enabling SR-IOV for vfio-pci')
try:
with open(sriov, 'w') as outf:
outf.write('Y' if enable else 'N')
except OSError:
return False
return True


def vfio_init(pci_addr, new_owner='', force=False, **kwargs):
Expand Down

0 comments on commit 18a0ca7

Please sign in to comment.