Skip to content

Commit

Permalink
qdevices: type of detect-zeroes should be a string
Browse files Browse the repository at this point in the history
values of "detect-zeroes" should be one of ["on", "off", "unmap"]

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
  • Loading branch information
nickzhq committed Jun 20, 2023
1 parent be85921 commit d268e8e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions virttest/qemu_devices/qdevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,13 @@ def _convert_blkdev_args(args):
:rtype: dict
"""
new_args = dict()
keep_original_type = ("detect-zeroes", )
for key, value in six.iteritems(args):
if value in ('on', 'yes'):
value = True
elif value in ('off', 'no'):
value = False
if key not in keep_original_type:
if value in ('on', 'yes'):
value = True
elif value in ('off', 'no'):
value = False

parts = key.split(".")
d = new_args
Expand Down

0 comments on commit d268e8e

Please sign in to comment.