未验证 提交 b897e5db 编写于 作者: L Lukáš Doktor

Merging pull request 1149

Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>

* https://github.com/autotest/tp-qemu:
  pci_devices: Change the reserved addr format
  pci_devices: Disable "pci_controllers_autosort"
  pci_devices: Decrease the wait timeout
  pci_devices: Avoid clashing names with existing devices
  pci_devices: Cope with the changed return value of make_create_command
......@@ -2,6 +2,7 @@
type = pci_devices
start_vm = no
pci_controllers = ''
pci_controllers_autosort = "no"
Linux:
lspci_cmd = 'lspci -nn -m'
variants:
......
......@@ -216,7 +216,7 @@ def add_device_usb(params, name_idxs, parent_bus, addr, device):
params['usb_type_%s' % name] = device[1]
if not params.get('reserved_slots_%s' % parent_bus):
params['reserved_slots_%s' % parent_bus] = ""
params['reserved_slots_%s' % parent_bus] += " %02x-00" % addr
params['reserved_slots_%s' % parent_bus] += " 0x%x-0x0" % addr
logging.debug("Add test device %s %s %s addr:%s", name, device[1],
parent_bus, addr)
return params, name_idxs
......@@ -263,7 +263,7 @@ def add_virtio_disk(params, name_idxs, parent_bus, addr):
params['image_size_%s' % name] = '1M'
if not params.get('reserved_slots_%s' % parent_bus):
params['reserved_slots_%s' % parent_bus] = ""
params['reserved_slots_%s' % parent_bus] += " %02x-00" % addr
params['reserved_slots_%s' % parent_bus] += " 0x%x-0x0" % addr
logging.debug("Add test device %s virtio_disk %s addr:%s", name,
parent_bus, addr)
return params, name_idxs
......@@ -296,6 +296,8 @@ def run(test, params, env):
env_process.preprocess_vm(test, params, env, params["main_vm"])
vm = env.get_vm(params["main_vm"])
qdev = vm.make_create_command() # parse params into qdev
if isinstance(qdev, tuple):
qdev = qdev[0]
error.context("Getting main PCI bus info")
......@@ -322,7 +324,7 @@ def run(test, params, env):
out += "->(test_devices)"
break
idx = names.get(device, 0) + 1
name = "pci_%s%d" % (device, idx)
name = "test_pci_%s%d" % (device, idx)
names[device] = idx
params, bus = add_bus(qdev, params, device, name, _lasts[_idx])
# we inserted a device, increase the upper bus first idx
......@@ -354,8 +356,8 @@ def run(test, params, env):
vm = env.get_vm(params["main_vm"])
# PCI devices are initialized by firmware, which might require some time
# to setup. Wait 10s before getting the qtree.
time.sleep(10)
# to setup. Wait 5s before getting the qtree.
time.sleep(5)
qtree = qemu_qtree.QtreeContainer()
error.context("Verify qtree vs. qemu devices", logging.info)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册