Re: [PATCH v2 4/5] python/qemu: qmp: Make QEMUMonitorProtocol a context manager

2020-02-05 Thread John Snow
On 2/4/20 9:11 AM, Wainer dos Santos Moschetta wrote: > This implement the __enter__ and __exit__ functions on > QEMUMonitorProtocol class so that it can be used on 'with' > statement and the resources will be free up on block end: > > with QEMUMonitorProtocol(socket_path) as qmp: > qmp.con

[PATCH v2 4/5] python/qemu: qmp: Make QEMUMonitorProtocol a context manager

2020-02-04 Thread Wainer dos Santos Moschetta
This implement the __enter__ and __exit__ functions on QEMUMonitorProtocol class so that it can be used on 'with' statement and the resources will be free up on block end: with QEMUMonitorProtocol(socket_path) as qmp: qmp.connect() qmp.command('query-status') Signed-off-by: Wainer dos San