]> git.proxmox.com Git - mirror_qemu.git/commit
python/qemu: make 'args' style arguments immutable
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Oct 2020 23:58:06 +0000 (19:58 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 13:37:57 +0000 (09:37 -0400)
commitaad3f3bb6c8b63b33db30911748fe32928b7b4bd
tree8b05fc8b5e6fa38a88f7609ce3efa2c9daf4c36f
parent9223fda464690b83a2b1f1487163f50602454c2e
python/qemu: make 'args' style arguments immutable

These arguments don't need to be mutable and aren't really used as
such. Clarify their types as immutable and adjust code to match where
necessary.

In general, It's probably best not to accept a user-defined mutable
object and store it as internal object state unless there's a strong
justification for doing so. Instead, try to use generic types as input
with empty tuples as the default, and coerce to list where necessary.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201006235817.3280413-10-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/machine.py
python/qemu/qtest.py