From: Jan Kiszka <[email protected]>

All readouts are optional, but then they will return empty strings.
Converting them to integer will raise ValueError. Catch that and ignore
it - we won't have DebugConsole information then, as desired.

Signed-off-by: Jan Kiszka <[email protected]>
---
 tools/jailhouse-config-create | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create
index 0f75be4f..3005c2e7 100755
--- a/tools/jailhouse-config-create
+++ b/tools/jailhouse-config-create
@@ -191,7 +191,9 @@ class DebugConsole:
         self.address = 0
         self.pio = False
         self.dist1 = False
-        if console != 'none':
+        if console == 'none':
+            return
+        try:
             type = int(input_readline('/sys/class/tty/%s/io_type' % console,
                                       True))
             if type == 0:
@@ -211,6 +213,8 @@ class DebugConsole:
                         '/sys/class/tty/%s/iomem_base' % console, True), 16)
                     self.pio = False
                     self.dist1 = (shift == 0)
+        except ValueError:
+            pass


 if options.generate_collector:
--
2.26.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/ffe5a2f9-3587-42c5-a0bc-6c428719dd73%40web.de.

Reply via email to