Skip to content

Commit

Permalink
Merge pull request avocado-framework#3794 from PaulYuuu/netdev-json-type
Browse files Browse the repository at this point in the history
fix: Add missing conversion for "sndbuf" and other options for QNetdev
  • Loading branch information
YongxueHong authored Nov 15, 2023
2 parents 2aaff10 + eb71f73 commit d61b099
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions virttest/qemu_devices/qdevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,11 @@ def _convert_netdev_args(args):
if (key in ['dnssearch', 'hostfwd', 'guestfwd'] and
isinstance(value, list)):
value = [{'str': v} for v in value]
# https://gitlab.com/qemu-project/qemu/-/blob/master/qapi/net.json#L242
elif key in ('sndbuf', ):
value = int(utils_numeric.normalize_data_size(value, 'B'))
elif isinstance(value, str) and value.isdigit():
value = int(value)
elif value in ('on', 'yes', 'true'):
value = True
elif value in ('off', 'no', 'false'):
Expand Down

0 comments on commit d61b099

Please sign in to comment.