]> Git Repo - qemu.git/commitdiff
qmp.py: Avoid overriding a builtin object
authorLukáš Doktor <[email protected]>
Fri, 18 Aug 2017 14:26:12 +0000 (16:26 +0200)
committerEduardo Habkost <[email protected]>
Fri, 15 Sep 2017 23:12:00 +0000 (20:12 -0300)
The "id" is a builtin method to get object's identity and should not be
overridden. This might bring some issues in case someone was directly
calling "cmd(..., id=id)" but I haven't found such usage on brief search
for "cmd\(.*id=".

Signed-off-by: Lukáš Doktor <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Message-Id: <20170818142613[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
scripts/qmp/qmp.py

index f2f5a9b296f7c644f2c8ee429432b482e352ce80..ef12e8a1a0eddcb864f965d4819b15890e2aeec9 100644 (file)
@@ -177,19 +177,19 @@ class QEMUMonitorProtocol(object):
             print >>sys.stderr, "QMP:<<< %s" % resp
         return resp
 
-    def cmd(self, name, args=None, id=None):
+    def cmd(self, name, args=None, cmd_id=None):
         """
         Build a QMP command and send it to the QMP Monitor.
 
         @param name: command name (string)
         @param args: command arguments (dict)
-        @param id: command id (dict, list, string or int)
+        @param cmd_id: command id (dict, list, string or int)
         """
         qmp_cmd = {'execute': name}
         if args:
             qmp_cmd['arguments'] = args
-        if id:
-            qmp_cmd['id'] = id
+        if cmd_id:
+            qmp_cmd['id'] = cmd_id
         return self.cmd_obj(qmp_cmd)
 
     def command(self, cmd, **kwds):
This page took 0.026482 seconds and 4 git commands to generate.