aboutsummaryrefslogtreecommitdiff
path: root/scripts/qmp/qmp-shell
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-05-04 16:54:29 +0400
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:14:41 +0200
commitc5e397df9e247bff2398400864cde94d1b40317c (patch)
tree1bef5a3d100324bc20245a71da89a6756cf0fd63 /scripts/qmp/qmp-shell
parentaa3b167f21588a87e7783ac29aa54b0c721eb37a (diff)
downloadqemu-c5e397df9e247bff2398400864cde94d1b40317c.zip
qemu-c5e397df9e247bff2398400864cde94d1b40317c.tar.gz
qemu-c5e397df9e247bff2398400864cde94d1b40317c.tar.bz2
qmp-shell: add -N option to skip negotiate
qemu-ga doesn't have negotiate phase. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20170504125432.21653-2-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qmp/qmp-shell')
-rwxr-xr-xscripts/qmp/qmp-shell11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index 6ece6e7..b4d2dbd 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -277,8 +277,8 @@ class QMPShell(qmp.QEMUMonitorProtocol):
self._print(resp)
return True
- def connect(self):
- self._greeting = qmp.QEMUMonitorProtocol.connect(self)
+ def connect(self, negotiate):
+ self._greeting = qmp.QEMUMonitorProtocol.connect(self, negotiate)
self.__completer_setup()
def show_banner(self, msg='Welcome to the QMP low-level shell!'):
@@ -390,7 +390,7 @@ def die(msg):
def fail_cmdline(option=None):
if option:
sys.stderr.write('ERROR: bad command-line option \'%s\'\n' % option)
- sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] < UNIX socket path> | < TCP address:port >\n')
+ sys.stderr.write('qemu-shell [ -v ] [ -p ] [ -H ] [ -N ] < UNIX socket path> | < TCP address:port >\n')
sys.exit(1)
def main():
@@ -399,6 +399,7 @@ def main():
hmp = False
pretty = False
verbose = False
+ negotiate = True
try:
for arg in sys.argv[1:]:
@@ -408,6 +409,8 @@ def main():
hmp = True
elif arg == "-p":
pretty = True
+ elif arg == "-N":
+ negotiate = False
elif arg == "-v":
verbose = True
else:
@@ -425,7 +428,7 @@ def main():
die('bad port number in command-line')
try:
- qemu.connect()
+ qemu.connect(negotiate)
except qmp.QMPConnectError:
die('Didn\'t get QMP greeting message')
except qmp.QMPCapabilitiesError: