Re: [Qemu-devel] [PATCH v6 02/10] qemu|qtest: Avoid dangerous arguments

2017-08-24 Thread Cleber Rosa
On 08/18/2017 10:26 AM, Lukáš Doktor wrote: > The list object is mutable in python and potentially might modify other > object's arguments when used as default argument. Reproducer: > > >>> vm1 = QEMUMachine("qemu") > >>> vm2 = QEMUMachine("qemu") > >>> vm1._wrapper.append("foo") >

[Qemu-devel] [PATCH v6 02/10] qemu|qtest: Avoid dangerous arguments

2017-08-18 Thread Lukáš Doktor
The list object is mutable in python and potentially might modify other object's arguments when used as default argument. Reproducer: >>> vm1 = QEMUMachine("qemu") >>> vm2 = QEMUMachine("qemu") >>> vm1._wrapper.append("foo") >>> print vm2._wrapper ['foo'] In this case the `arg