Skip to content

Commit

Permalink
qcontainer: Allow empty image in pflash_handler
Browse files Browse the repository at this point in the history
qemu can launch a guest without any images, no need to deal with efi rom
at this time.

Signed-off-by: Yihuang Yu <[email protected]>
  • Loading branch information
PaulYuuu committed Jan 14, 2021
1 parent 4c0b7c6 commit bfcac2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions virttest/qemu_devices/qcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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,
Expand Down

0 comments on commit bfcac2f

Please sign in to comment.