qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC PATCH 3/7] qemu.py: Check console arch is supported be


From: Philippe Mathieu-Daudé
Subject: [Qemu-devel] [RFC PATCH 3/7] qemu.py: Check console arch is supported before calling mktemp()
Date: Thu, 19 Apr 2018 13:46:38 -0300

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 scripts/qemu.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/scripts/qemu.py b/scripts/qemu.py
index 0eecc44d09..379767b62f 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -189,6 +189,16 @@ class QEMUMachine(object):
                 if option in item:
                     return []
 
+        device = '{dev_type},chardev=console'
+        if '86' in self._arch:
+            device = device.format(dev_type='isa-serial')
+        elif 'ppc' in self._arch:
+            device = device.format(dev_type='spapr-vty')
+        elif 's390x' in self._arch:
+            device = device.format(dev_type='sclpconsole')
+        else:
+            return []
+
         chardev = 'socket,id=console,{address},server,nowait'
         if console_address is None:
             console_address = tempfile.mktemp()
@@ -203,16 +213,6 @@ class QEMUMachine(object):
 
         self._console_address = console_address
 
-        device = '{dev_type},chardev=console'
-        if '86' in self._arch:
-            device = device.format(dev_type='isa-serial')
-        elif 'ppc' in self._arch:
-            device = device.format(dev_type='spapr-vty')
-        elif 's390x' in self._arch:
-            device = device.format(dev_type='sclpconsole')
-        else:
-            return []
-
         return ['-chardev', chardev,
                 '-device', device]
 
-- 
2.17.0




reply via email to

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