⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.70
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
netplan
/
netplan
/
cli
/
__pycache__
/
View File Name :
sriov.cpython-310.pyc
o edF @ s d dl Z d dlZd dlZd dlZd dlmZ d dlm mZ d dl m Z d dlmZ d dl Z G dd deZdeje fddZdeje d eje fd dZdd Zdd Zdd Zdd Zdd ZdddZdddZdS ) N)defaultdict)ConfigurationErrorc @ s e Zd ZdZdefddZedefddZedefdd Zd edefddZ edefd dZ edefddZedefddZ edefddZedefddZedefddZdededefddZdefddZd S )! PCIDevicez.Helper class for interaction with a PCI devicepci_addrc C s || _ dS )znInitialise a new PCI device handler :param pci_addr: PCI address of device :type: str Nr )selfr r '/usr/share/netplan/netplan/cli/sriov.py__init__' s zPCIDevice.__init__returnc C s dS )zusysfs path (can be overridden for testing) :return: full path to /sys filesystem :rtype: str z/sysr r r r r sys. s z PCIDevice.sysc C s t j| jd| jS )zq/sys path for PCI device :return: full path to PCI device in /sys filesystem :rtype: str zbus/pci/devices)ospathjoinr r r r r r r 6 s zPCIDevice.pathsubpathc C s t j| j|S )z/sys subpath helper for PCI device :param subpath: subpath to construct path for :type: str :return: self.path + subpath :rtype: str )r r r )r r r r r r > s zPCIDevice.subpathc C s2 d}t j| drt jt | d}|S )zjKernel driver for PCI device :return: kernel driver in use for device :rtype: str driver)r r existsr basenamereadlink)r r r r r r G s zPCIDevice.driverc C t j| dS )zDetermine if device is bound to a kernel driver :return: whether device is bound to a kernel driver :rtype: bool r r r r r r r r r boundR zPCIDevice.boundc C r )zwDetermine if device is a SR-IOV Physical Function :return: whether device is a PF :rtype: bool sriov_numvfsr r r r r is_pfZ r zPCIDevice.is_pfc C r )zvDetermine if device is a SR-IOV Virtual Function :return: whether device is a VF :rtype: bool physfnr r r r r is_vfb r zPCIDevice.is_vfc C sR g }d} z| tjt| d| W n ty# Y |S w |d7 }q)zList Virtual Function addresses associated with a Physical Function :return: List of PCI addresses of Virtual Functions :rtype: list[str] r Tzvirtfn{} )appendr r r r r formatFileNotFoundError)r vf_addrsir r r r# j s zPCIDevice.vf_addrsc C s dd | j D S )zList Virtual Function associated with a Physical Function :return: List of PCI devices of Virtual Functions :rtype: list[PCIDevice] c S s g | ]}t |qS r )r ).0addrr r r