diff options
author | Marvin Liu <yong.liu@intel.com> | 2015-07-28 09:56:23 +0800 |
---|---|---|
committer | Marvin Liu <yong.liu@intel.com> | 2015-07-28 10:02:54 +0800 |
commit | 710624f991ee17908cdb1cff046098d1937462fc (patch) | |
tree | 09f675c5d71769395766d3c48a7dadb260fff062 | |
parent | 53405311b0b5dc91c688e4862629cb3036004af6 (diff) | |
download | dts-710624f991ee17908cdb1cff046098d1937462fc.zip dts-710624f991ee17908cdb1cff046098d1937462fc.tar.gz dts-710624f991ee17908cdb1cff046098d1937462fc.tar.xz |
fix bug that vf device do not have sysfs attribute sriov_numvfs
Signed-off-by: Marvin Liu <yong.liu@intel.com>
-rw-r--r-- | framework/net_device.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/framework/net_device.py b/framework/net_device.py index 6796269..9afa6ca 100644 --- a/framework/net_device.py +++ b/framework/net_device.py @@ -518,6 +518,10 @@ class NetDevice(object): "cat /sys/bus/pci/devices/0000\:%s\:%s/sriov_numvfs" % (bus_id, devfun_id), "# ") sriov_vfs_pci = [] + + if "No such file" in sriov_numvfs: + return sriov_vfs_pci + if int(sriov_numvfs) == 0: pass else: |