Skip to contentSkip to conversation

scripts: More Python fixes

PATCH Superseded Philippe Mathieu-Daudé 2 participants 6 messages Apr 30, 2020 – May 4, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover scripts: More Python fixes

Trivial Python3 fixes, again...

Since v1:
- Added Alex Bennée A-b tags
- Addressed John Snow review comments
- Use /usr/bin/env
- Do not modify os.path (dropped last patch)

Philippe Mathieu-Daudé (3):
MAINTAINERS: Cover the GDB Python scripts in the gdbstub section scripts/qemugdb: Remove shebang header
scripts/qmp: Use Python 3 interpreter

 MAINTAINERS                  | 1 +
 scripts/qemugdb/__init__.py  | 3 +--
 scripts/qemugdb/aio.py       | 3 +--
 scripts/qemugdb/coroutine.py | 3 +--
 scripts/qemugdb/mtree.py     | 4 +---
 scripts/qemugdb/tcg.py       | 1 -
 scripts/qmp/qom-get          | 2 +-
 scripts/qmp/qom-list         | 2 +-
 scripts/qmp/qom-set          | 2 +-
 scripts/qmp/qom-tree         | 2 +-
 10 files changed, 9 insertions(+), 14 deletions(-)
Signature · 1 line
2.21.1
#1 lore raw

PATCH v2 1/3 MAINTAINERS: Cover the GDB Python scripts in the gdbstub section

Keep an eye on these "same same, but different" files.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 8cbc1fac2b..7a7f2b9c31 100644
@@ -2083,6 +2083,7 @@ R: Philippe Mathieu-Daudé <[email protected]>
 S: Maintained
 F: gdbstub*
 F: gdb-xml/
+F: scripts/qemugdb/
 
 Memory API
 M: Paolo Bonzini <[email protected]>
Signature · 1 line
2.21.1
#2 lore raw

Re: [PATCH v2 1/3] MAINTAINERS: Cover the GDB Python scripts in the gdbstub section

Am 30.04.2020 um 08:57 hat Philippe Mathieu-Daudé geschrieben:

Quoted 13 lines

Keep an eye on these "same same, but different" files.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +0 -0
index 8cbc1fac2b..7a7f2b9c31 100644

MAINTAINERS R: Philippe Mathieu-Daudé <[email protected]> · line 2086

Quoted 4 lines
MAINTAINERS +1 -0
@@ -2083,6 +2083,7 @@ R: Philippe Mathieu-Daudé <[email protected]>
 S: Maintained
 F: gdbstub*
 F: gdb-xml/
+F: scripts/qemugdb/

Wouldn't it make sense to add scripts/qemu-gdb.py as well?

Kevin

#3 lore raw

Re: [PATCH v2 1/3] MAINTAINERS: Cover the GDB Python scripts in the gdbstub section

Quoted 9 lines · Kevin Wolf

Am 30.04.2020 um 08:57 hat Philippe Mathieu-Daudé geschrieben:

Quoted 8 lines

Keep an eye on these "same same, but different" files.

---
  MAINTAINERS | 1 +
  1 file changed, 1 insertion(+)
Quoted 11 lines

MAINTAINERS R: Philippe Mathieu-Daudé <[email protected]> · line 2086

Quoted 9 lines
MAINTAINERS +1 -0
index 8cbc1fac2b..7a7f2b9c31 100644
@@ -2083,6 +2083,7 @@ R: Philippe Mathieu-Daudé <[email protected]>
  S: Maintained
  F: gdbstub*
  F: gdb-xml/
+F: scripts/qemugdb/

Wouldn't it make sense to add scripts/qemu-gdb.py as well?

I agree scripts/qemu-gdb.py with scripts/qemugdb/*py, but now looking at the files closely I don't think they belong to the gdbstub section (GDB protocol, with no knowledge of Python), and rather deserve a new section (GDB Python scripts, with no knowledge of GDB protocol).

I am discarding this patch.

Regards,

Phil.

Quoted 3 lines

Kevin

#4 lore raw

PATCH v2 2/3 scripts/qemugdb: Remove shebang header

In reply to Philippe Mathieu-Daudé

These scripts are loaded as plugin by GDB (and they don't have any __main__ entry point). Remove the shebang header.

---
 scripts/qemugdb/__init__.py  | 3 +--
 scripts/qemugdb/aio.py       | 3 +--
 scripts/qemugdb/coroutine.py | 3 +--
 scripts/qemugdb/mtree.py     | 4 +---
 scripts/qemugdb/tcg.py       | 1 -
 5 files changed, 4 insertions(+), 10 deletions(-)
scripts/qemugdb/__init__.py +1 -2
index 969f552b26..da8ff612e5 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support
 #
 # Copyright (c) 2015 Linaro Ltd
scripts/qemugdb/aio.py +1 -2
index 2ba00c4444..d7c1ba0c28 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support: aio/iohandler debug
 #
 # Copyright (c) 2015 Red Hat, Inc.
scripts/qemugdb/coroutine.py +1 -2
index 41e079d0e2..db61389022 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support
 #
 # Copyright 2012 Red Hat, Inc. and/or its affiliates
scripts/qemugdb/mtree.py +1 -3
index 3030a60d3f..8fe42c3c12 100644
@@ -1,5 +1,4 @@
-#!/usr/bin/python
-
+#
 # GDB debugging support
 #
 # Copyright 2012 Red Hat, Inc. and/or its affiliates
@@ -84,4 +83,3 @@ def print_item(self, ptr, offset = gdb.Value(0), level = 0):
         while not isnull(subregion):
             self.print_item(subregion, addr, level)
             subregion = subregion['subregions_link']['tqe_next']
-
scripts/qemugdb/tcg.py +0 -1
index 18880fc9a7..16c03c06a9 100644
@@ -1,4 +1,3 @@
-#!/usr/bin/python
 # -*- coding: utf-8 -*-
 #
 # GDB debugging support, TCG status
Signature · 1 line
2.21.1
#5 lore raw

PATCH v2 3/3 scripts/qmp: Use Python 3 interpreter

In reply to Philippe Mathieu-Daudé

---
v2: Use /usr/bin/env (jsnow)

---
 scripts/qmp/qom-get  | 2 +-
 scripts/qmp/qom-list | 2 +-
 scripts/qmp/qom-set  | 2 +-
 scripts/qmp/qom-tree | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
scripts/qmp/qom-get +1 -1
index 007b4cd442..7c5ede91bb 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
scripts/qmp/qom-list +1 -1
index 03bda3446b..bb68fd65d4 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
scripts/qmp/qom-set +1 -1
index c37fe78b00..19881d85e9 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
scripts/qmp/qom-tree +1 -1
index 1c8acf61e7..fa91147a03 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ##
 # QEMU Object Model test tools
 #
Signature · 1 line
2.21.1