本文整理汇总了Python中virttest.libvirt_xml.devices.disk.Disk.blockio方法的典型用法代码示例。如果您正苦于以下问题:Python Disk.blockio方法的具体用法?Python Disk.blockio怎么用?Python Disk.blockio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类virttest.libvirt_xml.devices.disk.Disk
的用法示例。
在下文中一共展示了Disk.blockio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from virttest.libvirt_xml.devices.disk import Disk [as 别名]
# 或者: from virttest.libvirt_xml.devices.disk.Disk import blockio [as 别名]
dev_attrs = "file"
elif device_types[i] == "dir":
dev_attrs = "dir"
else:
dev_attrs = "dev"
source_dict = {dev_attrs: disk_source}
if len(startup_policy) > i:
source_dict.update({"startupPolicy": startup_policy[i]})
disk_xml.source = disk_xml.new_disk_source(
**{"attrs": source_dict})
if len(device_bootorder) > i:
disk_xml.boot = device_bootorder[i]
if test_block_size:
disk_xml.blockio = {"logical_block_size": logical_block_size,
"physical_block_size": physical_block_size}
if wwn != "":
disk_xml.wwn = wwn
if serial != "":
disk_xml.serial = serial
if vendor != "":
disk_xml.vendor = vendor
if product != "":
disk_xml.product = product
disk_xml.target = {"dev": device_targets[i], "bus": device_bus[i]}
if len(device_readonly) > i:
disk_xml.readonly = "yes" == device_readonly[i]
# Add driver options from parameters