Stefan Hajnoczi d792bc3811 qemu.py: make VM() a context manager
There are a number of ways to ensure that the QEMU process is shut down
when the test ends, including atexit.register(), try: finally:, or
unittest.teardown() methods.  All of these require extra code and the
programmer must remember to add vm.shutdown().

A nice solution is context managers:

  with VM(binary) as vm:
      ...
  # vm is guaranteed to be shut down here

Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Message-id: 20170824072202.26818-2-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-09-05 10:32:06 +01:00
..
2017-03-03 16:40:02 +01:00
2017-07-20 09:56:41 +02:00
2017-07-11 17:42:49 +03:00
2017-09-04 13:09:13 +02:00
2017-09-05 10:32:06 +01:00
2017-05-19 12:29:01 +02:00