o ed@sHdZddlZddlmmZddlmZmZmZGdddej Z dS)z"netplan SR-IOV rebind command lineN) PCIDevicebind_vfs_get_pci_slot_namecs,eZdZfddZddZddZZS)NetplanSriovRebindcstjdddddS)NrebindzKRebind SR-IOV virtual functions of given physical functions to their driverT) command_id descriptionleaf)super__init__self __class__7/usr/share/netplan/netplan/cli/commands/sriov_rebind.pyr s zNetplanSriovRebind.__init__cCs2|jjdtdgdd|j|_||dS)Nnetdevs*z*Space separated list of PF interface names)typenargsdefaulthelp)parser add_argumentstrcommand_rebindfunc parse_args run_commandr rrrrun!s  zNetplanSriovRebind.runcCs\|jD](}t|}t|}|jstd|qt|j|j }t d|t |qdS)zeBind virtual functions of SR-IOV devices to their corresponding driver after eswitch mode was changedz1{} does not seem to be a SR-IOV physical functionz{}: bound {} VFsN) rrris_pfloggingwarningformatrvfsdriverinfolen)r ifacepci_addrpcidev bound_vfsrrrr)s z!NetplanSriovRebind.command_rebind)__name__ __module__ __qualname__r rr __classcell__rrrrrs r) __doc__r!netplan.cli.utilscliutilsnetplan.cli.sriovrrrNetplanCommandrrrrrs