本文整理汇总了Python中virttest.libvirt_xml.devices.controller.Controller.model_name方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.model_name方法的具体用法?Python Controller.model_name怎么用?Python Controller.model_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类virttest.libvirt_xml.devices.controller.Controller
的用法示例。
在下文中一共展示了Controller.model_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_pci_device
# 需要导入模块: from virttest.libvirt_xml.devices.controller import Controller [as 别名]
# 或者: from virttest.libvirt_xml.devices.controller.Controller import model_name [as 别名]
def create_pci_device(pci_model, pci_model_name, **kwargs):
"""
Create a pci/pcie bridge
:param pci_model: model of pci controller device
:param pci_model_name: model name of pci controller device
:param kwargs: other k-w args that needed to create device
:return: the newly created device object
"""
pci_bridge = Controller('pci')
pci_bridge.model = pci_model
pci_bridge.model_name = {'name': pci_model_name}
if 'index' in kwargs:
pci_bridge.index = kwargs['index']
if 'address' in kwargs:
pci_bridge.address = pci_bridge.new_controller_address(
attrs=eval(kwargs['address']))
logging.debug('pci_bridge: %s', pci_bridge)
return pci_bridge