Files
qemu/python
Wainer dos Santos Moschetta 07608e807d python/qemu: qmp: Make QEMUMonitorProtocol a context manager
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 Santos Moschetta <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
2020-02-07 15:12:48 +01:00
..