[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 12/13] qemu.py: launch vm only if it's not runnin
From: |
Amador Pahim |
Subject: |
[Qemu-devel] [PATCH v8 12/13] qemu.py: launch vm only if it's not running |
Date: |
Fri, 1 Sep 2017 13:28:28 +0200 |
A new call to launch() with a running VM will fall in exception and
consequently call shutdown().
This patch makes launch() to raise an exception when it's called with VM
already running.
Signed-off-by: Amador Pahim <address@hidden>
---
scripts/qemu.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/qemu.py b/scripts/qemu.py
index 03e4cc34b7..363f649a7e 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -165,6 +165,9 @@ class QEMUMachine(object):
Try to launch the VM and make sure we cleanup and expose the
command line/output in case of exception.
'''
+ if self.is_running():
+ raise QEMUMachineError('VM already running')
+
self._iolog = None
self._qemu_full_args = None
try:
--
2.13.5
- [Qemu-devel] [PATCH v8 07/13] qemu.py: close _qemu_log_path on cleanup, (continued)
- [Qemu-devel] [PATCH v8 07/13] qemu.py: close _qemu_log_path on cleanup, Amador Pahim, 2017/09/01
- [Qemu-devel] [PATCH v8 09/13] qemu.py: always cleanup on shutdown(), Amador Pahim, 2017/09/01
- [Qemu-devel] [PATCH v8 08/13] qemu.py: refactor launch(), Amador Pahim, 2017/09/01
- [Qemu-devel] [PATCH v8 10/13] qemu.py: use poll() instead of 'returncode', Amador Pahim, 2017/09/01
- [Qemu-devel] [PATCH v8 11/13] qemu.py: cleanup redundant calls in launch(), Amador Pahim, 2017/09/01
- [Qemu-devel] [PATCH v8 12/13] qemu.py: launch vm only if it's not running,
Amador Pahim <=
- [Qemu-devel] [PATCH v8 13/13] qemu.py: don't launch again before shutdown(), Amador Pahim, 2017/09/01
- Re: [Qemu-devel] [PATCH v8 00/13] scripts/qemu.py fixes and cleanups, Stefan Hajnoczi, 2017/09/05
- Re: [Qemu-devel] [PATCH v8 00/13] scripts/qemu.py fixes and cleanups, Eduardo Habkost, 2017/09/14