qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v9 7/8] qemu.py: launch vm only if it's not running


From: Amador Pahim
Subject: [Qemu-devel] [PATCH v9 7/8] qemu.py: launch vm only if it's not running
Date: Mon, 13 Nov 2017 22:39:44 +0100

If we allow launching VM again we will loose track of the first launched
VM.

Reviewed-by: Fam Zheng <address@hidden>
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 ed9fed58ed..7303952328 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -197,6 +197,9 @@ class QEMUMachine(object):
         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.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]