diff --git a/virttest/qemu_devices/qcontainer.py b/virttest/qemu_devices/qcontainer.py index 96ab2e7d7a..c96a3b2aa2 100644 --- a/virttest/qemu_devices/qcontainer.py +++ b/virttest/qemu_devices/qcontainer.py @@ -1019,8 +1019,10 @@ def pflash_handler(firmware_name, cmd): """ machine_cmd = cmd devs = [] + images = params.objects('images') + firmware_path = params.get(firmware_name + "_path") - if firmware_path: + if firmware_path and images: if not os.path.exists(firmware_path): raise exceptions.TestError("The firmware path is not exist." " Maybe you need to install " @@ -1035,7 +1037,7 @@ def pflash_handler(firmware_name, cmd): pflash_vars_filename) # To ignore the influence from backends - first_image = params.objects('images')[0] + first_image = images[0] img_params = params.object_params(first_image) img_params["backing_chain"] = "no" path = storage.get_image_filename_filesytem(img_params,