Allow SR-IOV agent to start when number of vf is 0
Remove number of vf validation from scan_vf_devices method in the eswitch manager module, to allow the SR-IOV agent to load when using PF passthrough. Closes-Bug: #1614086 Change-Id: Iff5bf3a5542d5b19f45637e954a72a14402a30ae
This commit is contained in:
parent
385d9c3f58
commit
f2b33b6727
@ -59,10 +59,6 @@ class PciOsWrapper(object):
|
||||
file_link = os.readlink(file_path)
|
||||
pci_slot = os.path.basename(file_link)
|
||||
vf_list.append((pci_slot, vf_index))
|
||||
if not vf_list:
|
||||
raise exc.InvalidDeviceError(
|
||||
dev_name=dev_name,
|
||||
reason=_("Device has no virtual functions"))
|
||||
return vf_list
|
||||
|
||||
@classmethod
|
||||
|
@ -479,17 +479,15 @@ class TestPciOsWrapper(base.BaseTestCase):
|
||||
def test_scan_vf_devices_no_content(self):
|
||||
with mock.patch("os.path.isdir", return_value=True),\
|
||||
mock.patch("os.listdir", return_value=[]):
|
||||
self.assertRaises(exc.InvalidDeviceError,
|
||||
esm.PciOsWrapper.scan_vf_devices,
|
||||
self.DEV_NAME)
|
||||
self.assertEqual([],
|
||||
esm.PciOsWrapper.scan_vf_devices(self.DEV_NAME))
|
||||
|
||||
def test_scan_vf_devices_no_match(self):
|
||||
with mock.patch("os.path.isdir", return_value=True),\
|
||||
mock.patch("os.listdir",
|
||||
return_value=self.DIR_CONTENTS_NO_MATCH):
|
||||
self.assertRaises(exc.InvalidDeviceError,
|
||||
esm.PciOsWrapper.scan_vf_devices,
|
||||
self.DEV_NAME)
|
||||
self.assertEqual([],
|
||||
esm.PciOsWrapper.scan_vf_devices(self.DEV_NAME))
|
||||
|
||||
@mock.patch("os.listdir", side_effect=OSError())
|
||||
def test_is_assigned_vf_true(self, *args):
|
||||
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
fixes:
|
||||
- Allow SR-IOV agent to run with 0 vfs
|
Loading…
Reference in New Issue
Block a user