Skip to contentSkip to conversation

scripts/cpu-x86-uarch-abi.py: Fix parameter error of cmd

PATCH In review Zhao Liu 3 participants 6 messages Oct 18, 2023 – Nov 7, 2023

lore
Share & tools
lore

Zhao Liu

author
#0 lore raw

PATCH 1/1 scripts/cpu-x86-uarch-abi.py: Fix parameter error of cmd

From: Zhao Liu <[email protected]>

When run this script, there's the error:

python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp
Traceback (most recent call last):
File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in <module>
cpu = shell.cmd("query-cpu-model-expansion",
TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given

Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one).

But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()).

Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error.

Fixes 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()")
---
 scripts/cpu-x86-uarch-abi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/cpu-x86-uarch-abi.py +2 -2
index f6baeeff2400..052ddd751424 100644
@@ -94,8 +94,8 @@
 
 for name in sorted(names):
     cpu = shell.cmd("query-cpu-model-expansion",
-                    { "type": "static",
-                      "model": { "name": name }})
+                    type="static",
+                    model={ "name": name })
 
     got = {}
     for (feature, present) in cpu["model"]["props"].items():
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Zhao Liu

From: Zhao Liu <[email protected]>

When run this script, there's the error:

python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp
Traceback (most recent call last):
File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in <module>
cpu = shell.cmd("query-cpu-model-expansion",
TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given

Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one).

But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()).

Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error.

Fixes 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()")
---
  scripts/cpu-x86-uarch-abi.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
scripts/cpu-x86-uarch-abi.py +0 -0
index f6baeeff2400..052ddd751424 100644

scripts/cpu-x86-uarch-abi.py line 101

Quoted 10 lines
scripts/cpu-x86-uarch-abi.py +2 -2
@@ -94,8 +94,8 @@
 
  for name in sorted(names):
      cpu = shell.cmd("query-cpu-model-expansion",
-                    { "type": "static",
-                      "model": { "name": name }})
+                    type="static",
+                    model={ "name": name })
 
      got = {}
      for (feature, present) in cpu["model"]["props"].items():

Oh, right, thanks for fixing:

Signature · 2 lines
Best regards,
Vladimir
author
#2 lore raw
Quoted 48 lines · Vladimir Sementsov-Ogievskiy

Date: Wed, 18 Oct 2023 13:18:51 +0300
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Subject: Re: [PATCH] scripts/cpu-x86-uarch-abi.py: Fix parameter error of
cmd

Quoted 31 lines · Zhao Liu

From: Zhao Liu <[email protected]>

When run this script, there's the error:

python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp
Traceback (most recent call last):
File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in <module>
cpu = shell.cmd("query-cpu-model-expansion",
TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given

Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one).

But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()).

Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error.

Fixes 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()")
---
  scripts/cpu-x86-uarch-abi.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
scripts/cpu-x86-uarch-abi.py +0 -0
index f6baeeff2400..052ddd751424 100644

scripts/cpu-x86-uarch-abi.py line 99

Quoted 8 lines
scripts/cpu-x86-uarch-abi.py +2 -2
@@ -94,8 +94,8 @@
  for name in sorted(names):
      cpu = shell.cmd("query-cpu-model-expansion",
-                    { "type": "static",
-                      "model": { "name": name }})
+                    type="static",
+                    model={ "name": name })
      got = {}
      for (feature, present) in cpu["model"]["props"].items():

Oh, right, thanks for fixing:

Quoted 1 line

Thanks Vladimir!

-Zhao

author
#3 lore raw
In reply to Zhao Liu

Hi John and Cleber,

Just a ping. :)

Regards,
Zhao

Quoted 49 lines · Zhao Liu

Date: Wed, 18 Oct 2023 18:00:11 +0800
From: Zhao Liu <[email protected]>
Subject: [PATCH] scripts/cpu-x86-uarch-abi.py: Fix parameter error of cmd
X-Mailer: git-send-email 2.34.1

From: Zhao Liu <[email protected]>

When run this script, there's the error:

python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp
Traceback (most recent call last):
File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in <module>
cpu = shell.cmd("query-cpu-model-expansion",
TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given

Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one).

But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()).

Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error.

Fixes 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()")
---
 scripts/cpu-x86-uarch-abi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/cpu-x86-uarch-abi.py +2 -2
index f6baeeff2400..052ddd751424 100644
@@ -94,8 +94,8 @@
 
 for name in sorted(names):
     cpu = shell.cmd("query-cpu-model-expansion",
-                    { "type": "static",
-                      "model": { "name": name }})
+                    type="static",
+                    model={ "name": name })
 
     got = {}
     for (feature, present) in cpu["model"]["props"].items():
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#4 lore raw
In reply to Zhao Liu
Quoted 17 lines · Zhao Liu

From: Zhao Liu <[email protected]>

When run this script, there's the error:

python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp
Traceback (most recent call last):
File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in <module>
cpu = shell.cmd("query-cpu-model-expansion",
TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given

Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one).

But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()).

Quoted 8 lines

Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error.

Fixes 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()")
---
 scripts/cpu-x86-uarch-abi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I'll queue this one and sent a PULL before the final release.

With regards,
Daniel

Signature · 3 lines
|: 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 :|
author
#5 lore raw
Quoted 32 lines · Daniel P. Berrangé

Date: Tue, 7 Nov 2023 14:15:34 +0000
From: "Daniel P. Berrangé" <[email protected]>
Subject: Re: [PATCH] scripts/cpu-x86-uarch-abi.py: Fix parameter error of
cmd

Quoted 17 lines · Zhao Liu

From: Zhao Liu <[email protected]>

When run this script, there's the error:

python3 scripts/cpu-x86-uarch-abi.py /tmp/qmp
Traceback (most recent call last):
File "/path-to-qemu/qemu/scripts/cpu-x86-uarch-abi.py", line 96, in <module>
cpu = shell.cmd("query-cpu-model-expansion",
TypeError: QEMUMonitorProtocol.cmd() takes 2 positional arguments but 3 were given

Commit 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()") converts the the original .cmd() to .command() (which was later renamed to "cmd" to replace the original one).

But the new .cmd() only accepts typing.Mapping as the parameter instead of typing.Dict (see _qmp.execute()).

Quoted 8 lines

Change the paremeters of "query-cpu-model-expansion" to typing.Mapping format to fix this error.

Fixes 7f521b023bc28 ("scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()")
---
 scripts/cpu-x86-uarch-abi.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines

I'll queue this one and sent a PULL before the final release.

Thanks!

Regards,
Zhao

Quoted 8 lines

With regards,
Daniel

Signature · 3 lines
|: 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 :|