[PATCH v2 09/18] python: backport 'qmp-shell-wrap: handle missing binary gracefully'

John Snow posted 18 patches 5 months, 1 week ago
Maintainers: John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
[PATCH v2 09/18] python: backport 'qmp-shell-wrap: handle missing binary gracefully'
Posted by John Snow 5 months, 1 week ago
Signed-off-by: John Snow <jsnow@redhat.com>
cherry picked from commit 9c889dcbd58817b0c917a9d2dd16161f48ac8203
Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/qemu/qmp/qmp_shell.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python/qemu/qmp/qmp_shell.py b/python/qemu/qmp/qmp_shell.py
index 02028e94b5a..c923ff09e1f 100644
--- a/python/qemu/qmp/qmp_shell.py
+++ b/python/qemu/qmp/qmp_shell.py
@@ -607,6 +607,8 @@ def main_wrap() -> None:
 
                 for _ in qemu.repl():
                     pass
+    except FileNotFoundError:
+        sys.stderr.write(f"ERROR: QEMU executable '{cmd[0]}' not found.\n")
     finally:
         os.unlink(sockpath)
 
-- 
2.50.1
Re: [PATCH v2 09/18] python: backport 'qmp-shell-wrap: handle missing binary gracefully'
Posted by Daniel P. Berrangé 5 months ago
On Wed, Sep 03, 2025 at 01:11:15AM -0400, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>
> cherry picked from commit 9c889dcbd58817b0c917a9d2dd16161f48ac8203
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/qemu/qmp/qmp_shell.py | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|