qmp-shell: Cope with query-commands error

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>
This commit is contained in:
Marc-André Lureau
2017-05-09 09:14:41 +02:00
committed by Markus Armbruster
parent c5e397df9e
commit daa5a72eba
+4 -1
View File
@@ -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):