]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qmp-shell: Cope with query-commands error
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 4 May 2017 12:54:30 +0000 (16:54 +0400)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 9 May 2017 07:14:41 +0000 (09:14 +0200)
qemu-ga doesn't implement it.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170504125432.21653-3-marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qmp/qmp-shell

index b4d2dbd292a7189d9a56ab120fb4cff678d9c666..1182f823ef213d2f1fa850e22e254fa784c4b0c2 100755 (executable)
@@ -131,7 +131,10 @@ class QMPShell(qmp.QEMUMonitorProtocol):
         return arg
 
     def _fill_completion(self):
-        for cmd in self.cmd('query-commands')['return']:
+        cmds = self.cmd('query-commands')
+        if cmds.has_key('error'):
+            return
+        for cmd in cmds['return']:
             self._completer.append(cmd['name'])
 
     def __completer_setup(self):