summary refs log tree commit diff stats
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-05-08 16:51:53 +0200
committerKevin Wolf <kwolf@redhat.com>2012-05-10 10:32:13 +0200
commit863a5d042fdee6b1f602794d99a5121a42e4f181 (patch)
treee52bdc079ec09c96fef4000b258d06e6ed68c815 /tests/qemu-iotests/iotests.py
parentcc785c349de002596a4f4d116e62846fc18d7b9e (diff)
downloadfocaccia-qemu-863a5d042fdee6b1f602794d99a5121a42e4f181.tar.gz
focaccia-qemu-863a5d042fdee6b1f602794d99a5121a42e4f181.zip
stream: fix sectors not allocated test
The test on sectors not allocated can fail if the L1/L2 tables are
not on disk yet.  Allow tests to shutdown the VM early.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 36787cca92..e27b40e289 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -87,10 +87,12 @@ class VM(object):
 
     def shutdown(self):
         '''Terminate the VM and clean up'''
-        self._qmp.cmd('quit')
-        self._popen.wait()
-        os.remove(self._monitor_path)
-        os.remove(self._qemu_log_path)
+        if not self._popen is None:
+            self._qmp.cmd('quit')
+            self._popen.wait()
+            os.remove(self._monitor_path)
+            os.remove(self._qemu_log_path)
+            self._popen = None
 
     def qmp(self, cmd, **args):
         '''Invoke a QMP command and return the result dict'''