Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

settings: don't force qemu_image to be a path#65

Merged
Wenzel merged 2 commits intoIntelLabs:masterfrom
Wenzel:fix_qemu_image_if
Jun 30, 2023
Merged

settings: don't force qemu_image to be a path#65
Wenzel merged 2 commits intoIntelLabs:masterfrom
Wenzel:fix_qemu_image_if

Conversation

@Wenzel
Copy link
Copy Markdown
Contributor

@Wenzel Wenzel commented Jun 8, 2023

This PR removes the Path checking on qemu_image parameter.

In fact, this parameter can be a complex drive description, and not just a file as we assumed.
For example, If I want to specify a qcow image that should be attached with the virtio interface:
--image /home/user/myqemyimage.qcow2,if=virtio

Without the fix:

Traceback (most recent call last):
  File "/home/mtarral/kafl/kafl/.venv/bin/kafl", line 11, in <module>
    load_entry_point('kafl-fuzzer', 'console_scripts', 'kafl')()
  File "/home/mtarral/kafl/kafl/fuzzer/kafl_fuzzer/__main__.py", line 30, in main
    validate()
  File "/home/mtarral/kafl/kafl/fuzzer/kafl_fuzzer/common/config/settings.py", line 184, in validate
    settings.validators.validate()
  File "/home/mtarral/kafl/kafl/.venv/lib/python3.8/site-packages/dynaconf/validator.py", line 467, in validate
    validator.validate(
  File "/home/mtarral/kafl/kafl/.venv/lib/python3.8/site-packages/dynaconf/validator.py", line 213, in validate
    self._validate_items(
  File "/home/mtarral/kafl/kafl/.venv/lib/python3.8/site-packages/dynaconf/validator.py", line 290, in _validate_items
    value = self.cast(settings.get(name))
  File "/home/mtarral/kafl/kafl/fuzzer/kafl_fuzzer/common/config/settings.py", line 87, in cast_expand_path
    raise FileNotFoundError(f"Path {p} doesn't exist")
FileNotFoundError: Path /home/mtarral/.local/share/libvirt/images/windows_x86_64-userspace_vagrant-kafl-windows.img,if=virtio doesn't exist

@Wenzel Wenzel merged commit 5f90394 into IntelLabs:master Jun 30, 2023
@Wenzel Wenzel deleted the fix_qemu_image_if branch June 30, 2023 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant